GetDynamicOutputFormat

Function Usage

Obtains the pointer to a dynamic output format based on the output index in the operator prototype definition.

Prototype

1
StorageFormat *GetDynamicOutputFormat(const size_t ir_index, const size_t relative_index)

Parameters

Parameter

Input/Output

Description

ir_index

Input

Index in the IR prototype definition, starting from 0.

relative_index

Input

Relative index after the operator output is instantiated. For example, if three outputs are instantiated for a dynamic output, the value range of relative_index is [0, 2].

Returns

Output format pointer. If the ir_index or relative_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->GetDynamicOutputFormat(0U, 0U);
  // ...
}