INFER_SHAPE_AND_TYPE
Function Prototype
INFER_SHAPE_AND_TYPE (x)
Function Description
Registers the Shape and DataType inference function.
Parameter Description
Parameter |
Input/Output |
Type |
Description |
---|---|---|---|
x |
Input |
- |
Macro parameter, Shape and DataType inference function For example, INFER_SHAPE_AND_TYPE(FullConnectionInfer) is used to register the FullConnectionInfer function for inferring operator Shape and DataType. FullConnectionInfer is declared in DECLARE_INFERFUNC and defined in IMPLEMT_INFERFUNC. For details, see Description of Macros DECLARE_INFERFUNC and IMPLEMT_INFERFUNC. |
Return Value
None
Exception Handling
None
Restriction
None
Description of Macros DECLARE_INFERFUNC and IMPLEMT_INFERFUNC
Before registering the function for Shape and DataType inference, you need to declare the function in the DECLARE_INFERFUNC macro and define the function in the IMPLEMT_INFERFUNC macro.
- Declaring the function
DECLARE_INFERFUNC(FullConnection, FullConnectionInfer)
The expanded implementation of the DECLARE_INFERFUNC macro is as follows:
namespace op { class FullConnection; } static graphStatus FullConnectionInfer(op::FullConnection& op);
- Defining the function
IMPLEMT_INFERFUNC(FullConnection, FullConnectionInfer) { // Implementation details }
The expanded implementation of the IMPLEMT_INFERFUNC macro is as follows:
static graphStatus FullConnectionInfer(op::FullConnection& op){ // Implementation details }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot