Hi all, is there any way to change A to B using pytorch’s built-in functions?
A=[1,2,0,4,5,6,7,0,8,9,10]
B = [[1,2,0,0,0],[4,5,6,7,0][8,9,10,0,0]]
Basically I’m trying to split A by value (0 in this case) and pad results.
A -> split(0) -> [1,2], [4,5,6,7], [8,9,10] -> pad -> [1,2,0,0,0],[4,5,6,7,0], [8,9,10,0,0]
Thanks