INFER_FORMAT_FUNC_REG

Applicability

Product

Supported or Not

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Header File

#include <graph/operator_reg.h>

Function Usage

Registers the InferFormat implementation of an operator.

The GE issues a graph InferFormat call before and after shape and dtype inference, respectively. Between the two calls, the operator InferFormat function is called for each operator. If an operator has no corresponding registered InferFormat function, the GE uses the default inference function, which means that the output format is set to the input format.

Prototype

1
2
#define INFER_FORMAT_FUNC_REG(op_name, x) \
__INFER_FORMAT_FUNC_REG_IMPL__(op_name, INFER_FORMAT_FUNC(op_name, x), __COUNTER__)

Parameters

Parameter

Input/Output

Description

op_name

Input

Operator type.

x

Input

InferFormat function name (func_name) passed to IMPLEMT_INFERFORMAT_FUNC.

Returns

None

Constraints

None

Call Examples and Related APIs

1
INFER_FORMAT_FUNC_REG(Transpose, TransposeInferFormat);