mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
Added support for rounding, flooring, and ceiling to the tensor api
This commit is contained in:
parent
dac58d7c35
commit
5cf4558c0a
@ -232,6 +232,25 @@ class TensorBase<Derived, ReadOnlyAccessors>
|
||||
return TensorConversionOp<NewType, const Derived>(derived());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_round_op<Scalar>, const Derived>
|
||||
round() const {
|
||||
return unaryExpr(internal::scalar_round_op<Scalar>());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_ceil_op<Scalar>, const Derived>
|
||||
ceil() const {
|
||||
return unaryExpr(internal::scalar_ceil_op<Scalar>());
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_floor_op<Scalar>, const Derived>
|
||||
floor() const {
|
||||
return unaryExpr(internal::scalar_floor_op<Scalar>());
|
||||
}
|
||||
|
||||
|
||||
// Generic binary operation support.
|
||||
template <typename CustomBinaryOp, typename OtherDerived> EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<CustomBinaryOp, const Derived, const OtherDerived>
|
||||
|
Loading…
Reference in New Issue
Block a user