IMPLEMT_INFERFUNC

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

Encapsulates the InferShape function of an operator.

The OpType argument passed to this function is a subclass derived from class Operator. An op object of this subclass is automatically generated. The member functions of this subclass can be used to obtain the input and output description methods to implement InferShape.

The member functions of the subclass op object derived from OpType are as follows:

  • op.set_input_x(Operator &v, const string &srcName): sets output srcName of operator v to input x of the current operator.
  • op.get_input_desc_x(): obtains the description of the input x of the operator and returns an object of the TensorDesc type.

    op.update_input_desc_x(const TensorDesc& tensorDesc): updates the description of the input x, including the shape, data type, and format.

  • op.get_output_desc_y(): obtains the description of the output y of the operator and returns an object of the TensorDesc type.
  • op.update_output_desc_y(const TensorDesc& tensorDesc): updates the description of the output y, including the shape, data type, and format.
  • op.get_attr_attr1(AscendString &val): obtains the value of the attribute attr1.

Prototype

1
IMPLEMT_INFERFUNC(op_name, func_name)

Parameters

Parameter

Input/Output

Description

op_name

Input

Operator type.

func_name

Input

User-defined name of the InferShape function.

Returns

None

Constraints

None