Dequantizes a tensor with dtype `torch.int8` to `torch.float32`. Args: A (`torch.Tensor` with dtype `torch.int8`): The quantized int8 tensor. stats (`torch.Tensor` with dtype `torch.float32`): The row-wise quantization statistics. Returns: `torch.Tensor` with dtype
(A: torch.Tensor, stats: torch.Tensor)
| 1639 | |
| 1640 | |
| 1641 | def int8_vectorwise_dequant(A: torch.Tensor, stats: torch.Tensor): |
| 1642 | """Dequantizes a tensor with dtype `torch.int8` to `torch.float32`. |
| 1643 | |
| 1644 | Args: |
| 1645 | A (`torch.Tensor` with dtype `torch.int8`): The quantized int8 tensor. |
| 1646 | stats (`torch.Tensor` with dtype `torch.float32`): The row-wise quantization statistics. |
| 1647 | |
| 1648 | Returns: |
| 1649 | `torch.Tensor` with dtype `torch.float32`: The dequantized tensor. |
| 1650 | """ |
| 1651 | # To dequantize we divide by 127, or multiply by the reciprocal. |
| 1652 | return torch.ops.bitsandbytes.int8_vectorwise_dequant.default(A, stats) |
| 1653 | |
| 1654 | |
| 1655 | def int8_vectorwise_quant(A: torch.Tensor, threshold=0.0): |
nothing calls this directly
no outgoing calls
no test coverage detected