OpParamInfoKey

TBE provides the OpParamInfoKey struct to store the key fields of operator inputs or outputs.

The definition is as follows.

class OpParamInfoKey:
    SHAPE = "shape"
    FORMAT = "format"
    ORI_SHAPE = "ori_shape"
    ORI_FORMAT = "ori_format"
    D_TYPE = "dtype"
    RANGE = "range"

The following table describes the members and their usage.

Table 1 Member description and usage examples of the OpParamInfoKey struct

Field

Description

Example

OpParamInfoKey. SHAPE

Obtains the input or output shape of an operator.

from tbe.common.utils.para_check import OpParamInfoKey

shape = x.get(OpParamInfoKey. SHAPE)

OpParamInfoKey. ORI_SHAPE

Obtains the input or output shape of an operator.

The shape refers to that in the original network.

from tbe.common.utils.para_check import OpParamInfoKey

shape = x.get(OpParamInfoKey. ORI_SHAPE)

OpParamInfoKey. FORMAT

Obtains the input or output format of an operator.

from tbe.common.utils.para_check import OpParamInfoKey

shape = x.get(OpParamInfoKey. FORMAT)

OpParamInfoKey. ORI_FORMAT

Obtains the input or output format of an operator.

The format refers to that in the original network.

from tbe.common.utils.para_check import OpParamInfoKey

shape = x.get(OpParamInfoKey. ORI_FORMAT)

OpParamInfoKey. D_TYPE

Obtains the input or output dtype of an operator.

from tbe.common.utils.para_check import OpParamInfoKey

dtype = x.get(OpParamInfoKey. D_TYPE)

OpParamInfoKey. range

Reserved.

-