Add tensor table in ModelDef and use it for jit script serialization and deserializat...
authorLu Fang <lufang@fb.com>
Wed, 21 Nov 2018 07:33:30 +0000 (23:33 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 21 Nov 2018 07:37:50 +0000 (23:37 -0800)
commit7a654617ebcdb380737e5c0747eee68a9366b1a6
treeffcd0513fe196cdeb74e625029a7e5aa9b8031ba
parent17432a1051af457d1ef48310d64c2b45b5a1b238
Add tensor table in ModelDef and use it for jit script serialization and deserialization (#13861)

Summary:
As we discussed, the tensors in the torch script will be associated with the tensor data in the serialized file. So let's add a table of tensor (actually it's a repeated TensorProto filed) in the ModelDef. TensorProto.name will be the id.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/13861

Reviewed By: dzhulgakov

Differential Revision: D13036940

Pulled By: zrphercule

fbshipit-source-id: ecb91b062ac4bc26af2a8d6d12c91d5614efd559
caffe2/proto/torch.proto
torch/csrc/jit/export.cpp
torch/csrc/jit/import.cpp