TensorFlow extracting columns
I can't comment on the question because of low rep, so using an answer instead.
Can you clarify your question a bit, maybe with a small concrete example using very small tensors?
What are the "columns" you are referring to? You say that you want to keep 50 columns (presumably 50 numbers) per image. If so, the (10, 50) shape seems like what you want - it has 50 numbers for each image in the batch. The (10, 50, 20, 3) shape you mention would allocate 50 numbers to each "image_column x channel". That is 20*3*50 = 3000 numbers per image. How do you want to construct them from the 50 that you have?
Also, can you give a link to tf.batch_nd(). I did not find anything similar and relevant.
I have a tensor of shape (10, 100, 20, 3). Basically, it can be thought of as a batch of images. So the image height is 100 and width is 20 and channel depth is 3.
I have run some computations to generate a set of 10*50 indices corresponding to 50 columns I would like to keep per image in the batch. The indices are stored in a tensor of shape (10, 50). I would like to end up with a tensor of shape (10, 50, 20, 3).
I have looked into tf.batch_nd() but I can't figure out the semantics for how indices are actually used.
Any thoughts?