megengine.core.tensor.dtype.create_quantized_dtype¶
- create_quantized_dtype(dtype_meta, scale, zp)[源代码]¶
Get quantized dtype with metadata attribute according to _metadata_dict.
Note that unsigned dtype must have
zero_point
and signed dtype must not havezero_point
, to be consitent with tensor generated by calling compiled function from CompGraph.compile(inputs, outspec).- 参数
dtype_meta (
QuantDtypeMeta
) – a QuantDtypeMeta indicating which dtype to return. thecname
attribute cannot beNone
.scale (
float
) – a number for scale to store in dtype’s metadatazp (
Optional
[int
]) – a number for zero_point to store in dtype’s metadata