MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / int8_vectorwise_dequant

Function int8_vectorwise_dequant

bitsandbytes/functional.py:1641–1652  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1639
1640
1641def 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
1655def int8_vectorwise_quant(A: torch.Tensor, threshold=0.0):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected