get_pass_name

Applicable Products

All processors

Function Usage

Returns the name of the current pass.

Prototype

1
get_pass_name() -> str

Parameters

None

Returns

Name of the current pass, which is a string

Restrictions

It can be used only in the current run call stack (or the synchronous callback defined by other engines). Do not save it to self for other threads to use.

Example

1
2
3
4
5
6
7
8
from ge.passes import FusionBasePass, PassContext


class MyPass(FusionBasePass):
    def run(self, graph, context: PassContext):
        # Obtain the name of the current pass in run().
        name = context.get_pass_name()
        return True

For more usage details, see Example of a Fusion Pass.