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

Function reduce_variable

examples/onnx/training/train.py:84–89  ·  view source on GitHub ↗
(variable, dist_opt, reducer)

Source from the content-addressed store, hash-verified

82
83# Function to all reduce NUMPY Accuracy and Loss from Multiple Devices
84def reduce_variable(variable, dist_opt, reducer):
85 reducer.copy_from_numpy(variable)
86 dist_opt.all_reduce(reducer.data)
87 dist_opt.wait()
88 output = tensor.to_numpy(reducer)
89 return output
90
91
92def 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