5726675a25fd1e2a15bf879de4d00d6025923ae0,models/base_model.py,BaseModel,load_networks,#BaseModel#,118

Before Change


                // if you are using PyTorch newer than 0.4 (e.g., built from
                // GitHub source), you can remove str() on self.device
                state_dict = torch.load(load_path, map_location=str(self.device))
                del state_dict._metadata

                // patch InstanceNorm checkpoints prior to 0.4
                for key in list(state_dict.keys()):  // need to copy keys here because we mutate in loop
                    self.__patch_instance_norm_state_dict(state_dict, net, key.split("."))

After Change


                // if you are using PyTorch newer than 0.4 (e.g., built from
                // GitHub source), you can remove str() on self.device
                state_dict = torch.load(load_path, map_location=str(self.device))
                if hasattr(state_dict, "_metadata"):
                    del state_dict._metadata

                // patch InstanceNorm checkpoints prior to 0.4
                for key in list(state_dict.keys()):  // need to copy keys here because we mutate in loop
                    self.__patch_instance_norm_state_dict(state_dict, net, key.split("."))
                net.load_state_dict(state_dict)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: junyanz/pytorch-CycleGAN-and-pix2pix
Commit Name: 5726675a25fd1e2a15bf879de4d00d6025923ae0
Time: 2018-07-25
Author: taesung89@gmail.com
File Name: models/base_model.py
Class Name: BaseModel
Method Name: load_networks


Project Name: lmcinnes/pynndescent
Commit Name: 3452cdbe9f0a964f22c5c4ea6aeb8c026af040d3
Time: 2020-09-07
Author: leland.mcinnes@gmail.com
File Name: pynndescent/pynndescent_.py
Class Name: NNDescent
Method Name: compress_index


Project Name: lmcinnes/pynndescent
Commit Name: c1c31db36facdf8d557f4dcc69866ac86814b83f
Time: 2020-09-01
Author: leland.mcinnes@gmail.com
File Name: pynndescent/pynndescent_.py
Class Name: NNDescent
Method Name: _init_search_graph