Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion transformer_engine/pytorch/tensor/quantized_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ def __torch_dispatch__(cls, func, types, args, kwargs=None):
dst.quantize_(src)
else:
if isinstance(src, QuantizedTensor):
src = src.dequantize()
dtype = dst.dtype
if dtype not in (torch.float32, torch.float16, torch.bfloat16):
dtype = torch.float32
src = src.dequantize(dtype=dtype)
dst.copy_(src)
return None

Expand Down
Loading