block-hczhai / pyblock3-preview

pyblock3: an efficient python block-sparse tensor library
GNU General Public License v3.0
21 stars 12 forks source link

Replace `numpy.flatten` by `numpy.ravel` #7

Closed h-larsson closed 1 year ago

h-larsson commented 1 year ago

flatten returns a copy whereas ravel returns a view.¹ I checked all expressions and think they are ok for using views instead of copies, but please double check.

¹ https://numpy.org/doc/stable/reference/generated/numpy.ndarray.flatten.html https://numpy.org/doc/stable/reference/generated/numpy.ravel.html