PyTorch torch.set_flush_denormal Function
Pytorch torch Reference Manual
torch.set_flush_denormalIt is a function in PyTorch for flushing denormal numbers. Setting whether to flush denormal numbers to zero can improve performance but reduce precision.
Function Definition
torch.set_flush_denormal(flush)
Usage Example
Example
import torch
# Enable flushing denormal numbers
torch.set_flush_denormal(True)
print("Flush denormal enabled")
# Disable flushing denormal numbers
torch.set_flush_denormal(False)
print("Flush denormal disabled")
# Enable flushing denormal numbers
torch.set_flush_denormal(True)
print("Flush denormal enabled")
# Disable flushing denormal numbers
torch.set_flush_denormal(False)
print("Flush denormal disabled")
Other Extensions