clip

dragon.math.clip(
  inputs,
  low=None,
  high=None,
  **kwargs
)[source]

Compute the clipped input according to the given bounds.

\[\text{out} = \min(\max(\text{input}, \text{low}), \text{high}) \]
Parameters:
  • inputs (dragon.Tensor) – The input tensor.
  • low (number, optional) – The value to \(\text{low}\).
  • high (number, optional) – The value to \(\text{high}\).
Returns:

dragon.Tensor – The output tensor.