I need a transformation of a tensor which is very similar to roll. The difference is that I do not want the values from the end of the axis to appear in the beginning. In other words I want, for example, the 2nd element to be on 3d place but I do not want the last element to become the first one. Instead, I want the first elements to be zeros.
I have tried this:
prev_xs = tf.roll(xs, shift = 1, axis = 1)
prev_xs[:,0] = 0.0
However, it does not work because
TypeError: 'Tensor' object does not support item assignment
So, what is the proper solution of the problem?