pytorch / 1 / generated / torch.nn.functional.hardtanh.html

torch.nn.functional.hardtanh

torch.nn.functional.hardtanh(input, min_val=- 1.0, max_val=1.0, inplace=False) → Tensor [source]

Applies the HardTanh function element-wise. See Hardtanh for more details.

Return type:

Tensor

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/1.13/generated/torch.nn.functional.hardtanh.html