mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-22 14:15:01 +08:00
Configurable flushing denormal numbers on CPU (#5294)
* Configurable flushing denormal numbers on CPU * Formatting * Update docs * Minor doc changes
This commit is contained in:
committed by
Soumith Chintala
parent
6279367297
commit
fae6c67121
@ -3932,6 +3932,37 @@ Example::
|
||||
|
||||
""")
|
||||
|
||||
add_docstr(torch._C.set_flush_denormal,
|
||||
r"""
|
||||
set_flush_denormal(mode) -> bool
|
||||
|
||||
Disables denormal floating numbers on CPU.
|
||||
|
||||
Returns ``True`` if your system supports flushing denormal numbers and it
|
||||
successfully configures flush denormal mode. :meth:`~torch.set_flush_denormal`
|
||||
is only supported on x86 architectures supporting SSE3.
|
||||
|
||||
Args:
|
||||
mode (bool): Controls whether to enable flush denormal mode or not
|
||||
|
||||
Example::
|
||||
|
||||
>>> torch.set_flush_denormal(True)
|
||||
True
|
||||
>>> torch.DoubleTensor([1e-323])
|
||||
|
||||
0
|
||||
[torch.DoubleTensor of size 1]
|
||||
|
||||
>>> torch.set_flush_denormal(False)
|
||||
True
|
||||
>>> torch.DoubleTensor([1e-323])
|
||||
|
||||
9.88131e-324 *
|
||||
1.0000
|
||||
[torch.DoubleTensor of size 1]
|
||||
""")
|
||||
|
||||
add_docstr(torch._C.set_num_threads,
|
||||
r"""
|
||||
set_num_threads(int)
|
||||
|
Reference in New Issue
Block a user