megengine.core

"""
Users should never --
    import megengine.core
But MegEngine developers should know what is inside.
"""

警告

我们不承诺 core 模块中 API 的兼容性和稳定性。

tesnor

array_method.ArrayMethodMixin

dtype

dtype.QuantDtypeMeta

Store metadata for quantize dtype.

dtype.get_dtype_bit

dtype.is_lowbit

dtype.is_bfloat16

dtype.create_quantized_dtype

Get quantized dtype with metadata attribute according to _metadata_dict.

dtype.quint8

Consturct a quantized unsigned int8 data type with scale (float) and zero_point (uint8).

dtype.qint8

Construct a quantized int8 data type with scale (float).

dtype.qint32

Construct a quantized int32 data type with scale (float).

dtype.quint4

Consturct a quantized unsigned int4 data type with scale (float) and zero_point (uint8).

dtype.qint4

Construct a quantized int4 data type with scale (float).

dtype.convert_to_quint8

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

dtype.convert_to_qint8

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

dtype.convert_from_qint8

Dequantize a qint8 NumPy ndarray into a float one.

dtype.convert_to_qint32

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

dtype.convert_from_qint32

Dequantize a qint32 NumPy ndarray into a float one.

dtype.convert_to_quint4

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

dtype.convert_from_quint4

Dequantize a quint4 NumPy ndarray into a float one.

dtype.convert_to_qint4

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

dtype.convert_from_qint4

Dequantize a qint4 NumPy ndarray into a float one.

dtype.convert_from_quint8

Dequantize a quint8 NumPy ndarray into a float one.

autodiff

grad.GradKey

grad.Grad

grad.Function

定义一段具有自定义求导规则的计算

grad.get_grad_managers