PyTorch torch.set_flush_denormal function
PyTorch torch reference manual
torch.set_flush_denormal is a function in PyTorch used to set flushing of denormal numbers. Setting whether to flush denormal numbers to zero can improve performance but reduce precision.
Function definition
torch.set_flush_denormal(flush)
Usage examples
Example
import
torch
Enable flushing of denormal numbers
torch.
set_flush_denormal
(
True
)
(
"Flush denormal enabled"
)
Disable flushing of denormal numbers
torch.
set_flush_denormal
(
False
)
(
"Flush denormal disabled"
)