aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2018-05-16 21:45:42 +0000
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2018-05-16 21:45:42 +0000
commit0371380d5b6e7686d12e544b9477142219f67ea5 (patch)
tree1e425d92e9f4794ac8d90695530fb630a94c280d
parent1403c2c15bf8b080c367080c5a96bc28154d46d7 (diff)
parentb8d36774faafa89ffc016c2c35f7e906035b2fa5 (diff)
Merged in rmlarsen/eigen2 (pull request PR-393)
Rename scalar_clip_op to scalar_clamp_op to prevent collision with existing functor in TensorFlow.
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorBase.h4
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
index c8dc3bbc5..745b16d2c 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h
@@ -210,9 +210,9 @@ class TensorBase<Derived, ReadOnlyAccessors>
}
EIGEN_DEVICE_FUNC
- EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_clip_op<Scalar>, const Derived>
+ EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_clamp_op<Scalar>, const Derived>
clip(Scalar min, Scalar max) const {
- return unaryExpr(internal::scalar_clip_op<Scalar>(min, max));
+ return unaryExpr(internal::scalar_clamp_op<Scalar>(min, max));
}
EIGEN_DEVICE_FUNC
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h
index 4cee38339..0efcd6253 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h
@@ -488,8 +488,8 @@ struct functor_traits<GaussianGenerator<T, Index, NumDims> > {
};
template <typename Scalar>
-struct scalar_clip_op {
- EIGEN_DEVICE_FUNC inline scalar_clip_op(const Scalar& _min, const Scalar& _max) : m_min(_min), m_max(_max) {}
+struct scalar_clamp_op {
+ EIGEN_DEVICE_FUNC inline scalar_clamp_op(const Scalar& _min, const Scalar& _max) : m_min(_min), m_max(_max) {}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar
operator()(const Scalar& x) const {
return numext::mini(numext::maxi(x, m_min), m_max);
@@ -503,7 +503,7 @@ struct scalar_clip_op {
const Scalar m_max;
};
template<typename Scalar>
-struct functor_traits<scalar_clip_op<Scalar> >
+struct functor_traits<scalar_clamp_op<Scalar> >
{ enum { Cost = 2 * NumTraits<Scalar>::AddCost, PacketAccess = (packet_traits<Scalar>::HasMin && packet_traits<Scalar>::HasMax)}; };
} // end namespace internal