I have a variable that looks something like [1,2,3,0,0,0,1,2] and I want to end up with the following variable: [1,2,3,1,2].
In TensorFlow, this would be done with something along the lines of tf.gather(tf.where(tf.not_equal(a, zero_tensor))). Is there a way to do this in PyTorch?
Thanks in advance.