CustomPassFn

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

Function Usage

Registers the execution function of a custom pass.

For details about the API, see "Modifying a Graph with a Custom Pass".

Prototype

1
PassRegistrationData &CustomPassFn(const CustomPassFunc &custom_pass_fn)

Parameters

Parameter

Input/Output

Description

custom_pass_fn

Input

Execution function of a custom pass.

Returns

Reference to its own object.

Constraints

None

Callback Function CustomPassFunc

You can customize and implement the CustomPassFunc class function.

1
Status CustomPassFunc(GraphPtr &graph, CustomPassContext &custom_context)
Table 1 Parameters

Parameter

Input/Output

Description

graph

Input

Graph to be modified.

custom_context

Input

Maintenance and test object, which is used to register maintenance and test information with the framework.

-

Output

  • SUCCESS: success.
  • Other values: failure.