[fix] at::print for quantized Tensor (#35545)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35545
Looks like we have never printed a quantized Tensor in cpp before
(Note: this ignores all push blocking failures!)
Test Plan:
.
Imported from OSS
Differential Revision: D20699748
fbshipit-source-id: 9d029815c6e75f626afabf92194154efc83f5545
diff --git a/aten/src/ATen/core/Formatting.cpp b/aten/src/ATen/core/Formatting.cpp
index 6352c7b..9823dab 100644
--- a/aten/src/ATen/core/Formatting.cpp
+++ b/aten/src/ATen/core/Formatting.cpp
@@ -240,7 +240,7 @@
} else {
Tensor tensor;
if (tensor_.is_quantized()) {
- Tensor tensor = tensor_.dequantize().to(kCPU, kDouble).contiguous();
+ tensor = tensor_.dequantize().to(kCPU, kDouble).contiguous();
} else {
tensor = tensor_.to(kCPU, kDouble).contiguous();
}