Files
pytorch/torch/jit/_pickle.py
davidriazati 00d0ddb140 Add all list specializations to pickler (#20191)
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
2019-05-10 17:14:42 -07:00

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