Hi!
I did it like this, it worked. Thanks
m.eval()
for vec,ind in loaderx:
    with torch.no_grad():
        opp,_,_ = m(vec)    
    for i in range(ind.shape[0]):
        ans = torch.cat((torch.tensor([ind[i]]),opp[i]),dim =0)
        ar[ind[i]] = ans

But can you solve another query, detach() should have been cut it in the computational graph then why it didn’t work?