dmx.compressor.fx.transformer.input_output_transformer.InputOutputTransformer
- class dmx.compressor.fx.transformer.input_output_transformer.InputOutputTransformer(module: GraphModule, scopeDict: dict = None, cfg=None)
A transformer that transforms the module by adding additional ops, which includes: - casting - approximator - sparsifier
- Parameters:
module (fx.GraphModule) – module to be added with additional ops.
scopeDict (Optional[dict]) – Dictionary that maps node name to scope. Defaults to None.
cfg (Optional[str]) – config file for setting the added ops formats. Defaults to None.
- module
module to be added with additional ops.
- Type:
fx.GraphModule
- scopeDict
Dictionary that maps node name to scope.
- Type:
Optional[str]
- cfg
config file for setting the added ops formats.
- Type:
Optional[str]
- __init__(module: GraphModule, scopeDict: dict = None, cfg=None)
Note
Backwards-compatibility for this API is guaranteed.
Methods
__init__(module[, scopeDict, cfg])boxed_run(args_list)Run module via interpretation and return the result.
call_function(target, args, kwargs)Execute a
call_functionnode.call_method(target, args, kwargs)Execute a
call_methodnode.call_module(target, args, kwargs)fetch_args_kwargs_from_env(n)Fetch the concrete values of
argsandkwargsof nodenfrom the current execution environment.fetch_attr(target)Fetch an attribute from the
Modulehierarchy ofself.module.get_attr(target, args, kwargs)Execute a
get_attrnode.map_nodes_to_values(args, n)Recursively descend through
argsand look up the concrete value for eachNodein the current execution environment.output(target, args, kwargs)Execute an
outputnode.placeholder(target, args, kwargs)Execute a
placeholdernode.run(*args[, initial_env, enable_io_processing])Run module via interpretation and return the result.
run_node(n)Run a specific node
nand return the result.transform()Transform
self.moduleand return the transformedGraphModule.