mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-02 16:54:10 +08:00
Made it possible to use the sigmoid functor within a CUDA kernel.
This commit is contained in:
parent
e25e3a041b
commit
d20efc974d
@ -40,8 +40,8 @@ struct scalar_sigmoid_op {
|
|||||||
return one / (one + std::exp(-x));
|
return one / (one + std::exp(-x));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Packet>
|
template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
inline Packet packetOp(const Packet& x) const {
|
Packet packetOp(const Packet& x) const {
|
||||||
const Packet one = pset1<Packet>(1);
|
const Packet one = pset1<Packet>(1);
|
||||||
return pdiv(one, padd(one, pexp(pnegate(x))));
|
return pdiv(one, padd(one, pexp(pnegate(x))));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user