Hi @Yufeng_Ma,
did you solve your problem? I have the same problem. I have two tensors with variable sequences and I want to concat them, but I want to put the zeros in the end.
For example, I have a sequence 5 6 7 8 0 0 and another sequence 6 9 1 2 3 4 0 0. I need a merged sequence as follows: 5 6 7 8 6 9 1 2 3 4 0 0 0 0. I don’t want just to concat, because if I concat I would have 5 6 7 8 0 0 6 9 1 2 3 4 0 0.
Does your problem is similar to mine?