Solved by aliutkus in post #2 
              
              
                answering my own question: 
torch.min(
   torch.max(x, min[:, None]),
   max[:, None])

less elegant than a call to clamp but works fine