MCPcopy Create free account
hub / github.com/apache/singa / init_tensor_count

Method init_tensor_count

python/singa/sonnx.py:1996–2009  ·  view source on GitHub ↗

Init the tensor count dict

(self)

Source from the content-addressed store, hash-verified

1994 self._layers = _layers
1995
1996 def init_tensor_count(self):
1997 """
1998 Init the tensor count dict
1999 """
2000 self.tensor_count = {}
2001 for node, operator in self.layers:
2002 # init the tensor count
2003 all_possible_inputs = node.inputs + list(
2004 node.attr_inputs.keys()) + list(node.weight_inputs.keys())
2005 for inp in all_possible_inputs:
2006 if inp not in self.tensor_count:
2007 self.tensor_count[inp] = 1
2008 else:
2009 self.tensor_count[inp] += 1
2010
2011 def to_input_tensor(self, x):
2012 """

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected