MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / aggregate

Function aggregate

tensorpack/graph_builder/utils.py:279–283  ·  view source on GitHub ↗
(grads)

Source from the content-addressed store, hash-verified

277 return all_grads[0]
278
279 def aggregate(grads):
280 if average:
281 return tf.multiply(tf.add_n(grads), 1.0 / nr_tower)
282 else:
283 return tf.add_n(grads)
284
285 ret = []
286 for idx, grad_and_vars in enumerate(zip(*all_grads)):

Callers 2

aggregate_grads_colocateFunction · 0.85
allreduce_grads_naiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected