tch-rs icon indicating copy to clipboard operation
tch-rs copied to clipboard

Tensor #[must_use] not always correct

Open AlexanderEkdahl opened this issue 3 years ago • 1 comments
trafficstars

Hi,

First off, thank you for this amazing library!

I noticed how Tensor has been annotated with #[must_use] but this isn't necessarily correct for in-place operations such as cumsum_.

Could the generating method be updated to only annotate #[must_use] for non-in-place operations? I'd be happy to implement this if you think it is a good idea?

AlexanderEkdahl avatar Jan 10 '22 19:01 AlexanderEkdahl

This is indeed annoying, I would love to see this fixed

Butanium avatar May 04 '23 23:05 Butanium