(obj: Any, map_location: MAP_LOCATION)
| 259 | |
| 260 | |
| 261 | def _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 | |
| 269 | def _LoadSingleVariable( |
no test coverage detected