megengine.core.tensor.dtype.QuantDtypeMeta

class QuantDtypeMeta(name, cname, np_dtype_str, qmin, qmax, is_unsigned=None)[源代码]

Store metadata for quantize dtype. Could be used to create custom quant dtype for QAT when the network don’t need to be converted for inference, but only to export network metadata for third-party platform inference.

参数
  • name – a unique name string.

  • cname – used in create_quantized_dtype for model dump and inference.

  • np_dtype_str – used in create_quantized_dtype to generate np.dtype.

  • qmin – a int number indicating quant dtype’s lowerbound.

  • qmax – a int number indicating quant dtype’s upperbound.

  • is_unsigned – a helper value that could be inference from np_dtype_str.

属性

cname

Alias for field number 1

is_unsigned

Alias for field number 5

name

Alias for field number 0

np_dtype_str

Alias for field number 2

qmax

Alias for field number 4

qmin

Alias for field number 3

方法

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.