I am trying to convert my current code, which assigns tensors in place, to an outer operation.
Meaning currently the code is
self.X[:, nc:] = D
Where D is in the same shape as self.X[:, nc:]
But I would like to convert it to
sliced_index = ~ somehow create an indexed tensor from self.X[:, nc:]
self.X = self.X.scatter(1,sliced_index,mm(S_, Z[:, :n - nc]))
And don't know how to create that index mask tensor that represents only the entries in the sliced tensor
Minimal example:
a = [[0,1,2],[3,4,5]]
D = [[6],[7]]
Not_in_place = [[0,1,6],[3,4,7]]