Thanks for the reply. What I’m actually trying to do is modify slices of the tensor in-place. I’m not concerned necessarily about how to pass the tensor itself as an argument, but rather just a slice of it.
Also, I don’t think passing by reference quite makes a difference in this case, as at::tensor 8 just wraps a pointer to the data, not the data itself. In passing by reference, you’re just passing a reference to a pointer.