InferShapeRange

Function Usage

Registers the InferShapeRange function of an operator.

You need to write a function of the InferShapeRangeKernelFunc type for the operator and use this API to register the function.

The InferShapeRangeKernelFunc type is defined as follows:

1
using InferShapeRangeKernelFunc = UINT32 (*)(InferShapeRangeContext *);

The InferShapeRange function prototype is definite. It accepts an input of the InferShapeRangeContext type. In this context, you can obtain the input and output shape pointers (input, output, and attribute information in the operator prototype definition). If InferShapeRange is successful, ge::GRAPH_SUCCESS is returned. Any other return value indicates an inference failure. If the inference fails, the execution process ends and exits.

Prototype

1
OpImplRegisterV2 &InferShapeRange(InferShapeRangeKernelFunc infer_shape_range_func)

Parameters

Parameter

Input/Output

Description

infer_shape_range_func

Input

User-defined infer_shape_range_func function to be registered, which is of the InferShapeRangeKernelFunc type.

Returns

OpImplRegisterV2 object of the operator, where the InferShapeRange function infer_shape_range_func is registered.

Constraints

None