I have a backend and have registered some operations using PrivateUse1 dispatch key. I am trying to dispatch the following:
x[0:1, :, :].copy_(y)
return x + z
I get three slices dispatched to handle the indexing and each return a new tensor and the copy_ copies y into the tensor corresponding with the last dispatched slice but the add will take the sum of the original x and z.
What I expect is for the slices to be done in-place and the copy_ to be updating the original x value. I have tried registering index, index_put_ and masked_fill_ but neither of these ops will be dispatched.
Is there some other operation I should be registering for dispatch?
I think the problem I am having is why I see certain operations being dispatched and not others. I don’t think I have an issue with how the registration is being done. If possible would you be able to run the sample code from above and verify which ops get dispatched. I am using pytorch 1.5