use constexpr to replace static const
This commit is contained in:
@@ -54,11 +54,11 @@ class LogSoftmaxLayer
|
||||
output.transform( [](double x)
|
||||
{
|
||||
//! Fast approximation of exp(-x) for x positive.
|
||||
static const double A0 = 1.0;
|
||||
static const double A1 = 0.125;
|
||||
static const double A2 = 0.0078125;
|
||||
static const double A3 = 0.00032552083;
|
||||
static const double A4 = 1.0172526e-5;
|
||||
constexpr double A0 = 1.0;
|
||||
constexpr double A1 = 0.125;
|
||||
constexpr double A2 = 0.0078125;
|
||||
constexpr double A3 = 0.00032552083;
|
||||
constexpr double A4 = 1.0172526e-5;
|
||||
|
||||
if (x < 13.0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user