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, indices.unsqueeze(-1).expand(2, 100, 8, 1)) # expand to 1, 8 if you want rows
print(v_max.size())
print(v[0][0])
print(v_max[0][0])