InferDataType
Applicable Products
All processors
Header File/Library File
- Header file: #include <graph/custom_op.h>
- Library file: libgraph.so
Function Usage
Data type inference function. It obtains the input tensor data type information through the data type inference context, infers and sets the output tensor data type, and is used for type inference in the graph build phase.
Prototype
1 | virtual graphStatus InferDataType(gert::InferDataTypeContext *ctx) = 0 |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
ctx |
Input |
Data type inference context. You can obtain the input tensor data type and set the output tensor data type based on the context. |
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
graphStatus |
GRAPH_SUCCESS(0): success. Other values: failure. |
Restrictions
None
Parent topic: ShapeInferOp