FormatMatchMode
函数功能
设置输入输出tensor的format匹配模式。
函数原型
OpDef &FormatMatchMode(FormatCheckOption option);
参数说明
参数 |
输入/输出 |
说明 |
---|---|---|
option |
输入 |
匹配模式配置参数,FormatCheckOption类型。支持以下几种取值:
|
返回值说明
OpDef算子定义,OpDef请参考OpDef。
约束说明
不调用该接口的情况下,默认将NCHW/NHWC/DHWCN/NCDHW/NCL格式的输入输出转成ND格式进行处理。
调用示例
AddCustomC(const char* name) : OpDef(name) { this->Input("x") .ParamType(REQUIRED) .DataType({ge::DT_FLOAT}) .FormatList({ge::FORMAT_NCHW}); this->Input("y") .ParamType(REQUIRED) .DataType({ge::DT_FLOAT}) .FormatList({ge::FORMAT_NHWC}); this->Output("z") .ParamType(REQUIRED) .DataType({ge::DT_FLOAT}) .FormatList({ge::FORMAT_ND}); this->AICore().SetTiling(optiling::TilingFunc); this->AICore().AddConfig("ascendxxx"); this->FormatMatchMode(FormatCheckOption::STRICT); }
父主题: OpDef