Thanks for your reply! I am sorry for the confusion. What I meant is that I could easily flatten the orginal tensor(1,3,3,5) to a (1,3,15) tensor. But I only want to keep some of the values in the original tensor like this:

Screenshot from 2021-11-03 17-05-23956×362 117 KB
. So that the last ouput can be (1,3, 10)