Add slicing and int_repr() to QTensor (#19296)
authorJerry Zhang <jerryzh@fb.com>
Wed, 17 Apr 2019 03:02:04 +0000 (20:02 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 17 Apr 2019 03:17:21 +0000 (20:17 -0700)
commit06c28d8a122e1d8cc0f4b4a45032c2588524fcc8
tree675ffb32167d0f98933d3e326f32bec2dec6bc09
parent33e7977154a6ca961ce927e15625763f9cc13f8c
Add slicing and int_repr() to QTensor (#19296)

Summary:
Stack:
&nbsp;&nbsp;&nbsp;&nbsp;:black_circle:&nbsp; **#19296 [pt1][quant] Add slicing and int_repr() to QTensor**&nbsp;&nbsp;[:yellow_heart:](https://our.intern.facebook.com/intern/diff/D14756833/)
&nbsp;&nbsp;&nbsp;&nbsp;:white_circle:&nbsp; #18960 [pt1][quant] Add empty_quantized&nbsp;&nbsp;[:yellow_heart:](https://our.intern.facebook.com/intern/diff/D14810261/)
&nbsp;&nbsp;&nbsp;&nbsp;:white_circle:&nbsp; #19312 Use the QTensor with QReLU&nbsp;&nbsp;[:yellow_heart:](https://our.intern.facebook.com/intern/diff/D14819460/)
&nbsp;&nbsp;&nbsp;&nbsp;:white_circle:&nbsp; #19319 [RFC] Quantized SumRelu&nbsp;&nbsp;[:yellow_heart:](https://our.intern.facebook.com/intern/diff/D14866442/)

Methods added to pytorch python frontend:
- int_repr() returns a CPUByte Tensor which copies the data of QTensor.
- Added as_strided for QTensorImpl which provides support for slicing a QTensor(see test_torch.py)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19296

Differential Revision: D14756833

Pulled By: jerryzh168

fbshipit-source-id: 6f4c92393330e725c4351d6ff5f5fe9ac7c768bf
14 files changed:
aten/src/ATen/CPUApplyUtils.h
aten/src/ATen/TensorUtils.cpp
aten/src/ATen/TensorUtils.h
aten/src/ATen/core/Tensor.h
aten/src/ATen/core/TensorMethods.h
aten/src/ATen/core/Type.h
aten/src/ATen/native/TensorShape.cpp
aten/src/ATen/native/native_functions.yaml
aten/src/ATen/native/quantized/QTensor.cpp
aten/src/ATen/quantized/Quantizer.cpp
aten/src/ATen/test/quantized_test.cpp
docs/source/tensors.rst
test/test_torch.py
torch/_tensor_docs.py