Hi there,
I have a very specific masking problem on the outputs and I could not use gather.
I have two matrices:
M = [[1 2 3]
[4 5 6]
[7 8 9]]
and
I = [1,2,1]
I need the outputs to be
out =  [[1 2 3]
[0 5 0]
[0 0 0]]
Basically, this operation will make the elements in “M” whose indexes larger than the corresponding their indexes in “I” to zero. For example, the elements whose indexes greater than 1 (since the first column in “I” is 1) in the first column of “M” will be zero.
Is there an easy way to do this?
Thanks!