Consider the following scenario.
import numpy as np
x = np.random.randint(0,21,size=(10,64,64))
y = np.random.rand(10,21,64,64)
z = np.empty((10,64,64))
for i in range(10):
for j in range(64):
for k in range(64):
z[i][j][k] = y[i][x[i][j][k]][j][k]
What is the recommended (in terms of speed) way to implement this behavior using numpy indexing?