register_fusion_pass

Applicable Products

All processors

Function Usage

Registers the class decorator of fusion passes. It is used to register the FusionBasePass or PatternFusionPass subclass with the GE compilation process.

Prototype

1
register_fusion_pass(*, name: str, stage: PassStage, kind: Optional[str] = None) -> callable

Parameters

Parameter

Input/Output

Description

name

Input

Pass name, which is of the string type and must be unique. It cannot be the same as any registered pass name.

stage

Input

Pass execution stage, which is of the PassStage enum type.

kind

Input

(Optional) Pass type identifier. If this parameter is not specified, it is automatically set to "pattern_fusion" when the decorated class is the PatternFusionPass subclass; otherwise, it is set to "fusion_base".

Returns

The class decorator function. The decorated class is registered in the pass registry and attached with the __ge_pass_descriptor__ attribute.

Restrictions

None