mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Summary: TensorList, DoubleList, and BoolList were missing from the pickler, so this adds them. As a follow up a lot of the code for these could be templated and cut down ](https://our.intern.facebook.com/intern/diff/15299106/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/20191 Pulled By: driazati Differential Revision: D15299106 fbshipit-source-id: f10c0c9af9d60a6b7fb8d93cea9f550b1a7e2415
24 lines
402 B
Python
24 lines
402 B
Python
# These functions are referenced from the pickle archives produced by
|
|
# ScriptModule.save()
|
|
|
|
def build_intlist(data):
|
|
return data
|
|
|
|
|
|
def build_tensorlist(data):
|
|
return data
|
|
|
|
|
|
def build_doublelist(data):
|
|
return data
|
|
|
|
|
|
def build_boollist(data):
|
|
return data
|
|
|
|
|
|
def build_tensor_from_id(data):
|
|
if isinstance(data, int):
|
|
# just the id, can't really do anything
|
|
return data
|