filter out rows which satisfy a condition in each column
Suppose I have a tensor:
input: ([[-0.5535,  0.0000],
        [ 0.0000,  0.0000],
        [-1.1370, -0.2736],
        [-1.2300,  0.9185]])

Output:([[-0.5535,  0.0000],
        [-1.1370, -0.2736],
        [-1.2300,  0.9185]])

I need to keep only the rows which have non-zero elements in all columns, and the index of the deleted row. For simplicity, I have limited the matrix to two columns, however in my case the number of columns and rows keeps changing in every iteration.
I have found solutions where the condition may satisfy any element in the matrix, or there may be separate conditions to satisfy per column, but I couldn't figure out how to solve this particular case.
Thank you.

I will answer my own question since I found the solution in pytorch.
This function will return the row-indices of non
x[torch.nonzero(torch.tensor(x), as_tuple=True)[0].unique()]
OR
x[torch.nonzero(torch.tensor(x.sum(1)), as_tuple=True)[0]]
