MCPcopy
hub / github.com/OpenPPL/ppq / mark_variable_as_graph_output

Method mark_variable_as_graph_output

ppq/IR/base/graph.py:825–832  ·  view source on GitHub ↗
(self, var: Variable)

Source from the content-addressed store, hash-verified

823 self.inputs[var_name] = self.variables[var_name]
824
825 def mark_variable_as_graph_output(self, var: Variable):
826 if not isinstance(var, Variable):
827 raise TypeError(f'Except a variable here, however {type(var)} was given.')
828 var_name = var.name
829 if var_name not in self.variables:
830 raise KeyError(f'Can not find variable {var_name} within current graph.')
831 if var_name in self.outputs: return
832 self.outputs[var_name] = self.variables[var_name]
833
834 def __getstate__(self) -> dict:
835 state = super().__getstate__()

Callers 7

remove_operationMethod · 0.95
QuantZoo_Yolo.pyFile · 0.80
truncate_on_varMethod · 0.80
testFuseBias.pyFile · 0.80
test_graph_api.pyFile · 0.80
testBnToConv.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected