Run

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

Header File/Library File

  • Header file: #include <ge/fusion/pass/pattern_fusion_pass.h>
  • Library file: libge_compiler.so

Function Usage

Main pass function.

The function obtains the pattern graph constructed by PatternGraphs and uses it to build a pattern.

It then performs one-by-one matching on the target graph and invokes the Requires function to determine whether each match is eligible for replacement. If a match meets the replacement criteria (the value true is returned), the function further proceeds with the replacement.

It calls Replacement to obtain the target structure and replaces the matched subgraph in the matching results with the target subgraph.

Note: The Run function can be used to process only the current graph. If a subgraph needs to be processed, the pass caller is responsible for processing the subgraph.

Prototype

1
Status Run(GraphPtr &graph, CustomPassContext &pass_context) override

Parameters

Parameter

Input/Output

Description

graph

Input

Target graph.

pass_context

Input

Context, which can be used to transfer information such as error messages.

Returns

Parameter

Type

Description

-

Status

SUCCESS: Execution succeeded.

FAILED: Execution failed.

Constraints

None