---
title: 简介
description: "CtInferShapeContext继承自InferShapeContext，用于编译期Shape推导，提供编译期使用的接口。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0351.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0351.html
indexId: 95c2be85dce570efaf79bab3f388b8c228329a3ee8f1f6b2db1d6a50f45b3c1f72
---
# 简介

CtInferShapeContext继承自InferShapeContext，用于编译期Shape推导，提供编译期使用的接口。

该类主要用于资源类算子，资源类算子分为创建资源的算子和使用资源的算子两类，这两类算子通过传递DT_RESOURCE句柄来关联资源。句柄信息通过CtInferShapeContext提供的接口在编译期获取。

CtInferShapeContext继承关系图如下：


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

```
#include <ct_infer_shape_context.h>
```
