clamp¶
dragon.vm.torch.
clamp
(
input,
min=None,
max=None,
out=None
)[source]¶Compute the clipped input according to the given bounds.
\[\text{out} = \min(\max(\text{input}, low), high) \]- Parameters:
- input (dragon.vm.torch.Tensor) – The input tensor.
- min (number, optional) – The min value.
- max (number, optional) – The max value.
- out (dragon.vm.torch.Tensor, optional) – The output tensor.
- Returns:
dragon.vm.torch.Tensor – The output tensor.