InferShape4Elewise
Description
Infers an output tensor's shape. It is the InferShape for Elewise operators.
Prototype
ge::graphStatus InferShape4Elewise(gert::InferShapeContext *context)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
context |
Output |
inferShape context passed by GE. |
Return Value
Return type: ge::graphStatus.
- ge::GRAPH_SUCCESS: inferShape succeeded.
- ge::GRAPH_FAIL: inferShape failed.
Constraints
None.
Example
The following sample code is for reference only. Do not copy and run it.
1 2 3 4 5 6 7 8 | // Apply inferShape to the IsFinite operator. The procedure follows the same process as Elewise operators, allowing direct reuse. ge::graphStatus InferShape4IsFinite(gert::InferShapeContext* context) { return Ops::Base::InferShape4Elewise(context); } // Register the IsFinite operator and its shape inference function with GE. IMPL_OP_INFERSHAPE(IsFinite).InferShape(InferShape4IsFinite); } |
Parent topic: infershape