---
title: GetShape
description: "获取TensorDesc所描述Tensor的Shape。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/maintenref/basicdataapi/atlasopapi_07_00440.html
sourcePath: /source/zh/canncommercial/900/maintenref/basicdataapi/atlasopapi_07_00440.html
indexId: a2bc6bae6bb4787035688be7b41d8dcd1719177e255407c91ceab36ccacad6c378
---
# GetShape

#### 函数功能

获取TensorDesc所描述Tensor的Shape。


#### 函数原型

```
Shape GetShape() const
```


#### 参数说明

无。


#### 返回值

Shape类型，TensorDesc描述的Shape。


#### 异常处理

无。


#### 约束说明

由于返回的Shape信息为值拷贝，因此修改返回的Shape信息，不影响TensorDesc中已有的Shape信息。
