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

1.6k 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 best solutions below

0
On BEST ANSWER

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