mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-01 18:55:11 +08:00
Added support for fp16 to the sigmoid functor.
This commit is contained in:
parent
0eb69b7552
commit
661e710092
@ -69,7 +69,7 @@ struct scalar_sigmoid_op {
|
|||||||
|
|
||||||
template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
Packet packetOp(const Packet& x) const {
|
Packet packetOp(const Packet& x) const {
|
||||||
const Packet one = pset1<Packet>(1);
|
const Packet one = pset1<Packet>(T(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