Is there a way to call maximum
along multiple dimensions so that it works for StaticArrays.SArray
, and also in a type-stable way? MWE:
# setup code
using StaticArrays
dims = (2,3,5)
A = randn(dims...)
SA = SArray(Size(dims...)(A))
# type-stable version for that also works for SA?
vec(maximum(A, dims = (2, 3)))