dmx.compressor.modeling.nn.core.DmxGraph
- class dmx.compressor.modeling.nn.core.DmxGraph(owning_module=None, tracer_cls=None, tracer_extras=None)
- __init__(owning_module=None, tracer_cls=None, tracer_extras=None)
Construct an empty Graph.
Note
Backwards-compatibility for this API is guaranteed.
Methods
__init__([owning_module, tracer_cls, ...])Construct an empty Graph.
call_function(the_function[, args, kwargs, ...])Insert a
call_functionNodeinto theGraph.call_method(method_name[, args, kwargs, ...])Insert a
call_methodNodeinto theGraph.call_module(module_name[, args, kwargs, ...])Insert a
call_moduleNodeinto theGraph.create_node(op, target[, args, kwargs, ...])Create a
Nodeand add it to theGraphat the current insert-point.create_placeholders(names[, cast_names, ...])eliminate_dead_code([is_impure_node])Remove all dead code from the graph, based on each node's number of users, and whether the nodes have any side effects.
erase_node(to_erase)Erases a
Nodefrom theGraph.find_nodes(*, op[, target, sort])Allows for fast query of nodes
get_attr(qualified_name[, cast_name, ...])optional_arg: controlling whether None will be returned instead of a Node. e.g. optional_arg = linear_mod.bias will return None when the module does not have a bias term.
graph_copy(g, val_map[, return_output_node])Copy all nodes from a given graph into
self.inserting_after([n])Set the point at which create_node and companion methods will insert into the graph.
inserting_before([n])Set the point at which create_node and companion methods will insert into the graph.
lint()Runs various checks on this Graph to make sure it is well-formed.
node_copy(node[, arg_transform])Copy a node from one graph into another.
arg_transformneeds to transform arguments from the graph of node to the graph of self. Example::.on_generate_code(make_transformer)Register a transformer function when python code is generated
output(result[, type_expr])Insert an
outputNodeinto theGraph.output_node()placeholder(name[, cast_name, cast_format, ...])Insert a
placeholdernode into the Graph.print_tabular()Prints the intermediate representation of the graph in tabular format.
process_inputs(*args)Processes args so that they can be passed to the FX graph.
process_outputs(out)python_code(root_module, *[, verbose, ...])Turn this
Graphinto valid Python code.qdq_node(node, cast_name, cast_format)set_codegen(codegen)Attributes
nodesGet the list of Nodes that constitute this Graph.
owning_module