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 * (1.0 - lhs) * rhs;
66 template <
typename V = default_vec>
68 auto one = V::set(T(1.0));
69 auto t1 = V::sub(one, lhs);
70 auto t2 = V::mul(lhs, t1);
72 return V::mul(t2, rhs);
83 template <
typename L,
typename R,
typename Y>
89 impl::cudnn::sigmoid_backward(t1, t2, t3);
102 template <
typename L,
typename R,
typename Y>
103 static Y&
gpu_compute(
const L& lhs,
const R& rhs, Y& y) noexcept {
107 impl::cudnn::sigmoid_backward(t1, t2, y);
116 static std::string
desc() noexcept {
117 return "sigmoid_back";
typename V::template vec_type< T > vec_type
Definition: sigmoid_derivative.hpp:47
static constexpr bool desc_func
Indicates if the description must be printed as function.
Definition: sigmoid_derivative.hpp:19
static constexpr bool linear
Indicates if the operator is linear or not.
Definition: sigmoid_derivative.hpp:17
static constexpr int complexity()
Estimate the complexity of operator.
Definition: sigmoid_derivative.hpp:39
static constexpr bool thread_safe
Indicates if the operator is thread safe or not.
Definition: sigmoid_derivative.hpp:18
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
Binary operator for sigmoid derivative.
Definition: sigmoid_derivative.hpp:16
constexpr bool cudnn_enabled
Indicates if the NVIDIA CUDNN library is available for ETL.
Definition: config.hpp:114
static ETL_STRONG_INLINE(vec_type< V >) load(const vec_type< V > &lhs
Compute several applications of the operator at a time.
static auto gpu_compute_hint(const L &lhs, const R &rhs, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sigmoid_derivative.hpp:84
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: sigmoid_derivative.hpp:33
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 Y & gpu_compute(const L &lhs, const R &rhs, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sigmoid_derivative.hpp:103
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: sigmoid_derivative.hpp:116
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 constexpr T apply(const T &lhs, const T &rhs) noexcept
Apply the unary operator on lhs and rhs.
Definition: sigmoid_derivative.hpp:55
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: sigmoid_derivative.hpp:27