Hardtanh
- class torch.nn.modules.activation.Hardtanh(min_val=-1.0, max_val=1.0, inplace=False, min_value=None, max_value
Applies the HardTanh function element-wise.
HardTanh is defined as:
Keyword arguments min_value and max_value
have been deprecated in favor of min_val and max_val.
Input: , where means any number of dimensions.
Output: , same shape as the input.
Examples:
>>> m = nn.Hardtanh(-2, 2)
>>> input = torch.randn(2)
>>> output = m(input)
Return the extra representation of the module.
Runs the forward pass.