Transpose the out array if it is provided.