OP_OUTSHAPE

Function Usage

Stores the aclTensor of the output shape of an operator, for example, the NonZero operator.

Prototype

OP_OUTSHAPE(x...)

Parameters

Parameter

Input/Output

Description

x...

Input

The parameter consists of two parts. The first parameter is the aclTensor tensor that stores the output tensor shape, and the second parameter is the index of the tensor whose output shape needs to be updated.

Constraints

Only one output tensor shape (outShapeTensor) can be updated with a shape of (9, ). The shape of each output tensor occupies 9 bits. The first bit indicates the number of dimensions, and the remaining 8 bits indicate the value of each dimension.

Examples

1
2
// The operator stores the shape of the output tensor in outShapeTensor to update the shape of the output tensor whose idx is 0.
OP_OUTSHAPE({outShapeTensor, 0});