Skip to content

Commit 920e895

Browse files
committed
up
1 parent e68c9fa commit 920e895

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

torchao/quantization/quantize_/workflows/intx/intx_unpacked_tensor.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,19 @@ class IntxUnpackedTensor(TorchAOBaseTensor):
4040
This format is inteded for torch.export use cases.
4141
4242
Tensor Attributes:
43-
_data: int data for
44-
scale: (K/group_size, N) for 2D Tensor, (B, N, K/group_size) for 3D Tensor, where B is batch size,
45-
dtype is the same as the original Tensor dtype
46-
zero_point: (K/group_size, N) for 2D Tensor, (B, N, K/group_size) for 3D Tensor, where B is batch size,
47-
dtype is the same as the original Tensor dtype
43+
int_data: int data for quantization.
44+
dtype is int8
45+
Shape is the same as original Tensor: (n, k) for 2D tensor
46+
scale: block scales for quantization
47+
dtype is the same as the original Tensor dtype.
48+
Shape is (n // block_size[0], k // block_size[1]) for 2D tensor
49+
zero_point: block zero points for quantization
50+
dtype is the same as the original Tensor dtype or int8
51+
Shape is (n // block_size[0], k // block_size[1]) for 2D tensor
4852
4953
Non-Tensor Attributes:
54+
bit_width: the bit width for quantization (can be 1 - 8)
5055
block_size: the block size for quantization, representing the granularity, for example groupwise quantization will have block_size (1, group_size)
51-
shape: the shape of the original Tensor
5256
"""
5357

5458
tensor_data_attrs = ["int_data", "scale", "zero_point"]

0 commit comments

Comments
 (0)