GetDynamicInputShape
Description
Obtains the pointer to a dynamic input shape based on the input index in the operator prototype definition.
Prototype
const StorageShape *GetDynamicInputShape(const size_t ir_index, const size_t relative_index) const
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
ir_index |
Input |
Index of the dynamic input in the operator IR prototype definition, starting from 0. |
relative_index |
Input |
Relative index after the input is instantiated. For example, if three inputs are instantiated for a DYNAMIC_INPUT, the value range of relative_index is [0, 2]. |
Returns
Pointer to the specified input shape. The input shape contains the original shape and storage shape information. For details about the definition of the StorageShape type, see StorageShape.
If the input ir_index or relative_index is invalid, a null pointer is returned.
Restrictions
None
Example
ge::graphStatus InferShape4ConcatD(TilingContext* context) {
auto in_shape = context->GetDynamicInputShape(dynamic_input_idx, 0);
...
}