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

Function recursive

python/singa/utils.py:244–260  ·  view source on GitHub ↗
(root, yid, root_t)

Source from the content-addressed store, hash-verified

242 """
243
244 def recursive(root, yid, root_t):
245 if root:
246 # srcop: operator for a input of root
247 # yid: id(output of this operator)
248 # y: output of this operator
249 for srcop, yid, y, _ in root.src:
250 recursive(srcop, yid, y)
251
252 if type(root).__name__ == 'Dummy':
253 if root_t != None:
254 # constant within a node: weight
255 weights[root.name] = root_t
256 else:
257 # constant outside a node: input
258 inputs[root.name] = root_t
259 else:
260 nodes[root.name] = root
261
262 nodes = OrderedDict()
263 weights = OrderedDict()

Callers 1

post_order_recursiveFunction · 0.85

Calls 1

typeFunction · 0.85

Tested by

no test coverage detected