megengine.core.tensor.dtype.convert_to_qint4

convert_to_qint4(arr, q)[源代码]

Quantize a float NumPy ndarray into a qint4 one with specified params.

参数
  • arr (ndarray) – Input ndarray.

  • q (dtype) – Target data type, should be a qint4.