From c079ee5e44f770c67f135e340dcbd5b59012e4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Wed, 5 Feb 2025 17:36:00 +0000 Subject: [PATCH] Fix tensor documentation. --- .../Eigen/CXX11/src/Tensor/TensorArgMax.h | 12 +++-- .../Eigen/CXX11/src/Tensor/TensorAssign.h | 14 +++--- .../CXX11/src/Tensor/TensorBroadcasting.h | 10 ++--- .../Eigen/CXX11/src/Tensor/TensorChipping.h | 11 ++--- .../CXX11/src/Tensor/TensorConcatenation.h | 12 +++-- .../CXX11/src/Tensor/TensorContraction.h | 10 ++--- .../Eigen/CXX11/src/Tensor/TensorConversion.h | 14 +++--- .../CXX11/src/Tensor/TensorConvolution.h | 10 ++--- .../CXX11/src/Tensor/TensorConvolutionSycl.h | 8 ---- .../Eigen/CXX11/src/Tensor/TensorCostModel.h | 15 +++---- .../Eigen/CXX11/src/Tensor/TensorCustomOp.h | 12 +++-- .../Eigen/CXX11/src/Tensor/TensorDevice.h | 3 +- .../CXX11/src/Tensor/TensorDimensionList.h | 2 - .../Eigen/CXX11/src/Tensor/TensorDimensions.h | 41 +++++++++-------- .../Eigen/CXX11/src/Tensor/TensorEvalTo.h | 7 --- .../Eigen/CXX11/src/Tensor/TensorEvaluator.h | 7 ++- .../Eigen/CXX11/src/Tensor/TensorExecutor.h | 26 +++++------ .../Eigen/CXX11/src/Tensor/TensorExpr.h | 39 +++++++++------- .../Eigen/CXX11/src/Tensor/TensorFFT.h | 21 +++++---- .../Eigen/CXX11/src/Tensor/TensorFixedSize.h | 3 +- .../Eigen/CXX11/src/Tensor/TensorForcedEval.h | 12 +++-- .../Eigen/CXX11/src/Tensor/TensorGenerator.h | 12 +++-- .../Eigen/CXX11/src/Tensor/TensorImagePatch.h | 28 ++++++------ .../Eigen/CXX11/src/Tensor/TensorIndexList.h | 39 ++++++++-------- .../Eigen/CXX11/src/Tensor/TensorInflation.h | 12 +++-- .../CXX11/src/Tensor/TensorInitializer.h | 6 +-- .../Eigen/CXX11/src/Tensor/TensorIntDiv.h | 24 +++++----- .../Eigen/CXX11/src/Tensor/TensorLayoutSwap.h | 44 +++++++++---------- .../Eigen/CXX11/src/Tensor/TensorMap.h | 2 +- .../Eigen/CXX11/src/Tensor/TensorMorphing.h | 12 +++-- .../Eigen/CXX11/src/Tensor/TensorPadding.h | 14 +++--- .../Eigen/CXX11/src/Tensor/TensorPatch.h | 12 +++-- .../Eigen/CXX11/src/Tensor/TensorReduction.h | 13 +++--- .../Eigen/CXX11/src/Tensor/TensorReverse.h | 12 ++--- .../Eigen/CXX11/src/Tensor/TensorRoll.h | 12 ++--- .../Eigen/CXX11/src/Tensor/TensorScan.h | 2 +- .../Eigen/CXX11/src/Tensor/TensorShuffling.h | 12 +++-- .../Eigen/CXX11/src/Tensor/TensorStorage.h | 1 - .../Eigen/CXX11/src/Tensor/TensorStriding.h | 12 +++-- .../Eigen/CXX11/src/Tensor/TensorTrace.h | 13 +++--- .../CXX11/src/Tensor/TensorVolumePatch.h | 30 ++++++------- 41 files changed, 272 insertions(+), 329 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h index f272354c4..3f9866aca 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h @@ -17,13 +17,6 @@ namespace Eigen { namespace internal { -/** \class TensorIndexPair - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor + Index Pair class. - * - * - */ template struct traits> : public traits { typedef traits XprTraits; @@ -48,6 +41,11 @@ struct nested, 1, typename eval class TensorIndexPairOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h b/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h index 8a57576b7..37d914e27 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h @@ -15,14 +15,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 > { @@ -53,6 +45,12 @@ struct nested, 1, typename eval class TensorAssignOp : public TensorBase > { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h index 9ef4bbce0..2a59530a1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorBroadcasting - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor broadcasting class. - * - * - */ namespace internal { template struct traits> : public traits { @@ -62,6 +55,9 @@ struct is_input_scalar> { } // end namespace internal +/** Tensor broadcasting class. + * \ingroup CXX11_Tensor_Module + */ template class TensorBroadcastingOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h index 5db563d60..977f96fe0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h @@ -15,14 +15,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 { @@ -66,6 +58,9 @@ struct DimensionId { } // end namespace internal +/** 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: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h index e9c130dce..0203f01e3 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorConcatenationOp - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor concatenation class. - * - * - */ namespace internal { template struct traits > { @@ -56,6 +49,11 @@ struct nested, 1, } // end namespace internal +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor concatenation class. + */ template class TensorConcatenationOp : public TensorBase, WriteAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h index 6f1c9744e..283ea6db5 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorContraction - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor contraction class. - * - * - */ namespace internal { template @@ -301,6 +294,9 @@ struct NoOpOutputKernel { } }; +/** Tensor contraction class. + * \ingroup CXX11_Tensor_Module + */ template class TensorContractionOp diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h index 5e4a586d8..ccf96b705 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h @@ -15,13 +15,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 > { @@ -162,6 +155,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> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h index 26984b690..016498f0e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorConvolution - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor convolution class. - * - * - */ namespace internal { template @@ -231,6 +224,9 @@ struct nested, 1, } // end namespace internal +/** Tensor convolution class. + * \ingroup CXX11_Tensor_Module + */ template class TensorConvolutionOp : public TensorBase, ReadOnlyAccessors> { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h index 88ae9f4bb..915c5de48 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h @@ -20,14 +20,6 @@ namespace Eigen { -/** \class TensorConvolution - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor convolution class. - * - * - */ - enum class convolution_type { CONV1D, CONV2D, CONV3D }; template diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h b/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h index c0f13337a..88e36dc51 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h @@ -15,14 +15,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 { @@ -137,6 +129,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 c8e1df733..1cae60f27 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorCustomUnaryOp - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor custom class. - * - * - */ namespace internal { template struct traits > { @@ -47,6 +40,11 @@ struct nested > { } // end namespace internal +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor custom class. + */ template class TensorCustomUnaryOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h index 9898fdcfb..1b9b49e11 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h @@ -15,7 +15,7 @@ namespace Eigen { -/** \class TensorDevice +/** * \ingroup CXX11_Tensor_Module * * \brief Pseudo expression providing an operator = that will evaluate its argument @@ -26,7 +26,6 @@ namespace Eigen { * * Todo: operator *= and /=. */ - template class TensorDevice { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h index 315b556ae..8f2e5af63 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h @@ -17,14 +17,12 @@ 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; } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h index 06d4dfd30..e20052c92 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h @@ -15,22 +15,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 { @@ -80,7 +64,18 @@ struct fixed_size_tensor_index_extraction_helper { } // end namespace internal -// Fixed size +/** \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 { typedef internal::numeric_list Base; @@ -156,7 +151,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 8f1e4c4ba..9bc0eac98 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h @@ -15,13 +15,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 d864fb464..5544953e2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h @@ -15,18 +15,17 @@ namespace Eigen { -/** \class TensorEvaluator +// Generic evaluator +/** * \ingroup CXX11_Tensor_Module * - * \brief The tensor evaluator classes. + * \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...) */ - -// Generic evaluator template struct TensorEvaluator { typedef typename Derived::Index Index; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h index fe4b38c48..b1da1a5e6 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h @@ -15,20 +15,6 @@ namespace Eigen { -/** - * \class TensorExecutor - * \ingroup CXX11_Tensor_Module - * - * \brief The tensor executor class. - * - * This class is responsible for launch the evaluation of the expression on - * the specified computing device. - * - * @tparam Vectorizable can use packet math (SSE/AVX/etc... registers and - * instructions) - * @tparam Tiling can use block based tensor evaluation - * (see TensorBlock.h) - */ namespace internal { /** @@ -71,8 +57,20 @@ struct ExpressionHasTensorBroadcastingOp class TensorExecutor { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h b/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h index 5f4c72367..a0e558bac 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h @@ -15,21 +15,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 > : traits { @@ -45,6 +30,14 @@ struct traits > : traits { } // end namespace internal +/** + * \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: @@ -93,6 +86,14 @@ struct nested, 1, typename eval class TensorCwiseUnaryOp : public TensorBase, ReadOnlyAccessors> { public: @@ -157,6 +158,14 @@ struct nested, 1, } // end namespace internal +/** + * \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> { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h index 2671cc7e7..7521559aa 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h @@ -15,17 +15,6 @@ 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 @@ -105,6 +94,16 @@ struct nested, 1, } // 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 7f229cb06..753a25a82 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h @@ -15,7 +15,7 @@ namespace Eigen { -/** \class TensorFixedSize +/** * \ingroup CXX11_Tensor_Module * * \brief The fixed sized version of the tensor class. @@ -25,7 +25,6 @@ namespace Eigen { * is * Eigen::TensorFixedSize> t; */ - template class TensorFixedSize : public TensorBase > { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h index d0fbfb38a..dadccb324 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h @@ -17,13 +17,6 @@ namespace Eigen { -/** \class TensorForcedEval - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor reshaping class. - * - * - */ namespace internal { template struct traits> { @@ -53,6 +46,11 @@ struct nested, 1, typename eval class TensorForcedEvalOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h b/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h index b038eaf78..2dac3379c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorGeneratorOp - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor generator class. - * - * - */ namespace internal { template struct traits > : public traits { @@ -48,6 +41,11 @@ struct nested, 1, typename eval class TensorGeneratorOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h index 291301a81..8bd1c43d1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h @@ -15,20 +15,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 @@ -113,6 +99,20 @@ struct ImagePatchPaddingOp { } // end namespace internal +/** + * \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: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h index 69ab6840c..6a7571c48 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h @@ -15,26 +15,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 constexpr Index value = n; @@ -267,6 +247,25 @@ 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 struct IndexList : internal::IndexTuple { EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Index operator[](const Index i) const { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h b/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h index 5b0fca8b6..74a53be18 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorInflation - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor inflation class. - * - * - */ namespace internal { template struct traits > : public traits { @@ -48,6 +41,11 @@ struct nested, 1, typename eval class TensorInflationOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h b/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h index 85cf492a0..26cd50f70 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h @@ -17,13 +17,13 @@ namespace Eigen { -/** \class TensorInitializer +namespace internal { + +/** * \ingroup CXX11_Tensor_Module * * \brief Helper template to initialize Tensors from std::initializer_lists. */ -namespace internal { - template struct Initializer { typedef std::initializer_list::InitList> InitList; diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h index fddc64822..cd0468077 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h @@ -15,19 +15,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 https://doi.org/10.1145/773473.178249) - * - * \sa Tensor - */ - namespace internal { // Note: result is undefined if val == 0 @@ -136,6 +123,17 @@ struct DividerHelper<64, T> { } }; +/** \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 43f4bcb46..3ddcc1c5e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h @@ -15,28 +15,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 { @@ -63,6 +41,28 @@ struct nested, 1, typename eval 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: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h index 191413b7d..9abfddb4c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h @@ -17,7 +17,7 @@ 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. diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h index d790f35bb..3a697d3a3 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorReshaping - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor reshaping class. - * - * - */ namespace internal { template struct traits> : public traits { @@ -49,6 +42,11 @@ struct nested, 1, } // end namespace internal +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor reshaping class. + */ template class TensorReshapingOp : public TensorBase, WriteAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h index 0e8f54a80..7b2db491e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h @@ -15,13 +15,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 { @@ -49,6 +42,13 @@ struct nested, 1, } // end namespace internal +/** + * \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: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h index 7b33f1fe1..6e767a7f8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorPatch - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor patch class. - * - * - */ namespace internal { template struct traits > : public traits { @@ -48,6 +41,11 @@ struct nested, 1, typename eval class TensorPatchOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h index 2ecbb7c20..62c54e323 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h @@ -26,13 +26,6 @@ namespace Eigen { -/** \class TensorReduction - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor reduction class. - * - */ - namespace internal { template class MakePointer_> struct traits > : traits { @@ -506,6 +499,12 @@ struct ReductionReturnType { } // end namespace internal +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor reduction class. + * + */ template class MakePointer_> class TensorReductionOp : public TensorBase, ReadOnlyAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h index a81a2babf..4f167e7cf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h @@ -15,12 +15,6 @@ namespace Eigen { -/** \class TensorReverse - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor reverse elements class. - * - */ namespace internal { template struct traits > : public traits { @@ -48,6 +42,12 @@ struct nested, 1, } // end namespace internal +/** + * \ingroup CXX11_Tensor_Module + * + * \brief Tensor reverse elements class. + * + */ template class TensorReverseOp : public TensorBase, WriteAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorRoll.h b/unsupported/Eigen/CXX11/src/Tensor/TensorRoll.h index d5b203ab6..e4b5181c0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorRoll.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorRoll.h @@ -14,12 +14,6 @@ namespace Eigen { -/** \class TensorRoll - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor roll (circular shift) elements class. - * - */ namespace internal { template struct traits > : public traits { @@ -46,6 +40,12 @@ struct nested, 1, typename eval class TensorRollOp : public TensorBase, WriteAccessors> { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h b/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h index d16d1490c..f0a390fb1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h @@ -40,7 +40,7 @@ struct nested, 1, typename eval struct traits > : public traits { @@ -48,6 +41,11 @@ struct nested, 1, typename eval class TensorShufflingOp : public TensorBase > { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h index 964797613..62686ce69 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h @@ -24,7 +24,6 @@ namespace Eigen { /** \internal * - * \class TensorStorage * \ingroup CXX11_Tensor_Module * * \brief Stores the data of a tensor diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h index 2924abba0..04ade37b5 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h @@ -15,13 +15,6 @@ namespace Eigen { -/** \class TensorStriding - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor striding class. - * - * - */ namespace internal { template struct traits > : public traits { @@ -48,6 +41,11 @@ struct nested, 1, typename eval class TensorStridingOp : public TensorBase > { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h b/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h index 035d94e54..c1499852c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h @@ -16,14 +16,6 @@ namespace Eigen { -/** \class TensorTrace - * \ingroup CXX11_Tensor_Module - * - * \brief Tensor Trace class. - * - * - */ - namespace internal { template struct traits > : public traits { @@ -49,6 +41,11 @@ struct nested, 1, typename eval class TensorTraceOp : public TensorBase > { public: diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h index 2f0c13541..ce712e2ac 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h @@ -9,21 +9,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 @@ -52,6 +37,21 @@ struct nested, 1, } // end namespace internal +/** + * \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: