Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bgawrych committed Jul 16, 2021
1 parent 54fca86 commit e187f1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/mxnet/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ MXNET_DLL int MXRandomSeedContext(int seed, int dev_type, int dev_id);

/*!
* \brief Change floating-point calculations when dealing with denormalized values.
* Currently this option is only supported in CPU backend.
* Flushing denormalized values to zero is enabled by default.
*
* \param value state of flush-to-zero and denormals-are-zero to set.
* \param prev_state state of flush-to-zero and denormals-are-zero before setting new state.
* \return 0 when success, -1 when failure happens.
Expand Down
6 changes: 6 additions & 0 deletions python/mxnet/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,11 +1208,17 @@ def set_flush_denorms(value):
(exponent is the smallest possible value).
Flushing denormalized values to 0 can speedup calculations if such values occurs,
but if fulfilling whole IEEE 754 standard is required this option should be disabled.
Flushing denormalized values is enabled in MXNet by default.
Parameters
----------
value : bool
State of flush-to-zero and denormals-are-zero in MXCSR register
Returns
-------
prev_state : bool
Previous state of flush-to-zero in MXCSR register
"""
ret = ctypes.c_bool()
passed_value = ctypes.c_bool(value)
Expand Down

0 comments on commit e187f1c

Please sign in to comment.