Skip to content

Commit

Permalink
[quant] Backend string for the quantized types (pytorch#49965)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#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
  • Loading branch information
z-a-f authored and hwangdeyu committed Jan 14, 2021
1 parent 1384a13 commit 0950892
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions torch/csrc/utils/tensor_types.cpp
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 0950892

Please sign in to comment.