OP_LOGE_FOR_INVALID_SHAPEDIM_WITH_REASON【免费下载链接】opbase本项目是CANN算子库的基础框架库为算子提供公共依赖文件和基础调度能力。项目地址: https://gitcode.com/cann/opbase功能说明记录并上报参数形状维度校验错误附带原因说明。当算子的指定参数形状维度不正确时输出ERROR级别日志含具体原因并上报EZ0012错误码。函数原型OP_LOGE_FOR_INVALID_SHAPEDIM_WITH_REASON(entityName, paramName, incorrectDim, reason)参数说明参数名输入/输出说明entityName输入算子名称或aclnn接口名称支持const char*或std::string类型。paramName输入参数名称支持const char*或std::string类型。incorrectDim输入实际维度如2D支持const char*或std::string类型。reason输入错误原因描述支持const char*或std::string类型。返回值说明无约束说明无调用示例关键代码示例如下仅供参考不支持直接拷贝运行。// 预期输出: Parameter query of ApplyRotaryPosEmb has incorrect shape dim 3D. // Reason: The shape dims of input query must be 4 when the attr layout is 1 (BSND). if (queryDimNum ! 4 layout_ 1) { std::string dimStr std::to_string(queryDimNum) D; OP_LOGE_FOR_INVALID_SHAPEDIM_WITH_REASON(ApplyRotaryPosEmb, query, dimStr.c_str(), The shape dims of input query must be 4 when the attr layout is 1 (BSND).); return ge::GRAPH_FAILED; }【免费下载链接】opbase本项目是CANN算子库的基础框架库为算子提供公共依赖文件和基础调度能力。项目地址: https://gitcode.com/cann/opbase创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考