torch_npu.npu_quantize

功能描述

接口原型

npu_quantize(Tensor input, Tensor scales, Tensor? zero_points, ScalarType dtype, int axis=1, bool div_mode=True) -> Tensor

参数说明

输出说明

y:Device侧的aclTensor,公式中的输出,输出大小与input一致。如果参数dtype为torch.quint4x2,输出的dtype是torch.int32,shape的最后一维是输入shape最后一维的1/8,shape其他维度和输入一致。

约束说明

支持的型号

调用示例