diff options
author | Rasmus Larsen <rmlarsen@google.com> | 2016-05-17 09:49:31 -0700 |
---|---|---|
committer | Rasmus Larsen <rmlarsen@google.com> | 2016-05-17 09:49:31 -0700 |
commit | 00228f2506b5d64e12ced70262dc795ec15bad6c (patch) | |
tree | 7dee0d36e73b2bf42c02fece33975032a7dd1fd8 /unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h | |
parent | 5005b27fc8400be46fb3d3f755d50b9175542656 (diff) | |
parent | e7e64c327785ceffd9da018ee265d761991f9685 (diff) |
Merged eigen/eigen into default
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h index babafe108..d06f40cd8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h @@ -254,6 +254,14 @@ struct TensorEvaluator<const TensorTupleReducerOp<ReduceOp, Dims, ArgType>, Devi EIGEN_DEVICE_FUNC Scalar* data() const { return NULL; } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost + costPerCoeff(bool vectorized) const { + const double compute_cost = 1.0 + + (m_return_dim < 0 ? 0.0 : (TensorOpCost::ModCost<Index>() + TensorOpCost::DivCost<Index>())); + return m_orig_impl.costPerCoeff(vectorized) + + m_impl.costPerCoeff(vectorized) + TensorOpCost(0, 0, compute_cost); + } + private: EIGEN_DEVICE_FUNC void gen_strides(const InputDimensions& dims, StrideDims& strides) { if (m_return_dim < 0) { |