Hi I have a 3D tensor im.shape  = [1,256,256]. I also have the long tensor of indices h = [0, 4, 8, … 244, 248, 252] and w =   [0, 4, 8, … 244, 248, 252]. both h and w have len = 64. I want to create 64x64 tensor from the im tensor with the values taken from im from index select from both h and w.
like
t = 
tensor([[ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16],
        [17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]])

x= torch.tensor([0,2,4,6,8,10,12,14]).long()
tensor([ 0,  2,  4,  6,  8, 10, 12, 14])

y = torch.tensor([0,2,4,6,8,10,12,14]).long()
tensor([ 0,  2,  4,  6,  8, 10, 12, 14])




I want the out put like this
tensor([[ 1,  3,  5,  7,  9, 11, 13, 15],
        [17, 19, 21, 23, 25, 27, 29, 31]])