显然,
e.shape == (3, 2, 2)
轴上的总和是归约运算,因此指定的轴消失。因此,
e.sum(axis=0).shape == (2, 2)e.sum(axis=1).shape == (3, 2)e.sum(axis=2).shape == (3, 2)

显然,
e.shape == (3, 2, 2)
轴上的总和是归约运算,因此指定的轴消失。因此,
e.sum(axis=0).shape == (2, 2)e.sum(axis=1).shape == (3, 2)e.sum(axis=2).shape == (3, 2)