Replace all values close to zero

Thank you. I didn’t know about torch.logical_and(). However, when I use this approach I get the following error in my forward() method:

RuntimeError: a leaf Variable that requires grad is being used in an in-place operation.