---
title: OP_OUTSHAPE
description: "针对需要计算结果来确定输出shape的算子，如NonZero算子，该宏用于存放此类算子输出shape的aclTensor。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1060.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1060.html
indexId: a5b1132da26962f5d14b1d5419050a554d9c8611fb8c0bddd07125e74c793a5070
---
# OP_OUTSHAPE

#### 宏功能

针对需要计算结果来确定输出shape的算子，如NonZero算子，该宏用于存放此类算子输出shape的aclTensor。


#### 宏原型

```
OP_OUTSHAPE(x...)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| x... | 输入 | 包含两部分，第一个参数是存放输出tensor shape的张量（aclTensor），第二个参数是存放需要更新输出shape的tensor索引。 |


#### 约束说明

只支持刷新一个输出tensor shape的Tensor（outShapeTensor），其对应shape为(9, )。每个输出tensor的shape占9位，其中第一位表示维度数，剩下8位表示每个维度的具体值。


#### 调用示例

```
// 表示算子将输出tensor的shape存放到outShapeTensor中，并且用来更新idx=0的输出tensor的shape
OP_OUTSHAPE({outShapeTensor, 0});
```
