dmx.compressor.fx.transformer.record_input_interpreter

Classes

RecordInputInterpreter(module[, ...])

Interpreter that captures the input tensors to the compound functions.

RecordInputInterpreterExport(module[, ...])

Interpreter that captures the input tensors to the compound functions.

class dmx.compressor.fx.transformer.record_input_interpreter.RecordInputInterpreter(module, garbage_collect_values=True, graph=None)

Bases: Interpreter

Interpreter that captures the input tensors to the compound functions. .. attribute:: nodeInputs

dictionary that maps node name to its tensor args and kwargs

run_node(n: Node) Any

Run a specific node n and return the result. Calls into placeholder, get_attr, call_function, call_method, call_module, or output depending on node.op

Record input tensors to nodeInputs if target is in compound_functions

Parameters:

n (Node) – The Node to execute

Returns:

The result of executing n

Return type:

Any

class dmx.compressor.fx.transformer.record_input_interpreter.RecordInputInterpreterExport(module, garbage_collect_values=True, graph=None)

Bases: Interpreter

Interpreter that captures the input tensors to the compound functions. .. attribute:: nodeInputs

dictionary that maps node name to its tensor args and kwargs

run_node(n: Node) Any

Run a specific node n and return the result. Calls into placeholder, get_attr, call_function, call_method, call_module, or output depending on node.op

Record input tensors to nodeInputs if target is in compound_functions

Parameters:

n (Node) – The Node to execute

Returns:

The result of executing n

Return type:

Any