owl icon indicating copy to clipboard operation
owl copied to clipboard

Mat.flatten does not return a Mat.mat

Open jfeser opened this issue 4 years ago • 1 comments

Mat.flatten returns a one-dimensional ndarray, so using Mat operations on it fails with a "wrong number of indices" error.

jfeser avatar Aug 30 '21 21:08 jfeser

Hi @jfeser , I think the idea of flatten is to mimic numpy.flatten, which returns a 1D ndarray.

Implementation-wise, flatten is just a simple wrapper around. Maybe you can try Mat.(reshape x [|1; numel x|])? Would that be acceptable?

tachukao avatar Dec 31 '21 06:12 tachukao