Having an input tensor, and another tensor selection, I want to produce the output tensor as the given below

I also create a new post which describes my means, may be it will let you get my thought