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

Function reduce_variable

examples/cnn_ms/train_ms_model.py:251–256  ·  view source on GitHub ↗
(variable, dist_opt, reducer)

Source from the content-addressed store, hash-verified

249
250# Function to all reduce NUMPY accuracy and loss from multiple devices
251def reduce_variable(variable, dist_opt, reducer):
252 reducer.copy_from_numpy(variable)
253 dist_opt.all_reduce(reducer.data)
254 dist_opt.wait()
255 output = tensor.to_numpy(reducer)
256 return output
257
258
259def 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