Generic way to apply function to a dimension of a matrix

Thanks, Steven.
You’re right, bad example. Say I want the norm of the 10x3 matrix as a 10 element array (i.e., norm of each line).
I’d like to know how to do it without for loops to be able to easily use CUDA.
Thanks!