IMPLEMT_INFERFUNC

Description

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 input x and returns an object of the TensorDesc type.

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

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

Prototype

IMPLEMT_INFERFUNC(op_name, func_name)

Restrictions

None

Parameters

Parameter

Input/Output

Description

op_name

Input

Operator type.

func_name

Input

User-defined name of the InferShape function.

Returns

None