QTensor (#18230)
authorJerry Zhang <jerryzh@fb.com>
Wed, 3 Apr 2019 20:13:26 +0000 (13:13 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 Apr 2019 20:17:11 +0000 (13:17 -0700)
commitdfcd7b0185d479f186ddb100c761f4df3495f8e8
treec28bf875351cc98565b7b9c33e7f1e056d2a5f54
parent3af2d6d904bf1fc6d14ceb7cf8eb7bb60148b679
QTensor (#18230)

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

Implementing minimum qtensor API to unblock other workstreams in quantization

Changes:
- Added Quantizer which represents different quantization schemes
- Added qint8 as a data type for QTensor
- Added a new ScalarType QInt8
- Added QTensorImpl for QTensor
- Added following user facing APIs
  - quantize_linear(scale, zero_point)
  - dequantize()
  - q_scale()
  - q_zero_point()

Reviewed By: dzhulgakov

Differential Revision: D14524641

fbshipit-source-id: c1c0ae0978fb500d47cdb23fb15b747773429e6c
37 files changed:
aten/src/ATen/CMakeLists.txt
aten/src/ATen/DLConvertor.cpp
aten/src/ATen/core/Tensor.h
aten/src/ATen/core/TensorMethods.h
aten/src/ATen/core/Type.h
aten/src/ATen/function_wrapper.py
aten/src/ATen/gen.py
aten/src/ATen/native/TensorFactories.cpp
aten/src/ATen/native/native_functions.yaml
aten/src/ATen/native/quantized/QTensor.cpp [new file with mode: 0644]
aten/src/ATen/native_parse.py
aten/src/ATen/preprocess_declarations.py
aten/src/ATen/quantized/CMakeLists.txt [new file with mode: 0644]
aten/src/ATen/quantized/QTensorImpl.cpp [new file with mode: 0644]
aten/src/ATen/quantized/QTensorImpl.h [new file with mode: 0644]
aten/src/ATen/quantized/Quantizer.cpp [new file with mode: 0644]
aten/src/ATen/quantized/Quantizer.h [new file with mode: 0644]
aten/src/ATen/templates/TensorMethods.h
aten/src/ATen/templates/Type.h
aten/src/ATen/test/CMakeLists.txt
aten/src/ATen/test/quantized_test.cpp [new file with mode: 0644]
aten/src/TH/THBlasUtils.h
c10/core/QScheme.h [new file with mode: 0644]
c10/core/Scalar.h
c10/core/ScalarType.h
c10/util/Half.cpp
c10/util/qint8.h [new file with mode: 0644]
c10/util/typeid.cpp
c10/util/typeid.h
caffe2/contrib/aten/aten_op_template.h
caffe2/operators/experimental/c10/cpu/cast_cpu.cc
docs/source/tensors.rst
test/test_torch.py
tools/autograd/gen_python_functions.py
tools/autograd/templates/variable_factories.h
torch/_tensor_docs.py
torch/csrc/utils/tensor_dtypes.cpp