OpParamInfoKey
TBE提供了OpParamInfoKey结构体用于存储算子输入输出信息的关键字段。
定义如下所示:
class OpParamInfoKey:
    SHAPE = "shape"
    FORMAT = "format"
    ORI_SHAPE = "ori_shape"
    ORI_FORMAT = "ori_format"
    D_TYPE = "dtype"
    RANGE = "range"
每个参数的详细说明及使用方法如下表所示。
字段  | 
说明  | 
使用示例  | 
|---|---|---|
OpParamInfoKey. SHAPE  | 
用于从算子输入或者输出参数中获取shape信息。  | 
from tbe.common.utils.para_check import OpParamInfoKey shape = x.get(OpParamInfoKey. SHAPE)  | 
OpParamInfoKey. ORI_SHAPE  | 
用于从算子输入或者输出参数中获取原始shape信息。 该shape指原始网络模型中的shape信息。  | 
from tbe.common.utils.para_check import OpParamInfoKey shape = x.get(OpParamInfoKey. ORI_SHAPE)  | 
OpParamInfoKey. FORMAT  | 
用于从算子输入或者输出参数中获取format信息。  | 
from tbe.common.utils.para_check import OpParamInfoKey shape = x.get(OpParamInfoKey. FORMAT)  | 
OpParamInfoKey. ORI_FORMAT  | 
用于从算子输入或者输出的参数中获取原始format信息。 该format指原始网络模型中的format信息。  | 
from tbe.common.utils.para_check import OpParamInfoKey shape = x.get(OpParamInfoKey. ORI_FORMAT)  | 
OpParamInfoKey. D_TYPE  | 
用于从算子输入或者输出参数中获取数据类型的信息。  | 
from tbe.common.utils.para_check import OpParamInfoKey dtype = x.get(OpParamInfoKey. D_TYPE)  | 
OpParamInfoKey. range  | 
此字段为预留字段。  | 
-  |