I’m still unsure what exactly is inconsistent.
As described in the docs the gather operation would be applied as:
out[i][j][k] = input[index[i][j][k]][j][k]  # if dim == 0
out[i][j][k] = input[i][index[i][j][k]][k]  # if dim == 1
out[i][j][k] = input[i][j][index[i][j][k]]  # if dim == 2

for a 3D case (and the same logic would still work for the 2D case by removing the k dimension).
Here is a small example:
# 3D
i, j, k = 2, 3, 4
x = torch.randn(i, j, k)
idx = torch.randint(0, i, (i, j, k))

# gather
out = torch.gather(x, dim=0, index=idx)

# manual
out_manual = torch.zeros(i, j, k)
for i_ in range(i):
    for j_ in range(j):
        for k_ in range(k):
            out_manual[i_, j_, k_] = x[idx[i_, j_, k_], j_, k_]

# compare 
print((out==out_manual).all())
# > tensor(True)

# 2D
x = torch.randn(i, j)
idx = torch.randint(0, i, (i, j))

# gather
out = torch.gather(x, dim=0, index=idx)

# manual
out_manual = torch.zeros(i, j)
for i_ in range(i):
    for j_ in range(j):
        out_manual[i_, j_] = x[idx[i_, j_], j_]

# compare 
print((out==out_manual).all())
# > tensor(True)