GetOutputFormat

Function Usage

Obtains the pointer to an output format based on the operator output index. The output index refers to the actual index after operator instantiation, not the index in the prototype definition.

Prototype

1
StorageFormat *GetOutputFormat(const size_t index)

Parameters

Parameter

Input/Output

Description

index

Input

Operator output index, starting from 0.

Returns

Output format pointer. If the index is invalid, a null pointer is returned.

For details about the definition of the StorageFormat type, see StorageFormat.

Constraints

None

Examples

1
2
3
4
ge::graphStatus InferFormatForXXX(InferFormatContext *context) {
  auto format = context->GetOutputFormat(0U);        // Obtain the format of output 0.
  // ...
}