Updated on 2022-03-13 GMT+08:00

InferShapeAndTypeFn

Function

Shape inference function

Syntax

OpRegistrationData& InferShapeAndTypeFn(InferShapeFunc inferShapeFn);

Parameter Description

Parameter

Input/Output

Description

inferShapeFn

Input

Callback function InferShapeFunc. For details, see Callback Function InferShapeFunc.

Callback Function InferShapeFunc

You can customize and implement the InferShapeFunc class function to obtain the output description of an operator, including the tensor description such as the output shape information and data type.

Syntax

Status InferShapeFunc(const ge::Operator& op, vector<ge::TensorDesc>& v_output_desc);

Parameter Description

Parameter

Input/Output

Description

op

Input

Operator data structure of offline model supported by the Ascend AI processor

For details about the operator class, see Operator Class APIs in GE API Reference.

v_output_desc

Output

Operator output description

For details about the TensorDesc class, see TensorDesc Class APIs in GE API Reference.