n = 10
F = np.tile(np.arange(0, n, 0.1)[(None), (None), :, (None), (None)], [n, n,
    1, n, n])
X = np.tile(np.arange(0, n)[(None), (None), :, (None)], [n, n, 1, n])
a, b, c, d = np.ogrid[:n, :n, :n, :n]
argmaxD = F[a, b, c, d, X].argmax(axis=-1)
Evaluate array at specific subarray