CustomPassFn

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Header File/Library File

  • Header file: #include <register/register_custom_pass.h>
  • Library file: libregister.so

Function Usage

Registers the execution function of a custom pass.

For details about the API, see Modifying a Graph Using 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 the object itself.

Restrictions

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.