Solved by ptrblck in post #2 
              
              
                As the error message claims, you cannot use an if condition on multiple values and would need to split the tensor. 
Assuming you want to pass the values matching the condition to self.modelPredictor and return the others, you could apply this workflow: 
# output from previous layer
x = torch.randn(1…