Hi,
I suppose that the expected result is [1, 2, 3] and not [[2], [1, 3]]. Here is one way you can do it:
    x = torch.tensor([[0, 1], [2, 3], [0, 0]], dtype=torch.int32)
    mask = (x != 0)
    y = x[mask]
    print(y)
    # tensor([1, 2, 3], dtype=torch.int32)

Let me know if it is not what you wanted!