---
title: 简介
description: "OpCheckContext继承自ExtendedKernelContext，用于算子参数与形状校验的上下文类，OpCheckContext的核心作用是在算子注册或执行前，对输入输出张量的形状、数据类型、维度等进行合法性校验，确保算子能够安全、正确地运行。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00709.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00709.html
indexId: 3a56e6f3d9c796686e304866f305fef07f068727160f638a6bc57670ecdcfe5678
---
# 简介

OpCheckContext继承自ExtendedKernelContext，用于算子参数与形状校验的上下文类，OpCheckContext的核心作用是在算子注册或执行前，对输入输出张量的形状、数据类型、维度等进行合法性校验，确保算子能够安全、正确地运行。

OpCheckContext继承关系图如下：


#### 需要包含的头文件

```
#include "exe_graph/runtime/exe_res_generation_context.h"
```


#### Public成员函数

```
const StorageShape* GetInputShape(int64_t index) const
const StorageShape* GetOutputShape(int64_t index) const
```
