Use .to to convert new tensors in new_tensor (#14097)
authorThomas Viehmann <tv.code@beamnet.de>
Tue, 4 Dec 2018 21:58:31 +0000 (13:58 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 4 Dec 2018 22:03:56 +0000 (14:03 -0800)
commit2d56df7892ff6588da3fd079ee95d679644d6730
tree270d7eff91e62c1328115ed33d00aa2bbc74529c
parentc7c5eed686fa683421ea1113a00e7079fcbfb661
Use .to to convert new tensors in new_tensor (#14097)

Summary:
This would solve the tracing problems of #13969.
Fixes: #14732

I would appreciate if this got good scrutiny before applied.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14097

Differential Revision: D13323181

Pulled By: ezyang

fbshipit-source-id: dcd104b497c0bfddb751923c6166a3824b7a3702
test/expect/TestJit.test_export_tensoroption_to.expect
test/expect/TestScript.test_index_put_trace_with_view.expect
test/expect/TestScript.test_index_put_trace_without_view.expect
tools/autograd/templates/python_variable_methods.cpp
torch/CMakeLists.txt
torch/csrc/autograd/python_variable_indexing.cpp
torch/csrc/utils/tensor_conversion_dispatch.cpp [deleted file]
torch/csrc/utils/tensor_conversion_dispatch.h [deleted file]
torch/csrc/utils/tensor_new.cpp