Filling a 2D tensor at specific indices without detaching

Hello @robclouth,

I want to do similar work as you mentioned. I want to learn some parameters to paint an image in some positions (using some indexes) to maximize the classification performance of the images. I tried to understand the floor(idx) and interpolation. However, I could not figure out how I to access the positions in the image for changing the RGB channel of the image.
In the mentioned code. I could not relate the output tensor to the image I want to change the color values.
I appreciate it if you help me!