MCPcopy
hub / github.com/shenweichen/DeepCTR-Torch / _torch_load_compat

Function _torch_load_compat

tests/utils.py:13–18  ·  view source on GitHub ↗
(filepath)

Source from the content-addressed store, hash-verified

11
12
13def _torch_load_compat(filepath):
14 kwargs = {"map_location": "cpu"}
15 try:
16 return torch.load(filepath, weights_only=False, **kwargs)
17 except TypeError:
18 return torch.load(filepath, **kwargs)
19
20
21def gen_sequence(dim, max_len, sample_size):

Callers 1

check_modelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected