dmx.compressor.fx.tracer.ScopeContextManager

class dmx.compressor.fx.tracer.ScopeContextManager(scope: Scope, current_module: Module, current_module_path: str)

A context manager to track the Scope of Node during symbolic tracing. When entering a forward function of a Module, we’ll update the scope information of the current module, and when we exit, we’ll restore the previous scope information.

Parameters:
  • scope (Scope) – Scope object to store the module details

  • current_module (torch.nn.Module) – Current module object

  • current_module_path (str) – String path to current module

prev_module_type

Type of the previous module

Type:

Any

prev_module_path

String path to previous module

Type:

str

scope

Scope object to store the module details

Type:

Scope

__init__(scope: Scope, current_module: Module, current_module_path: str)

Methods

__init__(scope, current_module, ...)