| 103 | struct Elu { |
| 104 | template <typename XprType> |
| 105 | static auto apply(XprType expr) -> decltype( |
| 106 | (expr < std::declval<typename XprType::Scalar>()) |
| 107 | .select(expr.exp() - |
| 108 | expr.constant(std::declval<typename XprType::Scalar>()), |
| 109 | expr)) { |
| 110 | return (expr < static_cast<typename XprType::Scalar>(0)) |
| 111 | .select(expr.exp() - |
| 112 | expr.constant(static_cast<typename XprType::Scalar>(1)), |
| 113 | expr); |
| 114 | }; |
| 115 | }; |
| 116 | |
| 117 | // Applies `LeakyRelu` to the passed input expression. |