GetInputShapeRange
Function Usage
Obtains the pointer to the input shape range 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 | const Range<Shape> *GetInputShapeRange(const size_t index) const |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
index |
Input |
Operator input index, starting from 0. |
Returns
Pointer to the input shape range. If the index is invalid, a null pointer is returned.
Constraints
None
Examples
1 2 3 4 5 6 7 | const auto infer_shape_range_func = [](gert::InferShapeRangeContext *context) -> graphStatus { auto input_shape_range = context->GetInputShapeRange(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; }; |
Parent topic: InferShapeRangeContext