Operator InferFormat APIs
IMPLEMT_INFERFORMAT_FUNC
Function
Encapsulates the InferFormat function of the operator.
Prototype
IMPLEMT_INFERFORMAT_FUNC(op_name, func_name)
Restrictions
None
Parameter Description
Parameter |
Input/Output |
Description |
---|---|---|
op_name |
Input |
Operator type. |
func_name |
Input |
User-defined name of the inferFormat function name. |
Returns
None
INFER_FORMAT_FUNC_REG
Prototype
#define INFER_FORMAT_FUNC_REG(op_name, x) \
__INFER_FORMAT_FUNC_REG_IMPL__(op_name, INFER_FORMAT_FUNC(op_name, x), __COUNTER__)
Description
Registers the InferFormat function of an operator. The GE calls the InferFormat function of the entire graph twice respectively before and after the Shape and Dtype inference of the entire graph. During the process, the GE calls the InferFormat function of each operator. If the InferFormat function is not registered for the operator, the GE uses the default inference function. Namely, the output Format is the same as the input Format.
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
op_name |
Input |
Operator type. |
x |
Input |
Indicates the InferFormat function name in IMPLEMT_INFERFORMAT_FUNC. |
Returns
None
Restrictions and Limitations
None
Supported Chips
NA
Available for Customer?
Yes
Calling Examples and APIs
INFER_FORMAT_FUNC_REG(Transpose, TransposeInferFormat);
API for Implementing the Operator Prototype Definition