Obtains the pointer to an optional input shape range based on the input index in the operator prototype definition.
| Parameter | Input/Output | Description |
|---|---|---|
| ir_index | Input | Input index in the operator IR prototype definition, starting from 0. |
Pointer to the shape range. If ir_index is invalid or the input is not instantiated, a null pointer is returned.
const auto infer_shape_range_func = [](gert::InferShapeRangeContext *context) -> graphStatus {
auto input_shape_range = context->GetOptionalInputShapeRange(0U);
auto output_shape_range = context->GetOutputShapeRange(0U);
output_shape_range->SetMin(const_cast<gert::Shape *>(input_shape_range->GetMin()));
output_shape_range->SetMax(const_cast<gert::Shape *>(input_shape_range->GetMax()));
return GRAPH_SUCCESS;
};