Mila
Deep Neural Network Library
|
Controls automatic mixed precision behavior for neural network operations. More...
Public Types | |
enum class | Policy { Disabled , Auto , Performance , Accuracy } |
Basic precision policy preference. More... | |
Public Member Functions | |
ComputePrecision (Policy policy=Policy::Auto) | |
Construct a ComputePrecision with the specified policy. | |
Policy | getPolicy () const |
Get the current policy. | |
bool | isEnabled () const |
Check if automatic mixed precision is enabled. | |
void | setPolicy (Policy policy) |
Set the policy preference. | |
std::string | toString () const |
Convert the precision policy to a string representation. | |
Private Attributes | |
Policy | policy_ |
Controls automatic mixed precision behavior for neural network operations.
This lightweight class enables or disables automatic mixed precision (AMP) and provides a basic policy preference, but leaves the actual precision decisions to the underlying libraries and kernels which have sophisticated internal heuristics.
|
strong |
|
inline |
Construct a ComputePrecision with the specified policy.
|
inline |
Get the current policy.
|
inline |
Check if automatic mixed precision is enabled.
|
inline |
Set the policy preference.
|
inline |
Convert the precision policy to a string representation.
|
private |