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

Method initialize

python/singa/sonnx.py:1977–1994  ·  view source on GitHub ↗

Init the instance

(self)

Source from the content-addressed store, hash-verified

1975 self.is_graph = False
1976
1977 def initialize(self):
1978 """
1979 Init the instance
1980 """
1981 self.outputs_info = {outp.name: outp for outp in self.outputs}
1982 _layers = [] # layers by topo order
1983 for node, operator in self.layers:
1984 _del_keys = []
1985 for key, name in node.weight_inputs.items():
1986 if key not in self.states:
1987 # cannot find the weights, try to find it from input
1988 node.set_attr_inputs(key, name)
1989 _del_keys.append(key)
1990 for key in _del_keys:
1991 node.del_weight_inputs(key)
1992 self.__dict__[node.name] = operator
1993 _layers.append(node)
1994 self._layers = _layers
1995
1996 def init_tensor_count(self):
1997 """

Callers 1

runMethod · 0.95

Calls 3

set_attr_inputsMethod · 0.80
appendMethod · 0.80
del_weight_inputsMethod · 0.80

Tested by

no test coverage detected