If I do
mat = rand(8,8)
sum(mat, 1)
the return type is a Matrix with a single row, whereas sum(mat, 2)
gives a Matrix with a single column. This surprises me, as singleton dimensions are generally dropped in 0.5, so I would expect the return type of both operations would be a Vector. Why is the singleton dimension not dropped here?
I might expect this was in order to preserve the orientation (e.g. sum(mat, 1)
is a row Vector), but the behaviour is the same on 0.6, which has explicit 1-d RowVectors, so this does not appear to be an explanation.
Thanks!