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

Possible UB in Tensor

Open Pratyush opened this issue 6 years ago • 21 comments

Hi,

I'm not super familiar with the design of the library, but I've been trying to use it in a project of mine. In doing so I found that Tensor::f_copy mutates a Tensor that's passed as a immutable reference, which is UB in Rust. I think one of the arguments should be changed to &mut to fix this. Sorry if I've missed some context.

Thanks!

Pratyush avatar May 04 '19 18:05 Pratyush