Given a 4-D array A, return the sum over its last two axes at once (result has the shape of the first two axes).
A
Input
A = np.arange(144).reshape(3, 4, 3, 4)
Output
[[ 66 210 354 498] [ 642 786 930 1074] [1218 1362 1506 1650]]
This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.
solve(...)