MCPcopy
hub / github.com/facebookresearch/mmf / _torch_load

Method _torch_load

pythia/utils/checkpoint.py:176–180  ·  view source on GitHub ↗
(self, file)

Source from the content-addressed store, hash-verified

174 getattr(model, key).load_state_dict(ckpt_model[attr_mapping[key]])
175
176 def _torch_load(self, file):
177 if "cuda" in str(self.device):
178 return torch.load(file)
179 else:
180 return torch.load(file, map_location=lambda storage, loc: storage)
181
182 def _get_vcs_fields(self):
183 """Returns a dict with git fields of the current repository

Callers 2

_loadMethod · 0.95
restoreMethod · 0.95

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected