Solved by albanD in post #2 
              
              
                Hi, 

np.maximum or things, which is wip in Pytorch 

Not sure what you mean by that. You can use torch.max() to get element-wise maximum. Or you can use the threshold function if you just want a threshold as seems to be the case in your code. 
I would recommend you read the doc that explains how to…