OliverFM / rust_light

A tensor processing library in rust.
MIT License
3 stars 0 forks source link

Stop doing clones in IndexIterator. #11

Closed OliverFM closed 1 year ago

OliverFM commented 1 year ago

Currently the only way to do this is to clone things -- because the index could be updated before the reference stops being used. However it should be possible to make a non-cloning iterator where the returned value is self and one uses the index by reading self.index.

OliverFM commented 1 year ago

Probably not possible, however I made an independent increment_index function which solves most internal use cases.