I have two tensors, one with data and one with some value I would like to threshold on, both along row C:
a = torch.Tensor(B,C,X,Y)
b = torch.Tensor(B,C)

I would like to find those rows of C in tensor a  that fulfill a criterion based on tensor b. For example:
# Indices of b where b is zero
idx = (b==0)

The end result should look like:
bar(b)
foo(a)
a = torch.Tensor(B,C-N,X,Y)
#N is number of rows that do not match condition.