GetOutputShape

Function Usage

Obtains the actual storage shape of the operator output tensor.

Prototype

1
const gert::StorageShape* GetOutputShape(int64_t index) const

Parameters

Parameter

Input/Output

Description

index

Input

Index of the operator output.

The output index refers to the actual index after operator instantiation, not the index in the prototype definition.

Returns

StorageShape is returned, indicating the storage shape of the output shape.

Constraints

Do not modify the returned StorageShape or attempt to release it.

Examples

1
2
3
4
5
gert::StorageShape* GetOutputShape(ExeResGenerationContext* context) {
  int64_t index = 9;
  gert::StorageShape* shape = context->GetOutputShape(index);
  ...
}