---
title: TensorShape
description: TensorShape构造函数，创建TensorShape()对象。
url: "https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application%20Development%20Guide/msadg/mxvisionug_0475.html"
---

# TensorShape

#### 函数功能

TensorShape构造函数，创建TensorShape()对象。


#### 函数原型

```
TensorShape() = default;
```

```
TensorShape (std::vector<T> shape);
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| shape | 输入 | Tensor的形状。 shape向量中各维度要求为正整数且单个或各项乘积需要小于52,428,8000（500MB），否则函数将抛出异常。‬ |
