Introduce DeprecatedTypeProperties class (#17991)
authorRoy Li <royboy@fb.com>
Thu, 4 Apr 2019 09:21:09 +0000 (02:21 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 4 Apr 2019 09:24:13 +0000 (02:24 -0700)
commitc705d9eb1edd68ddb6e39160a1ac92d011ebcec4
treee924fefaa775019baa903355b79976f53c6d42a7
parent095f88e0934f5503cb3d01dbb7065d3c0be8e860
Introduce DeprecatedTypeProperties class (#17991)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17991

changes:
-Breaks bc: Tensor::type() now returns DeprecatedTypeProperties& rather than Type&.
-Added DeprecatedTypeProperties, it serves as a temporary replacement for Type as the return value of Tensor::type(). This contributes to making Type just for dispatch purposes so that we can make it dtype agnostic.
-Tensor::dispatch_type() now returns Type& like Tensor::type() used to do.
-Changed callsites of Tensor::type() appropriately.

Reviewed By: ezyang

Differential Revision: D14443117

fbshipit-source-id: 239ccb7a09626279a71d1a37f8f82e7f57bf7d9e
64 files changed:
aten/src/ATen/DLConvertor.cpp
aten/src/ATen/Dispatch.h
aten/src/ATen/SparseTensorImpl.cpp
aten/src/ATen/SparseTensorUtils.h
aten/src/ATen/core/DeprecatedTypeProperties.h [new file with mode: 0644]
aten/src/ATen/core/DeprecatedTypePropertiesRegistry.cpp [new file with mode: 0644]
aten/src/ATen/core/DeprecatedTypePropertiesRegistry.h [new file with mode: 0644]
aten/src/ATen/core/Formatting.cpp
aten/src/ATen/core/Formatting.h
aten/src/ATen/core/LegacyTypeDispatch.cpp
aten/src/ATen/core/Tensor.cpp
aten/src/ATen/core/Tensor.h
aten/src/ATen/core/TensorMethods.h
aten/src/ATen/function_wrapper.py
aten/src/ATen/native/BatchLinearAlgebra.cpp
aten/src/ATen/native/Indexing.cpp
aten/src/ATen/native/LegacyBridge.cpp
aten/src/ATen/native/LinearAlgebra.cpp
aten/src/ATen/native/LossCTC.cpp
aten/src/ATen/native/Memory.cpp
aten/src/ATen/native/NNPACK.cpp
aten/src/ATen/native/ReduceOps.cpp
aten/src/ATen/native/TensorConversions.cpp
aten/src/ATen/native/TensorFactories.cpp
aten/src/ATen/native/TensorIterator.h
aten/src/ATen/native/TensorIteratorReduce.cpp
aten/src/ATen/native/TypeProperties.cpp
aten/src/ATen/native/cuda/Distributions.cu
aten/src/ATen/native/cuda/LossCTC.cu
aten/src/ATen/native/cuda/MiscUtils.h
aten/src/ATen/templates/Tensor.h
aten/src/ATen/templates/TensorMethods.h
aten/src/ATen/test/cuda_tensor_interop_test.cpp
aten/src/ATen/test/scalar_test.cpp
aten/src/ATen/test/tensor_interop_test.cpp
aten/src/ATen/test/undefined_tensor_test.cpp
test/test_nn.py
tools/autograd/derivatives.yaml
tools/autograd/templates/Functions.cpp
tools/autograd/templates/Functions.h
tools/autograd/templates/python_torch_functions.cpp
tools/autograd/templates/python_variable_methods.cpp
torch/csrc/DynamicTypes.cpp
torch/csrc/DynamicTypes.h
torch/csrc/Generator.cpp
torch/csrc/autograd/VariableTypeManual.cpp
torch/csrc/autograd/engine.cpp
torch/csrc/autograd/function.h
torch/csrc/autograd/input_metadata.h
torch/csrc/autograd/python_function.cpp
torch/csrc/autograd/python_hook.cpp
torch/csrc/autograd/python_variable_indexing.cpp
torch/csrc/autograd/variable.cpp
torch/csrc/cuda/comm.cpp
torch/csrc/cuda/nccl.cpp
torch/csrc/jit/node_hashing.cpp
torch/csrc/tensor/python_tensor.cpp
torch/csrc/utils/tensor_apply.cpp
torch/csrc/utils/tensor_flatten.cpp
torch/csrc/utils/tensor_flatten.h
torch/csrc/utils/tensor_new.cpp
torch/csrc/utils/tensor_numpy.cpp
torch/lib/c10d/ProcessGroupGloo.cpp
torch/lib/c10d/Utils.hpp