Avoid extra data copy induced by np.ravel
and np.flatten
Β #5555
Open
Description
Description
Some unwanted extra data copies can be avoided when a view is needed by using ndarray.reshape(-1)
instead of np.ravel
and np.flatten
.
Upd(@soupault): More info - https://stackoverflow.com/questions/28930465/what-is-the-difference-between-flatten-and-ravel-functions-in-numpy