OpCheckContext继承自ExtendedKernelContext,用于算子参数与形状校验的上下文类,OpCheckContext的核心作用是在算子注册或执行前,对输入输出张量的形状、数据类型、维度等进行合法性校验,确保算子能够安全、正确地运行。
OpCheckContext继承关系图如下:
1 | #include "exe_graph/runtime/exe_res_generation_context.h" |
const StorageShape* GetInputShape(int64_t index) const const StorageShape* GetOutputShape(int64_t index) const