-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Description
During writing einsum I've found that sum is able to sum only over single axis. I'm going to add a simple implementation of it:
def sum(input, axes, keepdim=False):
# probably some check for uniqueness of axes
if keepdim:
for ax in axes:
input = input.sum(ax, keepdim=True)
else:
for ax in sorted(axes, reverse=True):
input = input.sum(ax)
return input
- Is it ok?
- Where should it be better placed?
EliasVansteenkiste
Metadata
Metadata
Assignees
Labels
No labels