From 09508921a2bcc90e0fe8f8565a02f9b731170671 Mon Sep 17 00:00:00 2001 From: Zafar Date: Thu, 7 Jan 2021 14:55:26 -0800 Subject: [PATCH] [quant] Backend string for the quantized types (#49965) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/49965 Without this checking the type of the quantized tensor using `type` would throw an error. After this PR running the `type(qx)`, where `qx` is a quantized tensor would show something like `torch.quantized.QUInt8`. Test Plan: Not needed -- this is just a string description for the quantized tensors Differential Revision: D25731594 Reviewed By: ezyang Pulled By: z-a-f fbshipit-source-id: 942fdf89a1c50895249989c7203f2e7cc00df4c6 --- torch/csrc/utils/tensor_types.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/torch/csrc/utils/tensor_types.cpp b/torch/csrc/utils/tensor_types.cpp index e6b851a3a74c..5d60f8b07c64 100644 --- a/torch/csrc/utils/tensor_types.cpp +++ b/torch/csrc/utils/tensor_types.cpp @@ -21,6 +21,7 @@ static const char* backend_to_string(const at::Backend& backend) { case at::Backend::CUDA: return "torch.cuda"; case at::Backend::SparseCPU: return "torch.sparse"; case at::Backend::SparseCUDA: return "torch.cuda.sparse"; + case at::Backend::QuantizedCPU: return "torch.quantized"; default: AT_ERROR("Unimplemented backend ", backend); } }