dmx.compressor.fx.transformer.export_transformer
Functions
|
Classes
|
- class dmx.compressor.fx.transformer.export_transformer.ExportSubstituteTransformer(gm: GraphModule, model: Module, scope: str = '', node_inputs: dict = None)
Bases:
Transformer- add_submod(name, mod)
this function will try to reuse modules in old_gm if possible
- call_function(target, args, kwargs)
Note
Backwards-compatibility for this API is guaranteed.
- call_method(target, args, kwargs)
Execute a
call_methodnode and return the result.- Parameters:
target (Target) – The call target for this node. See Node for details on semantics
args (Tuple) – Tuple of positional args for this invocation
kwargs (Dict) – Dict of keyword arguments for this invocation
- Return
Any: The value returned by the method invocation
Note
Backwards-compatibility for this API is guaranteed.
- call_module(target, args, kwargs)
Note
Backwards-compatibility for this API is guaranteed.
- get_attr(target, args, kwargs)
Execute a
get_attrnode. InTransformer, this is overridden to insert a newget_attrnode into the output graph.- Parameters:
target (Target) – The call target for this node. See Node for details on semantics
args (Tuple) – Tuple of positional args for this invocation
kwargs (Dict) – Dict of keyword arguments for this invocation
Note
Backwards-compatibility for this API is guaranteed.
- merge_graph(subgraph, name, args, kwargs)
This function is to merge subgraph to graph
- placeholder(target, args, kwargs)
Execute a
placeholdernode. InTransformer, this is overridden to insert a newplaceholderinto the output graph.- Parameters:
target (Target) – The call target for this node. See Node for details on semantics
args (Tuple) – Tuple of positional args for this invocation
kwargs (Dict) – Dict of keyword arguments for this invocation
Note
Backwards-compatibility for this API is guaranteed.
- dmx.compressor.fx.transformer.export_transformer.get_nested_attr(obj, attr_path)