dmx.compressor.fx.tracer.QuantTracer
- class dmx.compressor.fx.tracer.QuantTracer
Customed tracer with scope manager and returns a flat GraphModule
- node_name_to_scope
Dictionary that maps node name to scope
- Type:
Dict
- record_stack_traces
Not in use yet
- Type:
bool
- __init__() None
Construct a Tracer object.
- Parameters:
autowrap_modules (Tuple[ModuleType]) – defaults to (math, ), Python modules whose functions should be wrapped automatically without needing to use fx.wrap(). Backward-compatibility for this parameter is guaranteed.
autowrap_functions (Tuple[Callable, ...]) – defaults to (), Python functions that should be wrapped automatically without needing to use fx.wrap(). Backward compatibility for this parameter is guaranteed.
param_shapes_constant (bool) – When this flag is set, calls to shape, size and a few other shape like attributes of a module’s parameter will be evaluated directly, rather than returning a new Proxy value for an attribute access. Backward compatibility for this parameter is guaranteed.
Note
Backwards-compatibility for this API is guaranteed.
Methods
__init__()Construct a Tracer object.
call_module(m, forward, args, kwargs)Method that specifies the behavior of this
Tracerwhen it encounters a call to annn.Moduleinstance.create_arg(a)A method to specify the behavior of tracing when preparing values to be used as arguments to nodes in the
Graph.create_args_for_root(root_fn, is_module[, ...])Create
placeholdernodes corresponding to the signature of therootModule.create_node(kind, target, args, kwargs[, ...])Inserts a graph node given target, args, kwargs, and name.
create_proxy(kind, target, args, kwargs[, ...])Create a Node from the given arguments, then return the Node wrapped in a Proxy object.
get_fresh_qualname(prefix)Gets a fresh name for a prefix and returns it.
getattr(attr, attr_val, parameter_proxy_cache)Method that specifies the behavior of this
Tracerwhen we call getattr on a call to annn.Moduleinstance.is_leaf_module(m, module_qualified_name)A method to specify whether a given
nn.Moduleis a "leaf" module.iter(obj)Called when a proxy object is being iterated over, such as
keys(obj)Called when a proxy object is has the keys() method called.
path_of_module(mod)Helper method to find the qualified name of
modin the Module hierarchy ofroot.proxy(node)to_bool(obj)Called when a proxy object is being converted to a boolean, such as
trace(root[, concrete_args])Trace
rootand return the corresponding FXGraphrepresentation.Attributes
check_mutable_operationsproxy_buffer_attributestrace_assertstraced_func_namegraphmodule_stack