It seems easy enough to replace: 45e9bc6
The main difference is in Tensor::mut_data()
. This will clone the data if there is more than one reference.
It should only be swapped if it actually saves on clones somehow. Its certainly harder to know when the copy actually happens with rc which is a downside