Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.set_flush_denormal function

PyTorch torch.set_flush_denormal function


PyTorch torch reference manual 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

)

print

(

"Flush denormal enabled"

)

Disable flushing of denormal numbers

torch.

set_flush_denormal

(

False

)

print

(

"Flush denormal disabled"

)


PyTorch torch reference manual PyTorch torch reference manual