Clip#
API#
- class warp_nn.modules.operators.Clip( )[source]#
Bases:
ModuleElement-wise clipping (clamping) of the input values into the interval [
min_val,max_val].\[\text{Clip}(x) = \min(\text{max\_val}, \max(x, \text{min\_val}))\]When
min_valis greater thanmax_val, all the values are set tomax_val.PyTorch’s
Hardtanh(min_val, max_val)is equivalent toClip(min_val, max_val).- Parameters:
min_val – The lower bound of the interval. If None, the values are not bounded below.
max_val – The upper bound of the interval. If None, the values are not bounded above.
requires_grad – Whether the cached output arrays of the module require gradients.