From 109935bfce4179bcca575ab0e59182de86e9ce51 Mon Sep 17 00:00:00 2001 From: "C. Antonio Sanchez" Date: Sat, 15 Feb 2025 22:46:57 -0800 Subject: [PATCH] Fix Tensor docs (cherry picked from commit 42d9cc0b1d9c16df85723cd37e6a0163224e6a72) --- .../Eigen/CXX11/src/Tensor/TensorArgMax.h | 14 ++--- .../Eigen/CXX11/src/Tensor/TensorAssign.h | 23 +++---- .../CXX11/src/Tensor/TensorBroadcasting.h | 19 ++---- .../Eigen/CXX11/src/Tensor/TensorChipping.h | 18 ++---- .../CXX11/src/Tensor/TensorConcatenation.h | 18 +++--- .../CXX11/src/Tensor/TensorContraction.h | 13 ++-- .../Eigen/CXX11/src/Tensor/TensorConversion.h | 14 ++--- .../CXX11/src/Tensor/TensorConvolution.h | 14 ++--- .../Eigen/CXX11/src/Tensor/TensorCostModel.h | 15 +++-- .../Eigen/CXX11/src/Tensor/TensorCustomOp.h | 14 ++--- .../Eigen/CXX11/src/Tensor/TensorDevice.h | 26 ++++---- .../CXX11/src/Tensor/TensorDimensionList.h | 22 +++---- .../Eigen/CXX11/src/Tensor/TensorDimensions.h | 43 +++++++------ .../Eigen/CXX11/src/Tensor/TensorEvalTo.h | 7 --- .../Eigen/CXX11/src/Tensor/TensorEvaluator.h | 26 ++++---- .../Eigen/CXX11/src/Tensor/TensorExecutor.h | 6 +- .../Eigen/CXX11/src/Tensor/TensorExpr.h | 63 ++++++++++--------- .../Eigen/CXX11/src/Tensor/TensorFFT.h | 24 +++---- .../Eigen/CXX11/src/Tensor/TensorFixedSize.h | 4 +- .../Eigen/CXX11/src/Tensor/TensorForcedEval.h | 13 ++-- .../Eigen/CXX11/src/Tensor/TensorGenerator.h | 21 +++---- .../Eigen/CXX11/src/Tensor/TensorImagePatch.h | 35 +++++------ .../Eigen/CXX11/src/Tensor/TensorIndexList.h | 59 ++++++++++------- .../Eigen/CXX11/src/Tensor/TensorInflation.h | 19 +++--- .../CXX11/src/Tensor/TensorInitializer.h | 10 +-- .../Eigen/CXX11/src/Tensor/TensorIntDiv.h | 24 ++++--- .../Eigen/CXX11/src/Tensor/TensorLayoutSwap.h | 51 +++++++-------- .../Eigen/CXX11/src/Tensor/TensorMap.h | 12 ++-- .../Eigen/CXX11/src/Tensor/TensorMorphing.h | 19 +++--- .../Eigen/CXX11/src/Tensor/TensorPadding.h | 23 +++---- .../Eigen/CXX11/src/Tensor/TensorPatch.h | 21 +++---- .../Eigen/CXX11/src/Tensor/TensorReduction.h | 16 +++-- .../Eigen/CXX11/src/Tensor/TensorReverse.h | 22 +++---- .../Eigen/CXX11/src/Tensor/TensorScan.h | 10 +-- .../Eigen/CXX11/src/Tensor/TensorShuffling.h | 19 +++--- .../Eigen/CXX11/src/Tensor/TensorStorage.h | 25 ++++---- .../Eigen/CXX11/src/Tensor/TensorStriding.h | 19 +++--- .../CXX11/src/Tensor/TensorVolumePatch.h | 37 ++++++----- 38 files changed, 384 insertions(+), 454 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h index d06f40cd8..2ca469da5 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h @@ -14,13 +14,6 @@ namespace Eigen { namespace internal { -/** \class TensorIndexTuple - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor + Index Tuple class. - * - * - */ template struct traits > : public traits { @@ -49,6 +42,13 @@ struct nested, 1, } // end namespace internal +/** \class TensorIndexTuple + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor + Index Tuple class. + * + * + */ template class TensorIndexTupleOp : public TensorBase, ReadOnlyAccessors> { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h b/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h index 166be200c..a06702a63 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h @@ -12,14 +12,6 @@ namespace Eigen { -/** \class TensorAssign - * \ingroup CXX11_Tensor_Module - * - * \brief The tensor assignment class. - * - * This class is represents the assignment of the values resulting from the evaluation of - * the rhs expression to the memory locations denoted by the lhs expression. - */ namespace internal { template struct traits > @@ -54,12 +46,15 @@ struct nested, 1, typename eval -class TensorAssignOp : public TensorBase > -{ - public: +/** The tensor assignment class. + * \ingroup CXX11_Tensor_Module + * + * This class is represents the assignment of the values resulting from the evaluation of + * the rhs expression to the memory locations denoted by the lhs expression. + */ +template +class TensorAssignOp : public TensorBase > { + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename LhsXprType::CoeffReturnType CoeffReturnType; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h index 4cfe300eb..6fe193cfe 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorBroadcasting - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor broadcasting class. - * - * - */ namespace internal { template struct traits > : public traits @@ -62,12 +55,12 @@ struct is_input_scalar > { } // end namespace internal - - -template -class TensorBroadcastingOp : public TensorBase, ReadOnlyAccessors> -{ - public: +/** Tensor broadcasting class. + * \ingroup CXX11_Tensor_Module + */ +template +class TensorBroadcastingOp : public TensorBase, ReadOnlyAccessors> { + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h index 1ba7ef170..996b8ea86 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h @@ -12,14 +12,6 @@ namespace Eigen { -/** \class TensorKChippingReshaping - * \ingroup CXX11_Tensor_Module - * - * \brief A chip is a thin slice, corresponding to a column or a row in a 2-d tensor. - * - * - */ - namespace internal { template struct traits > : public traits @@ -72,11 +64,11 @@ struct DimensionId } // end namespace internal - - -template -class TensorChippingOp : public TensorBase > -{ +/** A chip is a thin slice, corresponding to a column or a row in a 2-d tensor. + * \ingroup CXX11_Tensor_Module + */ +template +class TensorChippingOp : public TensorBase > { public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h index 59bf90d93..2f4808e59 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorConcatenationOp - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor concatenation class. - * - * - */ namespace internal { template struct traits > @@ -53,10 +46,13 @@ struct nested, 1, typename e } // end namespace internal - -template -class TensorConcatenationOp : public TensorBase, WriteAccessors> -{ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor concatenation class. + */ +template +class TensorConcatenationOp : public TensorBase, WriteAccessors> { public: typedef typename internal::traits::Scalar Scalar; typedef typename internal::traits::StorageKind StorageKind; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h index 20b29e5fd..76e44c900 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorContraction - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor contraction class. - * - * - */ namespace internal { template @@ -71,6 +64,12 @@ struct traits class TensorContractionOp : public TensorBase, ReadOnlyAccessors> { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h index 860a6949a..a55befadd 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorConversionOp - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor conversion class. This class makes it possible to vectorize - * type casting operations when the number of scalars per packet in the source - * and the destination type differ - */ namespace internal { template struct traits > @@ -141,6 +134,13 @@ struct PacketConverter { const typename TensorEvaluator::Index m_maxIndex; }; +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor conversion class. This class makes it possible to vectorize + * type casting operations when the number of scalars per packet in the source + * and the destination type differ + */ template class TensorConversionOp : public TensorBase, ReadOnlyAccessors> { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h index abdf742c6..47089e75a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorConvolution - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor convolution class. - * - * - */ namespace internal { template @@ -251,9 +244,10 @@ struct nested, 1, t } // end namespace internal - - -template +/** Tensor convolution class. + * \ingroup CXX11_Tensor_Module + */ +template class TensorConvolutionOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h b/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h index 83c449cf1..889e4ad9a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h @@ -12,14 +12,6 @@ namespace Eigen { -/** \class TensorEvaluator - * \ingroup CXX11_Tensor_Module - * - * \brief A cost model used to limit the number of threads used for evaluating - * tensor expression. - * - */ - // Class storing the cost of evaluating a tensor expression in terms of the // estimated number of operand bytes loads, bytes stored, and compute cycles. class TensorOpCost { @@ -157,6 +149,13 @@ class TensorOpCost { // TODO(rmlarsen): Implement a policy that chooses an "optimal" number of theads // in [1:max_threads] instead of just switching multi-threading off for small // work units. +/** + * \ingroup CXX11_Tensor_Module + * + * \brief A cost model used to limit the number of threads used for evaluating + * tensor expression. + * + */ template class TensorCostModel { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h b/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h index e020d076f..216c53e7e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorCustomUnaryOp - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor custom class. - * - * - */ namespace internal { template struct traits > @@ -46,8 +39,11 @@ struct nested > } // end namespace internal - - +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor custom class. + */ template class TensorCustomUnaryOp : public TensorBase, ReadOnlyAccessors> { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h index 29e50a3b2..c79c317f2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h @@ -12,19 +12,19 @@ namespace Eigen { -/** \class TensorDevice - * \ingroup CXX11_Tensor_Module - * - * \brief Pseudo expression providing an operator = that will evaluate its argument - * on the specified computing 'device' (GPU, thread pool, ...) - * - * Example: - * C.device(EIGEN_GPU) = A + B; - * - * Todo: operator *= and /=. - */ - -template class TensorDevice { +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Pseudo expression providing an operator = that will evaluate its argument + * on the specified computing 'device' (GPU, thread pool, ...) + * + * Example: + * C.device(EIGEN_GPU) = A + B; + * + * Todo: operator *= and /=. + */ +template +class TensorDevice { public: TensorDevice(const DeviceType& device, ExpressionType& expression) : m_device(device), m_expression(expression) {} diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h index 1a30e45fb..732865916 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h @@ -13,18 +13,16 @@ namespace Eigen { /** \internal - * - * \class TensorDimensionList - * \ingroup CXX11_Tensor_Module - * - * \brief Special case of tensor index list used to list all the dimensions of a tensor of rank n. - * - * \sa Tensor - */ - -template struct DimensionList { - EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE - const Index operator[] (const Index i) const { return i; } + * + * \ingroup CXX11_Tensor_Module + * + * \brief Special case of tensor index list used to list all the dimensions of a tensor of rank n. + * + * \sa Tensor + */ +template +struct DimensionList { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const Index operator[](const Index i) const { return i; } }; namespace internal { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h index 451940de3..1731a66f4 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h @@ -13,22 +13,6 @@ namespace Eigen { -/** \internal - * - * \class TensorDimensions - * \ingroup CXX11_Tensor_Module - * - * \brief Set of classes used to encode and store the dimensions of a Tensor. - * - * The Sizes class encodes as part of the type the number of dimensions and the - * sizes corresponding to each dimension. It uses no storage space since it is - * entirely known at compile time. - * The DSizes class is its dynamic sibling: the number of dimensions is known - * at compile time but the sizes are set during execution. - * - * \sa Tensor - */ - // Boilerplate code namespace internal { @@ -87,8 +71,19 @@ struct fixed_size_tensor_index_extraction_helper } // end namespace internal -// Fixed size #ifndef EIGEN_EMULATE_CXX11_META_H +/** \internal + * + * \ingroup CXX11_Tensor_Module + * + * \brief Fixed dimensions of a Tensor. + * + * The Sizes class encodes as part of the type the number of dimensions and the + * sizes corresponding to each dimension. It uses no storage space since it is + * entirely known at compile time. + * + * \sa Tensor + */ template struct Sizes : internal::numeric_list { typedef internal::numeric_list Base; @@ -254,9 +249,17 @@ struct tensor_index_linearization_helper }; } // end namespace internal - - -// Dynamic size +/** \internal + * + * \ingroup CXX11_Tensor_Module + * + * \brief Dynamic dimensions of a Tensor. + * + * The DSizes class is its dynamic sibling: the number of dimensions is known + * at compile time but the sizes are set during execution. + * + * \sa Tensor + */ template struct DSizes : array { typedef array Base; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h b/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h index 06987132b..38f79b054 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorForcedEval - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor reshaping class. - * - * - */ namespace internal { template class MakePointer_> struct traits > diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h index 834ce07df..5a7fe8e85 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h @@ -12,21 +12,19 @@ namespace Eigen { -/** \class TensorEvaluator - * \ingroup CXX11_Tensor_Module - * - * \brief The tensor evaluator classes. - * - * These classes are responsible for the evaluation of the tensor expression. - * - * TODO: add support for more types of expressions, in particular expressions - * leading to lvalues (slicing, reshaping, etc...) - */ - // Generic evaluator -template -struct TensorEvaluator -{ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief The tensor evaluator class. + * + * These classes are responsible for the evaluation of the tensor expression. + * + * TODO: add support for more types of expressions, in particular expressions + * leading to lvalues (slicing, reshaping, etc...) + */ +template +struct TensorEvaluator { typedef typename Derived::Index Index; typedef typename Derived::Scalar Scalar; typedef typename Derived::Scalar CoeffReturnType; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h index f01d77c0a..55667b161 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h @@ -12,6 +12,9 @@ namespace Eigen { +namespace internal { + +// Default strategy: the expression is evaluated with a single cpu thread. /** \class TensorExecutor * \ingroup CXX11_Tensor_Module * @@ -20,9 +23,6 @@ namespace Eigen { * This class is responsible for launch the evaluation of the expression on * the specified computing device. */ -namespace internal { - -// Default strategy: the expression is evaluated with a single cpu thread. template class TensorExecutor { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h index 85dfc7a69..06958317e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h @@ -12,21 +12,6 @@ namespace Eigen { -/** \class TensorExpr - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor expression classes. - * - * The TensorCwiseNullaryOp class applies a nullary operators to an expression. - * This is typically used to generate constants. - * - * The TensorCwiseUnaryOp class represents an expression where a unary operator - * (e.g. cwiseSqrt) is applied to an expression. - * - * The TensorCwiseBinaryOp class represents an expression where a binary - * operator (e.g. addition) is applied to a lhs and a rhs expression. - * - */ namespace internal { template struct traits > @@ -46,11 +31,16 @@ struct traits > } // end namespace internal - - -template -class TensorCwiseNullaryOp : public TensorBase, ReadOnlyAccessors> -{ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor nullary expression. + * + * The TensorCwiseNullaryOp class applies a nullary operators to an expression. + * This is typically used to generate constants. + */ +template +class TensorCwiseNullaryOp : public TensorBase, ReadOnlyAccessors> { public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; @@ -105,11 +95,16 @@ struct nested, 1, typename eval -class TensorCwiseUnaryOp : public TensorBase, ReadOnlyAccessors> -{ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor unary expression. + * + * The TensorCwiseUnaryOp class represents an expression where a unary operator + * (e.g. cwiseSqrt) is applied to an expression. + */ +template +class TensorCwiseUnaryOp : public TensorBase, ReadOnlyAccessors> { public: // TODO(phli): Add InputScalar, InputPacket. Check references to // current Scalar/Packet to see if the intent is Input or Output. @@ -181,12 +176,18 @@ struct nested, 1, typename } // end namespace internal - - -template -class TensorCwiseBinaryOp : public TensorBase, ReadOnlyAccessors> -{ - public: +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor binary expression. + * + * The TensorCwiseBinaryOp class represents an expression where a binary + * operator (e.g. addition) is applied to a lhs and a rhs expression. + */ +template +class TensorCwiseBinaryOp + : public TensorBase, ReadOnlyAccessors> { + public: // TODO(phli): Add Lhs/RhsScalar, Lhs/RhsPacket. Check references to // current Scalar/Packet to see if the intent is Inputs or Output. typedef typename Eigen::internal::traits::Scalar Scalar; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h index 08eb5595a..57cb0466d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h @@ -16,18 +16,8 @@ namespace Eigen { -/** \class TensorFFT - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor FFT class. - * - * TODO: - * Vectorize the Cooley Tukey and the Bluestein algorithm - * Add support for multithreaded evaluation - * Improve the performance on GPU - */ - -template struct MakeComplex { +template +struct MakeComplex { template EIGEN_DEVICE_FUNC T operator() (const T& val) const { return val; } @@ -85,6 +75,16 @@ struct nested, 1, typenam } // end namespace internal +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor FFT class. + * + * TODO: + * Vectorize the Cooley Tukey and the Bluestein algorithm + * Add support for multithreaded evaluation + * Improve the performance on GPU + */ template class TensorFFTOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h index fcee5f60d..0b7834c9e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h @@ -12,8 +12,7 @@ namespace Eigen { -/** \class TensorFixedSize - * \ingroup CXX11_Tensor_Module +/** \ingroup CXX11_Tensor_Module * * \brief The fixed sized version of the tensor class. * @@ -22,7 +21,6 @@ namespace Eigen { * is * Eigen::TensorFixedSize> t; */ - template class TensorFixedSize : public TensorBase > { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h index 8bece4e65..f8a7f4df7 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h @@ -54,6 +54,13 @@ struct nested, 1, typename eval class MakePointer_` is added to convert the host pointer to the device pointer. +/// It is added due to the fact that for our device compiler `T*` is not allowed. +/// If we wanted to use the same Evaluator functions we have to convert that type to our pointer `T`. +/// This is done through our `MakePointer_` class. By default the Type in the `MakePointer_` is `T*` . +/// Therefore, by adding the default value, we managed to convert the type and it does not break any +/// existing code as its default value is `T*`. + /** \class TensorForcedEvalOp * \ingroup CXX11_Tensor_Module * @@ -61,12 +68,6 @@ struct nested, 1, typename eval class MakePointer_` is added to convert the host pointer to the device pointer. -/// It is added due to the fact that for our device compiler `T*` is not allowed. -/// If we wanted to use the same Evaluator functions we have to convert that type to our pointer `T`. -/// This is done through our `MakePointer_` class. By default the Type in the `MakePointer_` is `T*` . -/// Therefore, by adding the default value, we managed to convert the type and it does not break any -/// existing code as its default value is `T*`. template class MakePointer_> class TensorForcedEvalOp : public TensorBase, ReadOnlyAccessors> { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h index e27753b19..3a3055a43 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorGeneratorOp - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor generator class. - * - * - */ namespace internal { template struct traits > : public traits @@ -47,12 +40,14 @@ struct nested, 1, typename eval -class TensorGeneratorOp : public TensorBase, ReadOnlyAccessors> -{ - public: +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor generator class. + */ +template +class TensorGeneratorOp : public TensorBase, ReadOnlyAccessors> { + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h index 566856ed2..138a7ae4e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h @@ -12,20 +12,6 @@ namespace Eigen { -/** \class TensorImagePatch - * \ingroup CXX11_Tensor_Module - * - * \brief Patch extraction specialized for image processing. - * This assumes that the input has a least 3 dimensions ordered as follow: - * 1st dimension: channels (of size d) - * 2nd dimension: rows (of size r) - * 3rd dimension: columns (of size c) - * There can be additional dimensions such as time (for video) or batch (for - * bulk processing after the first 3. - * Calling the image patch code with patch_rows and patch_cols is equivalent - * to calling the regular patch extraction code with parameters d, patch_rows, - * patch_cols, and 1 for all the additional dimensions. - */ namespace internal { template struct traits > : public traits @@ -54,10 +40,23 @@ struct nested, 1, typename eval -class TensorImagePatchOp : public TensorBase, ReadOnlyAccessors> -{ - public: +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Patch extraction specialized for image processing. + * This assumes that the input has a least 3 dimensions ordered as follow: + * 1st dimension: channels (of size d) + * 2nd dimension: rows (of size r) + * 3rd dimension: columns (of size c) + * There can be additional dimensions such as time (for video) or batch (for + * bulk processing after the first 3. + * Calling the image patch code with patch_rows and patch_cols is equivalent + * to calling the regular patch extraction code with parameters d, patch_rows, + * patch_cols, and 1 for all the additional dimensions. + */ +template +class TensorImagePatchOp : public TensorBase, ReadOnlyAccessors> { + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h index 3209fecd3..62452be52 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h @@ -17,26 +17,6 @@ namespace Eigen { -/** \internal - * - * \class TensorIndexList - * \ingroup CXX11_Tensor_Module - * - * \brief Set of classes used to encode a set of Tensor dimensions/indices. - * - * The indices in the list can be known at compile time or at runtime. A mix - * of static and dynamic indices can also be provided if needed. The tensor - * code will attempt to take advantage of the indices that are known at - * compile time to optimize the code it generates. - * - * This functionality requires a c++11 compliant compiler. If your compiler - * is older you need to use arrays of indices instead. - * - * Several examples are provided in the cxx11_tensor_index_list.cpp file. - * - * \sa Tensor - */ - template struct type2index { static const DenseIndex value = n; @@ -294,9 +274,44 @@ struct tuple_coeff<0, ValueT> { }; } // namespace internal +/** \internal + * + * \ingroup CXX11_Tensor_Module + * + * \brief Set of classes used to encode a set of Tensor dimensions/indices. + * + * The indices in the list can be known at compile time or at runtime. A mix + * of static and dynamic indices can also be provided if needed. The tensor + * code will attempt to take advantage of the indices that are known at + * compile time to optimize the code it generates. + * + * This functionality requires a c++11 compliant compiler. If your compiler + * is older you need to use arrays of indices instead. + * + * Several examples are provided in the cxx11_tensor_index_list.cpp file. + * + * \sa Tensor + */ - -template + /** \internal + * + * \ingroup CXX11_Tensor_Module + * + * \brief Set of classes used to encode a set of Tensor dimensions/indices. + * + * The indices in the list can be known at compile time or at runtime. A mix + * of static and dynamic indices can also be provided if needed. The tensor + * code will attempt to take advantage of the indices that are known at + * compile time to optimize the code it generates. + * + * This functionality requires a c++11 compliant compiler. If your compiler + * is older you need to use arrays of indices instead. + * + * Several examples are provided in the cxx11_tensor_index_list.cpp file. + * + * \sa Tensor + */ +template struct IndexList : internal::IndexTuple { EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr DenseIndex operator[] (const DenseIndex i) const { return internal::tuple_coeff >::value-1, DenseIndex>::get(i, *this); diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h b/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h index f391fb9ee..0c297140a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorInflation - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor inflation class. - * - * - */ namespace internal { template struct traits > : public traits @@ -47,10 +40,14 @@ struct nested, 1, typename eval -class TensorInflationOp : public TensorBase, ReadOnlyAccessors> -{ - public: +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor inflation class. + */ +template +class TensorInflationOp : public TensorBase, ReadOnlyAccessors> { + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h b/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h index 33edc49e3..feca2706d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h @@ -16,13 +16,13 @@ namespace Eigen { -/** \class TensorInitializer - * \ingroup CXX11_Tensor_Module - * - * \brief Helper template to initialize Tensors from std::initializer_lists. - */ namespace internal { +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Helper template to initialize Tensors from std::initializer_lists. + */ template struct Initializer { typedef std::initializer_list< diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h index ede3939c2..385582795 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h @@ -13,19 +13,6 @@ namespace Eigen { -/** \internal - * - * \class TensorIntDiv - * \ingroup CXX11_Tensor_Module - * - * \brief Fast integer division by a constant. - * - * See the paper from Granlund and Montgomery for explanation. - * (at http://dx.doi.org/10.1145/773473.178249) - * - * \sa Tensor - */ - namespace internal { namespace { @@ -130,6 +117,17 @@ namespace { } +/** \internal + * + * \ingroup CXX11_Tensor_Module + * + * \brief Fast integer division by a constant. + * + * See the paper from Granlund and Montgomery for explanation. + * (at https://doi.org/10.1145/773473.178249) + * + * \sa Tensor + */ template struct TensorIntDivisor { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h b/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h index cd0109ef4..8f74c3ecc 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h @@ -12,28 +12,6 @@ namespace Eigen { -/** \class TensorLayoutSwap - * \ingroup CXX11_Tensor_Module - * - * \brief Swap the layout from col-major to row-major, or row-major - * to col-major, and invert the order of the dimensions. - * - * Beware: the dimensions are reversed by this operation. If you want to - * preserve the ordering of the dimensions, you need to combine this - * operation with a shuffle. - * - * \example: - * Tensor input(2, 4); - * Tensor output = input.swap_layout(); - * eigen_assert(output.dimension(0) == 4); - * eigen_assert(output.dimension(1) == 2); - * - * array shuffle(1, 0); - * output = input.swap_layout().shuffle(shuffle); - * eigen_assert(output.dimension(0) == 2); - * eigen_assert(output.dimension(1) == 4); - * - */ namespace internal { template struct traits > : public traits @@ -62,11 +40,30 @@ struct nested, 1, typename eval -class TensorLayoutSwapOp : public TensorBase, WriteAccessors> -{ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Swap the layout from col-major to row-major, or row-major + * to col-major, and invert the order of the dimensions. + * + * Beware: the dimensions are reversed by this operation. If you want to + * preserve the ordering of the dimensions, you need to combine this + * operation with a shuffle. + * + * \example: + * Tensor input(2, 4); + * Tensor output = input.swap_layout(); + * eigen_assert(output.dimension(0) == 4); + * eigen_assert(output.dimension(1) == 2); + * + * array shuffle(1, 0); + * output = input.swap_layout().shuffle(shuffle); + * eigen_assert(output.dimension(0) == 2); + * eigen_assert(output.dimension(1) == 4); + * + */ +template +class TensorLayoutSwapOp : public TensorBase, WriteAccessors> { public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h index e4fc86a40..5e1d966bf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h @@ -14,12 +14,12 @@ namespace Eigen { // FIXME use proper doxygen documentation (e.g. \tparam MakePointer_) -/** \class TensorMap - * \ingroup CXX11_Tensor_Module - * - * \brief A tensor expression mapping an existing array of data. - * - */ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief A tensor expression mapping an existing array of data. + * + */ /// `template class MakePointer_` is added to convert the host pointer to the device pointer. /// It is added due to the fact that for our device compiler `T*` is not allowed. /// If we wanted to use the same Evaluator functions we have to convert that type to our pointer `T`. diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h index d34f1e328..0b7616db4 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorReshaping - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor reshaping class. - * - * - */ namespace internal { template struct traits > : public traits @@ -47,12 +40,16 @@ struct nested, 1, typename eval +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor reshaping class. + */ +template class TensorReshapingOp : public TensorBase, WriteAccessors> { - public: + public: + typedef TensorBase, WriteAccessors> Base; typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename internal::remove_const::type CoeffReturnType; typedef typename Eigen::internal::nested::type Nested; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h index 647bcf108..ef53395ae 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorPadding - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor padding class. - * At the moment only padding with a constant value is supported. - * - */ namespace internal { template struct traits > : public traits @@ -47,12 +40,16 @@ struct nested, 1, typename eval -class TensorPaddingOp : public TensorBase, ReadOnlyAccessors> -{ - public: +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor padding class. + * At the moment only padding with a constant value is supported. + * + */ +template +class TensorPaddingOp : public TensorBase, ReadOnlyAccessors> { + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h index 886a254f6..3235cb8b9 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorPatch - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor patch class. - * - * - */ namespace internal { template struct traits > : public traits @@ -47,12 +40,14 @@ struct nested, 1, typename eval -class TensorPatchOp : public TensorBase, ReadOnlyAccessors> -{ - public: +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor patch class. + */ +template +class TensorPatchOp : public TensorBase, ReadOnlyAccessors> { + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h index 41d0d0022..172a8b5ca 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h @@ -13,13 +13,6 @@ namespace Eigen { -/** \class TensorReduction - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor reduction class. - * - */ - namespace internal { template class MakePointer_ > struct traits > @@ -345,8 +338,13 @@ __global__ void OuterReductionKernel(R, const S, I, I, typename S::CoeffReturnTy } // end namespace internal - -template class MakePointer_> +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor reduction class. + * + */ +template class MakePointer_> class TensorReductionOp : public TensorBase, ReadOnlyAccessors> { public: typedef typename Eigen::internal::traits::Scalar Scalar; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h index 14e392e36..442c32d4f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h @@ -12,12 +12,6 @@ #define EIGEN_CXX11_TENSOR_TENSOR_REVERSE_H namespace Eigen { -/** \class TensorReverse - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor reverse elements class. - * - */ namespace internal { template struct traits, 1, } // end namespace internal -template -class TensorReverseOp : public TensorBase, WriteAccessors> +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor reverse elements class. + * + */ +template +class TensorReverseOp : public TensorBase, WriteAccessors> { - public: + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename Eigen::internal::nested::type Nested; - typedef typename Eigen::internal::traits::StorageKind - StorageKind; + typedef typename Eigen::internal::traits::StorageKind StorageKind; typedef typename Eigen::internal::traits::Index Index; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReverseOp( diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h b/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h index 8501466ce..3ab6476c0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h @@ -40,11 +40,11 @@ struct nested, 1, }; } // end namespace internal -/** \class TensorScan - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor scan class. - */ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor scan class. + */ template class TensorScanOp : public TensorBase, ReadOnlyAccessors> { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h index 113c060e3..d8f241148 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorShuffling - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor shuffling class. - * - * - */ namespace internal { template struct traits > : public traits @@ -47,11 +40,13 @@ struct nested, 1, typename eval -class TensorShufflingOp : public TensorBase > -{ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor shuffling class. + */ +template +class TensorShufflingOp : public TensorBase > { public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h index e6a666f78..e64ce6352 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h @@ -20,19 +20,18 @@ namespace Eigen { /** \internal - * - * \class TensorStorage - * \ingroup CXX11_Tensor_Module - * - * \brief Stores the data of a tensor - * - * This class stores the data of fixed-size, dynamic-size or mixed tensors - * in a way as compact as possible. - * - * \sa Tensor - */ -template class TensorStorage; - + * + * \ingroup CXX11_Tensor_Module + * + * \brief Stores the data of a tensor + * + * This class stores the data of fixed-size, dynamic-size or mixed tensors + * in a way as compact as possible. + * + * \sa Tensor + */ +template +class TensorStorage; // Pure fixed-size storage template diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h index 6c35bfdb6..047d6fbe2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h @@ -12,13 +12,6 @@ namespace Eigen { -/** \class TensorStriding - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor striding class. - * - * - */ namespace internal { template struct traits > : public traits @@ -47,11 +40,13 @@ struct nested, 1, typename eval -class TensorStridingOp : public TensorBase > -{ +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor striding class. + */ +template +class TensorStridingOp : public TensorBase > { public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h index 0ca2cac84..11fad0ef0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h @@ -6,21 +6,6 @@ namespace Eigen { -/** \class TensorVolumePatch - * \ingroup CXX11_Tensor_Module - * - * \brief Patch extraction specialized for processing of volumetric data. - * This assumes that the input has a least 4 dimensions ordered as follows: - * - channels - * - planes - * - rows - * - columns - * - (optional) additional dimensions such as time or batch size. - * Calling the volume patch code with patch_planes, patch_rows, and patch_cols - * is equivalent to calling the regular patch extraction code with parameters - * d, patch_planes, patch_rows, patch_cols, and 1 for all the additional - * dimensions. - */ namespace internal { template struct traits > : public traits @@ -49,10 +34,24 @@ struct nested, 1, typename eval } // end namespace internal -template -class TensorVolumePatchOp : public TensorBase, ReadOnlyAccessors> -{ - public: +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Patch extraction specialized for processing of volumetric data. + * This assumes that the input has a least 4 dimensions ordered as follows: + * - channels + * - planes + * - rows + * - columns + * - (optional) additional dimensions such as time or batch size. + * Calling the volume patch code with patch_planes, patch_rows, and patch_cols + * is equivalent to calling the regular patch extraction code with parameters + * d, patch_planes, patch_rows, patch_cols, and 1 for all the additional + * dimensions. + */ +template +class TensorVolumePatchOp : public TensorBase, ReadOnlyAccessors> { + public: typedef typename Eigen::internal::traits::Scalar Scalar; typedef typename Eigen::NumTraits::Real RealScalar; typedef typename XprType::CoeffReturnType CoeffReturnType;