uintx_weight_only¶ torchao.quantization.uintx_weight_only(dtype, group_size=64, pack_dim=- 1, use_hqq=False)[源代码]¶ 对线性层应用 uintx 权重专用非对称逐组量化,其中 x 是由 dtype 指定的位数的 uintx 量化 参数: dtype – torch.uint1 到 torch.uint7 子字节数据类型 group_size – 量化参数,控制量化的粒度,较小的尺寸更精细,默认为 64 pack_dim – 我们用于打包的维度,默认为 -1 use_hqq – 是否使用 hqq 算法或默认算法来量化权重