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

Method mark_variable_as_graph_input

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

Source from the content-addressed store, hash-verified

812 return created
813
814 def mark_variable_as_graph_input(self, var: Variable):
815 if not isinstance(var, Variable):
816 raise TypeError(f'Except a variable here, however {type(var)} was given.')
817 var_name = var.name
818 if var_name not in self.variables:
819 raise KeyError(f'Can not find variable {var_name} within current graph.')
820 if var_name in self.inputs: return
821 if var_name in self.outputs:
822 raise KeyError(f'Can not mark variable {var_name} as graph input, cause it is graph output.')
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):

Callers 4

optimizeMethod · 0.80
testFuseBias.pyFile · 0.80
testBnToConv.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected