mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Vectorize tensor.isnan() by using typed predicates.
This commit is contained in:
@@ -611,12 +611,13 @@ class TensorBase<Derived, ReadOnlyAccessors>
|
||||
return operator!=(constant(threshold));
|
||||
}
|
||||
|
||||
// Checks
|
||||
// Predicates.
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_isnan_op<Scalar>, const Derived>
|
||||
EIGEN_STRONG_INLINE const TensorConversionOp<bool, const TensorCwiseUnaryOp<internal::scalar_isnan_op<Scalar, true>, const Derived>>
|
||||
(isnan)() const {
|
||||
return unaryExpr(internal::scalar_isnan_op<Scalar>());
|
||||
return unaryExpr(internal::scalar_isnan_op<Scalar, true>()).template cast<bool>();
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_isinf_op<Scalar>, const Derived>
|
||||
(isinf)() const {
|
||||
@@ -1219,4 +1220,3 @@ class TensorBase : public TensorBase<Derived, ReadOnlyAccessors> {
|
||||
} // end namespace Eigen
|
||||
|
||||
#endif // EIGEN_CXX11_TENSOR_TENSOR_BASE_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user