This example is based on this post: TensorFlow - numpy-like tensor indexing.
In Numpy you can use arrays to index into an array. E.g. in order to select the elements at (1, 2) and (3, 2) in a 2-dimensional array, you can do this:
# data is [[0, 1, 2, 3, 4, 5],
# [6, 7, 8, 9, 10, 11],
# ...