Support torch.tensor in script (#14913)
authorElias Ellison <eellison@fb.com>
Fri, 14 Dec 2018 01:36:21 +0000 (17:36 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 14 Dec 2018 01:38:38 +0000 (17:38 -0800)
commitaecab53778024d7686661bf60b3726c7a82f4a04
treefcc31ec6e37435d4986b6e45c712d18f776a9555
parentbbbfda72a0824f7de99de3271d93d753515647e1
Support torch.tensor in script (#14913)

Summary:
Adding support for torch.tensor in script.

The input list is typed as t[], because it can be arbitrarily nested. I added a check a compile time check  that the inner type of the list is a bool, float, or int.

Also adds specialization for Boolean Lists, which already existed at the ivalue level but had not been added to the compiler yet
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14913

Differential Revision: D13407930

Pulled By: eellison

fbshipit-source-id: d17f1195a22149d5b0d08d76c89a7fab8444f7c5
aten/src/ATen/core/ivalue.h
test/test_jit.py
torch/csrc/jit/constants.cpp
torch/csrc/jit/pybind_utils.h
torch/csrc/jit/register_prim_ops.cpp
torch/csrc/jit/register_special_ops.cpp
torch/csrc/jit/script/compiler.cpp