Add Slot type to abstract the raw pointers being used for slots. (#18226)
authorZachary DeVito <zdevito@fb.com>
Thu, 28 Mar 2019 17:31:45 +0000 (10:31 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 28 Mar 2019 17:35:36 +0000 (10:35 -0700)
commitaa20591baa382b566b5da8aec31c64f9f66eb4c2
tree6b1c7a071c4b94f6e481ca8194243c453cf96f44
parent77280b11e35c747c9ffc01c97509761aefcae37b
Add Slot type to abstract the raw pointers being used for slots. (#18226)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18226
ghimport-source-id: b9ec8651212875b30971cc6859d2ddec6559ae3a

If modules become first-class IValues, then the slots will no longer be raw pointers but (IValue, index) pairs. This commit inserts the Slot abstraction so that this change can be made in later patches.

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18226 Add Slot type to abstract the raw pointers being used for slots.**

Differential Revision: D14542022

fbshipit-source-id: b81d7f4334c983d663e7551bda82df43680d7c5f
torch/csrc/jit/export.cpp
torch/csrc/jit/import_source.cpp
torch/csrc/jit/passes/python_print.cpp
torch/csrc/jit/script/init.cpp
torch/csrc/jit/script/module.h
torch/csrc/jit/script/slot.h [new file with mode: 0644]