GetInputFormat

Function Usage

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

Prototype

1
StorageFormat *GetInputFormat(const size_t index)

Parameters

Parameter

Input/Output

Description

index

Input

Operator input index, starting from 0.

Returns

Input 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
5
ge::graphStatus InferFormatForXXX(InferFormatContext *context) {
  const auto format = context->GetInputFormat(0);        // Obtain the format of input 0.
  GE_ASSERT_NOTNULL(format);
  // ...
}