26 template <vector_mode_t V>
32 template <
typename L,
typename R>
46 template <
typename V = default_vec>
55 static constexpr T
apply(
const T& lhs,
const T& rhs) noexcept {
56 return lhs > 0.0 ? rhs : 0.0;
66 template <
typename V = default_vec>
68 auto t1 = V::round_up(
V::min(V::set(T(1.0)), lhs));
70 return V::mul(t1, rhs);
81 template <
typename L,
typename R,
typename Y>
87 impl::cudnn::relu_backward(t1, t2, t3);
100 template <
typename L,
typename R,
typename Y>
101 static Y&
gpu_compute(
const L& lhs,
const R& rhs, Y& y) noexcept {
105 impl::cudnn::relu_backward(t1, t2, y);
114 static std::string
desc() noexcept {
static constexpr int complexity()
Estimate the complexity of operator.
Definition: relu_derivative.hpp:39
static constexpr T apply(const T &lhs, const T &rhs) noexcept
Apply the unary operator on lhs and rhs.
Definition: relu_derivative.hpp:55
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: relu_derivative.hpp:27
static constexpr bool linear
Indicates if the operator is linear or not.
Definition: relu_derivative.hpp:17
static constexpr bool desc_func
Indicates if the description must be printed as function.
Definition: relu_derivative.hpp:19
Binary operator for relu derivative.
Definition: relu_derivative.hpp:16
auto load(size_t x) const noexcept
Load several elements of the expression at once.
Definition: dyn_matrix_view.hpp:143
Root namespace for the ETL library.
Definition: adapter.hpp:15
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: relu_derivative.hpp:33
constexpr bool cudnn_enabled
Indicates if the NVIDIA CUDNN library is available for ETL.
Definition: config.hpp:114
static constexpr bool thread_safe
Indicates if the operator is thread safe or not.
Definition: relu_derivative.hpp:18
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: relu_derivative.hpp:114
auto min(L &&lhs, R &&rhs)
Create an expression with the min value of lhs or rhs.
Definition: expression_builder.hpp:77
decltype(auto) force_temporary_gpu_dim_only(E &&expr)
Force a temporary out of the expression, without copying its content.
Definition: temporary.hpp:223
static auto gpu_compute_hint(const L &lhs, const R &rhs, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: relu_derivative.hpp:82
typename V::template vec_type< T > vec_type
Definition: relu_derivative.hpp:47
decltype(auto) smart_gpu_compute_hint(E &expr, Y &y)
Compute the expression into a representation that is GPU up to date.
Definition: helpers.hpp:368
static ETL_STRONG_INLINE(vec_type< V >) load(const vec_type< V > &lhs
Compute several applications of the operator at a time.
static Y & gpu_compute(const L &lhs, const R &rhs, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: relu_derivative.hpp:101