---
title: GetShape
description: "| 产品 | 是否支持 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendgraphapi/atlasgeapi_07_0620.html
sourcePath: /source/zh/canncommercial/900/API/ascendgraphapi/atlasgeapi_07_0620.html
indexId: abb814586a7a5e5901e794e7b65b63955eb1f5c7f3cf30d6beb3621f5c3fb91872
---
# GetShape

#### 产品支持情况

| 产品 | 是否支持 |
| --- | --- |
| Atlas 350 加速卡 | √ |
| Atlas A3 训练系列产品 / Atlas A3 推理系列产品 | √ |
| Atlas A2 训练系列产品 / Atlas A2 推理系列产品 | √ |
| Atlas 200I/500 A2 推理产品 | √ |
| Atlas 推理系列产品 | √ |
| Atlas 训练系列产品 | √ |


#### 头文件/库文件

- 头文件：#include <graph/inference_context.h>
- 库文件：libgraph.so


#### 函数功能

获取ShapeAndType类的Shape。


#### 函数原型

```
const Shape &GetShape() const
```


#### 参数说明

无。


#### 返回值

ShapeAndType对象中的Shape(https://www.hiascend.comdocument/detail/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00421.html)。


#### 异常处理

无。


#### 约束说明

无。
