A colour photograph has shape : height width channels. That is rows, each pixels long, with a red, a green and a blue value for every pixel.
To feed it to an ordinary layer, it is unrolled into one flat list:
Rows, columns and list positions are all counted from .
Now pick out the green value of the pixel at row 40, column 100. In the grid, that pixel has eight neighbours touching it: above, below, left, right and the four diagonals. Each of them has a green value of its own.
On average, how many positions away from the chosen green value do those eight neighbouring green values land in the flat list? The distance between two entries is the absolute difference of their positions.
Give your answer to 2 decimal places.