Solved by albanD in post #2 
              
              
                Hi, 
You can use gather with expanded indices: 
import torch
seconds_in_a_day = 24 * 60 * 60
seconds_im = torch.rand(2, 100, 8, 8, dtype=torch.cdouble)
w, v = torch.linalg.eig(seconds_im)
_, indices = torch.max(w.abs(), dim=-1, keepdim=True)
print(indices.size())
print(v.size())
v_max = v.gather(-1,…