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

Function reduce_variable

examples/cnn_ms/train_cnn.py:258–263  ·  view source on GitHub ↗
(variable, dist_opt, reducer)

Source from the content-addressed store, hash-verified

256
257# Function to all reduce NUMPY accuracy and loss from multiple devices
258def reduce_variable(variable, dist_opt, reducer):
259 reducer.copy_from_numpy(variable)
260 dist_opt.all_reduce(reducer.data)
261 dist_opt.wait()
262 output = tensor.to_numpy(reducer)
263 return output
264
265
266def resize_dataset(x, image_size):

Callers 1

runFunction · 0.70

Calls 3

all_reduceMethod · 0.80
copy_from_numpyMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected