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

Function reduce_variable

examples/malaria_cnn/train_cnn.py:77–82  ·  view source on GitHub ↗
(variable, dist_opt, reducer)

Source from the content-addressed store, hash-verified

75
76# Function to all reduce NUMPY accuracy and loss from multiple devices
77def reduce_variable(variable, dist_opt, reducer):
78 reducer.copy_from_numpy(variable)
79 dist_opt.all_reduce(reducer.data)
80 dist_opt.wait()
81 output = tensor.to_numpy(reducer)
82 return output
83
84
85def 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