what is the equivalent of theano.tensor.clip in pytorch?

1.7k views Asked by At

I want to clip my tensor (not gradient) values to some range. Is there any function in pytorch like there is a function theano.tensor.clip() in theano?

1

There are 1 answers

0
McLawrence On BEST ANSWER

The function you are searching for is called torch.clamp. You can find the documentation here