python interop for script classes (#18148)
authorMichael Suo <suo@fb.com>
Fri, 22 Mar 2019 23:24:36 +0000 (16:24 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 22 Mar 2019 23:30:04 +0000 (16:30 -0700)
commit10751d5fb44f339ee96873cb8043d5393fd73f8f
tree8491c25ff0a3a3c721e97564b6d59e52bb148a46
parent3badea6eb3b835814990291368b03fe63cf29e00
python interop for script classes (#18148)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18148
ghimport-source-id: 40a9d745dc9aeba53d098743323fcbd50ca65137

Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18148 py interop**

Support for converting classes between the Python–TorchScript boundary. Like other TorchScript values, ScriptClasses are native Python values when used in Python and IValues when used in TorchScript.

Notably, there is a copy across this boundary, which will be surprising to users who will expect standard Python reference semantics. I have some ideas for fixing that, but it's a more involved process.

Reviewed By: jamesr66a

Differential Revision: D14526259

fbshipit-source-id: 5916e3032488a42dc7da756c1826d7c040a21ebd
aten/src/ATen/core/jit_type.h
test/test_jit.py
torch/csrc/jit/pybind_utils.h
torch/csrc/jit/script/init.cpp
torch/csrc/jit/script/parser.cpp
torch/jit/__init__.py