MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / reduce_sum

Function reduce_sum

imperative/python/megengine/functional/einsum.py:441–447  ·  view source on GitHub ↗
(x, axis)

Source from the content-addressed store, hash-verified

439 return shape
440
441 def reduce_sum(x, axis):
442 if len(axis) == 0:
443 return x
444 for i in reversed(axis):
445 x = f(builtin.Reduce(mode="sum", axis=i), x)
446 x = f(builtin.RemoveAxis(axis=[*reversed(axis)]), x)
447 return x
448
449 ctx.dims2val = dims2val
450 ctx.reduce = reduce_sum

Callers 15

run_level2Function · 0.50
TESTFunction · 0.50
TEST_FFunction · 0.50
TESTFunction · 0.50
run_graphFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50
TEST_PASSFunction · 0.50
TEST_FFunction · 0.50
applyMethod · 0.50

Calls 2

ReduceMethod · 0.80
fFunction · 0.50

Tested by 15

run_level2Function · 0.40
TESTFunction · 0.40
TEST_FFunction · 0.40
TESTFunction · 0.40
run_graphFunction · 0.40
TESTFunction · 0.40
TESTFunction · 0.40
TEST_PASSFunction · 0.40
TEST_FFunction · 0.40
TESTFunction · 0.40