MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / _map_location

Function _map_location

python/oneflow/framework/check_point_v2.py:261–266  ·  view source on GitHub ↗
(obj: Any, map_location: MAP_LOCATION)

Source from the content-addressed store, hash-verified

259
260
261def _map_location(obj: Any, map_location: MAP_LOCATION):
262 if isinstance(obj, flow.nn.Module):
263 return module_to(obj, map_location)
264 else:
265 res = ArgsTree(obj).map_leaf(lambda x: smart_to(x, map_location))
266 return res
267
268
269def _LoadSingleVariable(

Callers 2

load_from_pytorch_fileFunction · 0.85

Calls 4

ArgsTreeClass · 0.90
module_toFunction · 0.85
smart_toFunction · 0.85
map_leafMethod · 0.80

Tested by

no test coverage detected