Fix Tensor docs

This commit is contained in:
C. Antonio Sanchez 2025-02-15 22:46:57 -08:00
parent 7312765992
commit 42d9cc0b1d
40 changed files with 408 additions and 527 deletions

View File

@ -14,13 +14,6 @@
namespace Eigen { namespace Eigen {
namespace internal { namespace internal {
/** \class TensorIndexTuple
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor + Index Tuple class.
*
*
*/
template<typename XprType> template<typename XprType>
struct traits<TensorIndexTupleOp<XprType> > : public traits<XprType> struct traits<TensorIndexTupleOp<XprType> > : public traits<XprType>
{ {
@ -49,6 +42,11 @@ struct nested<TensorIndexTupleOp<XprType>, 1,
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor + Index Pair class.
*/
template<typename XprType> template<typename XprType>
class TensorIndexTupleOp : public TensorBase<TensorIndexTupleOp<XprType>, ReadOnlyAccessors> class TensorIndexTupleOp : public TensorBase<TensorIndexTupleOp<XprType>, ReadOnlyAccessors>
{ {

View File

@ -12,14 +12,6 @@
namespace Eigen { 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 { namespace internal {
template<typename LhsXprType, typename RhsXprType> template<typename LhsXprType, typename RhsXprType>
struct traits<TensorAssignOp<LhsXprType, RhsXprType> > struct traits<TensorAssignOp<LhsXprType, RhsXprType> >
@ -55,12 +47,15 @@ struct nested<TensorAssignOp<LhsXprType, RhsXprType>, 1, typename eval<TensorAss
} // end namespace internal } // end namespace internal
/** The tensor assignment class.
* \ingroup CXX11_Tensor_Module
template<typename LhsXprType, typename RhsXprType> *
class TensorAssignOp : public TensorBase<TensorAssignOp<LhsXprType, RhsXprType> > * 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.
public: */
template <typename LhsXprType, typename RhsXprType>
class TensorAssignOp : public TensorBase<TensorAssignOp<LhsXprType, RhsXprType> > {
public:
typedef typename Eigen::internal::traits<TensorAssignOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorAssignOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename LhsXprType::CoeffReturnType CoeffReturnType; typedef typename LhsXprType::CoeffReturnType CoeffReturnType;

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorBroadcasting
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor broadcasting class.
*
*
*/
namespace internal { namespace internal {
template<typename Broadcast, typename XprType> template<typename Broadcast, typename XprType>
struct traits<TensorBroadcastingOp<Broadcast, XprType> > : public traits<XprType> struct traits<TensorBroadcastingOp<Broadcast, XprType> > : public traits<XprType>
@ -63,12 +56,12 @@ struct is_input_scalar<Sizes<Indices...> > {
} // end namespace internal } // end namespace internal
/** Tensor broadcasting class.
* \ingroup CXX11_Tensor_Module
template<typename Broadcast, typename XprType> */
class TensorBroadcastingOp : public TensorBase<TensorBroadcastingOp<Broadcast, XprType>, ReadOnlyAccessors> template <typename Broadcast, typename XprType>
{ class TensorBroadcastingOp : public TensorBase<TensorBroadcastingOp<Broadcast, XprType>, ReadOnlyAccessors> {
public: public:
typedef typename Eigen::internal::traits<TensorBroadcastingOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorBroadcastingOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename XprType::CoeffReturnType CoeffReturnType;

View File

@ -12,14 +12,6 @@
namespace Eigen { 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 { namespace internal {
template<DenseIndex DimId, typename XprType> template<DenseIndex DimId, typename XprType>
struct traits<TensorChippingOp<DimId, XprType> > : public traits<XprType> struct traits<TensorChippingOp<DimId, XprType> > : public traits<XprType>
@ -74,11 +66,11 @@ struct DimensionId<Dynamic>
} // end namespace internal } // 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<DenseIndex DimId, typename XprType> */
class TensorChippingOp : public TensorBase<TensorChippingOp<DimId, XprType> > template <DenseIndex DimId, typename XprType>
{ class TensorChippingOp : public TensorBase<TensorChippingOp<DimId, XprType> > {
public: public:
typedef TensorBase<TensorChippingOp<DimId, XprType> > Base; typedef TensorBase<TensorChippingOp<DimId, XprType> > Base;
typedef typename Eigen::internal::traits<TensorChippingOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorChippingOp>::Scalar Scalar;

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorConcatenationOp
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor concatenation class.
*
*
*/
namespace internal { namespace internal {
template<typename Axis, typename LhsXprType, typename RhsXprType> template<typename Axis, typename LhsXprType, typename RhsXprType>
struct traits<TensorConcatenationOp<Axis, LhsXprType, RhsXprType> > struct traits<TensorConcatenationOp<Axis, LhsXprType, RhsXprType> >
@ -55,10 +48,13 @@ struct nested<TensorConcatenationOp<Axis, LhsXprType, RhsXprType>, 1, typename e
} // end namespace internal } // end namespace internal
/**
template<typename Axis, typename LhsXprType, typename RhsXprType> * \ingroup CXX11_Tensor_Module
class TensorConcatenationOp : public TensorBase<TensorConcatenationOp<Axis, LhsXprType, RhsXprType>, WriteAccessors> *
{ * \brief Tensor concatenation class.
*/
template <typename Axis, typename LhsXprType, typename RhsXprType>
class TensorConcatenationOp : public TensorBase<TensorConcatenationOp<Axis, LhsXprType, RhsXprType>, WriteAccessors> {
public: public:
typedef TensorBase<TensorConcatenationOp<Axis, LhsXprType, RhsXprType>, WriteAccessors> Base; typedef TensorBase<TensorConcatenationOp<Axis, LhsXprType, RhsXprType>, WriteAccessors> Base;
typedef typename internal::traits<TensorConcatenationOp>::Scalar Scalar; typedef typename internal::traits<TensorConcatenationOp>::Scalar Scalar;

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorContraction
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor contraction class.
*
*
*/
namespace internal { namespace internal {
template<typename Dimensions, typename LhsXprType, typename RhsXprType, typename OutputKernelType> template<typename Dimensions, typename LhsXprType, typename RhsXprType, typename OutputKernelType>
@ -320,10 +313,14 @@ struct NoOpOutputKernel {
} }
}; };
template<typename Indices, typename LhsXprType, typename RhsXprType, typename OutputKernelType = const NoOpOutputKernel> /** Tensor contraction class.
class TensorContractionOp : public TensorBase<TensorContractionOp<Indices, LhsXprType, RhsXprType, OutputKernelType>, ReadOnlyAccessors> * \ingroup CXX11_Tensor_Module
{ */
public: template <typename Indices, typename LhsXprType, typename RhsXprType,
typename OutputKernelType = const NoOpOutputKernel>
class TensorContractionOp
: public TensorBase<TensorContractionOp<Indices, LhsXprType, RhsXprType, OutputKernelType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorContractionOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorContractionOp>::Scalar Scalar;
typedef typename internal::gebp_traits<typename LhsXprType::CoeffReturnType, typedef typename internal::gebp_traits<typename LhsXprType::CoeffReturnType,
typename RhsXprType::CoeffReturnType>::ResScalar CoeffReturnType; typename RhsXprType::CoeffReturnType>::ResScalar CoeffReturnType;

View File

@ -12,13 +12,6 @@
namespace Eigen { 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 { namespace internal {
template<typename TargetType, typename XprType> template<typename TargetType, typename XprType>
struct traits<TensorConversionOp<TargetType, XprType> > struct traits<TensorConversionOp<TargetType, XprType> >
@ -172,9 +165,15 @@ struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 1, TgtCoeffRatio>
const typename TensorEvaluator::Index m_maxIndex; const typename TensorEvaluator::Index m_maxIndex;
}; };
template<typename TargetType, typename XprType> /**
class TensorConversionOp : public TensorBase<TensorConversionOp<TargetType, XprType>, ReadOnlyAccessors> * \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 <typename TargetType, typename XprType>
class TensorConversionOp : public TensorBase<TensorConversionOp<TargetType, XprType>, ReadOnlyAccessors> {
public: public:
typedef typename internal::traits<TensorConversionOp>::Scalar Scalar; typedef typename internal::traits<TensorConversionOp>::Scalar Scalar;
typedef typename internal::traits<TensorConversionOp>::StorageKind StorageKind; typedef typename internal::traits<TensorConversionOp>::StorageKind StorageKind;

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorConvolution
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor convolution class.
*
*
*/
namespace internal { namespace internal {
template <typename Index, typename InputDims, int NumKernelDims, int Layout> template <typename Index, typename InputDims, int NumKernelDims, int Layout>
@ -253,12 +246,13 @@ struct nested<TensorConvolutionOp<Dimensions, InputXprType, KernelXprType>, 1, t
} // end namespace internal } // end namespace internal
/** Tensor convolution class.
* \ingroup CXX11_Tensor_Module
template<typename Indices, typename InputXprType, typename KernelXprType> */
class TensorConvolutionOp : public TensorBase<TensorConvolutionOp<Indices, InputXprType, KernelXprType>, ReadOnlyAccessors> template <typename Indices, typename InputXprType, typename KernelXprType>
{ class TensorConvolutionOp
public: : public TensorBase<TensorConvolutionOp<Indices, InputXprType, KernelXprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorConvolutionOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorConvolutionOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename internal::promote_storage_type<typename InputXprType::CoeffReturnType, typedef typename internal::promote_storage_type<typename InputXprType::CoeffReturnType,

View File

@ -17,14 +17,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorConvolution
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor convolution class.
*
*
*/
enum class convolution_type { CONV1D, CONV2D, CONV3D }; enum class convolution_type { CONV1D, CONV2D, CONV3D };
template <typename Evaluator, typename CoeffReturnType, typename KernelType, typename Index, typename InputDims, template <typename Evaluator, typename CoeffReturnType, typename KernelType, typename Index, typename InputDims,
typename Kernel_accessor, typename Buffer_accessor, convolution_type Conv_Dim> typename Kernel_accessor, typename Buffer_accessor, convolution_type Conv_Dim>

View File

@ -12,14 +12,6 @@
namespace Eigen { 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 // Class storing the cost of evaluating a tensor expression in terms of the
// estimated number of operand bytes loads, bytes stored, and compute cycles. // estimated number of operand bytes loads, bytes stored, and compute cycles.
class TensorOpCost { class TensorOpCost {
@ -157,6 +149,13 @@ class TensorOpCost {
// TODO(rmlarsen): Implement a policy that chooses an "optimal" number of theads // 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 // in [1:max_threads] instead of just switching multi-threading off for small
// work units. // work units.
/**
* \ingroup CXX11_Tensor_Module
*
* \brief A cost model used to limit the number of threads used for evaluating
* tensor expression.
*
*/
template <typename Device> template <typename Device>
class TensorCostModel { class TensorCostModel {
public: public:

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorCustomUnaryOp
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor custom class.
*
*
*/
namespace internal { namespace internal {
template<typename CustomUnaryFunc, typename XprType> template<typename CustomUnaryFunc, typename XprType>
struct traits<TensorCustomUnaryOp<CustomUnaryFunc, XprType> > struct traits<TensorCustomUnaryOp<CustomUnaryFunc, XprType> >
@ -47,12 +40,14 @@ struct nested<TensorCustomUnaryOp<CustomUnaryFunc, XprType> >
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename CustomUnaryFunc, typename XprType> *
class TensorCustomUnaryOp : public TensorBase<TensorCustomUnaryOp<CustomUnaryFunc, XprType>, ReadOnlyAccessors> * \brief Tensor custom class.
{ */
public: template <typename CustomUnaryFunc, typename XprType>
class TensorCustomUnaryOp : public TensorBase<TensorCustomUnaryOp<CustomUnaryFunc, XprType>, ReadOnlyAccessors> {
public:
typedef typename internal::traits<TensorCustomUnaryOp>::Scalar Scalar; typedef typename internal::traits<TensorCustomUnaryOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename XprType::CoeffReturnType CoeffReturnType;

View File

@ -12,19 +12,19 @@
namespace Eigen { namespace Eigen {
/** \class TensorDevice /**
* \ingroup CXX11_Tensor_Module * \ingroup CXX11_Tensor_Module
* *
* \brief Pseudo expression providing an operator = that will evaluate its argument * \brief Pseudo expression providing an operator = that will evaluate its argument
* on the specified computing 'device' (GPU, thread pool, ...) * on the specified computing 'device' (GPU, thread pool, ...)
* *
* Example: * Example:
* C.device(EIGEN_GPU) = A + B; * C.device(EIGEN_GPU) = A + B;
* *
* Todo: operator *= and /=. * Todo: operator *= and /=.
*/ */
template <typename ExpressionType, typename DeviceType>
template <typename ExpressionType, typename DeviceType> class TensorDevice { class TensorDevice {
public: public:
TensorDevice(const DeviceType& device, ExpressionType& expression) : m_device(device), m_expression(expression) {} TensorDevice(const DeviceType& device, ExpressionType& expression) : m_device(device), m_expression(expression) {}

View File

@ -13,18 +13,16 @@
namespace Eigen { namespace Eigen {
/** \internal /** \internal
* *
* \class TensorDimensionList * \ingroup CXX11_Tensor_Module
* \ingroup CXX11_Tensor_Module *
* * \brief Special case of tensor index list used to list all the dimensions of a tensor of rank n.
* \brief Special case of tensor index list used to list all the dimensions of a tensor of rank n. *
* * \sa Tensor
* \sa Tensor */
*/ template <typename Index, std::size_t Rank>
struct DimensionList {
template <typename Index, std::size_t Rank> struct DimensionList { EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE const Index operator[](const Index i) const { return i; }
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
const Index operator[] (const Index i) const { return i; }
}; };
namespace internal { namespace internal {

View File

@ -13,22 +13,6 @@
namespace Eigen { 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 // Boilerplate code
namespace internal { namespace internal {
@ -87,8 +71,19 @@ struct fixed_size_tensor_index_extraction_helper<Index, 0>
} // end namespace internal } // end namespace internal
// Fixed size
#ifndef EIGEN_EMULATE_CXX11_META_H #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 <typename std::ptrdiff_t... Indices> template <typename std::ptrdiff_t... Indices>
struct Sizes { struct Sizes {
typedef internal::numeric_list<std::ptrdiff_t, Indices...> Base; typedef internal::numeric_list<std::ptrdiff_t, Indices...> Base;
@ -256,9 +251,17 @@ struct tensor_index_linearization_helper<Index, NumIndices, 0, RowMajor>
}; };
} // end namespace internal } // end namespace internal
/** \internal
*
// Dynamic size * \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 <typename DenseIndex, int NumDims> template <typename DenseIndex, int NumDims>
struct DSizes : array<DenseIndex, NumDims> { struct DSizes : array<DenseIndex, NumDims> {
typedef array<DenseIndex, NumDims> Base; typedef array<DenseIndex, NumDims> Base;

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorForcedEval
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor reshaping class.
*
*
*/
namespace internal { namespace internal {
template<typename XprType, template <class> class MakePointer_> template<typename XprType, template <class> class MakePointer_>
struct traits<TensorEvalToOp<XprType, MakePointer_> > struct traits<TensorEvalToOp<XprType, MakePointer_> >

View File

@ -12,21 +12,19 @@
namespace Eigen { 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 // Generic evaluator
template<typename Derived, typename Device> /**
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 <typename Derived, typename Device>
struct TensorEvaluator {
typedef typename Derived::Index Index; typedef typename Derived::Index Index;
typedef typename Derived::Scalar Scalar; typedef typename Derived::Scalar Scalar;
typedef typename Derived::Scalar CoeffReturnType; typedef typename Derived::Scalar CoeffReturnType;

View File

@ -12,20 +12,6 @@
namespace Eigen { 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 { namespace internal {
/** /**
@ -73,8 +59,20 @@ struct ExpressionHasTensorBroadcastingOp<
// -------------------------------------------------------------------------- // // -------------------------------------------------------------------------- //
/** /**
* \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.
*
* Default strategy: the expression is evaluated sequentially with a single cpu * Default strategy: the expression is evaluated sequentially with a single cpu
* thread, without vectorization and block evaluation. * thread, without vectorization and block evaluation.
*
* @tparam Vectorizable can use packet math (SSE/AVX/etc... registers and
* instructions)
* @tparam Tiling can use block based tensor evaluation
* (see TensorBlock.h)
*/ */
template <typename Expression, typename Device, bool Vectorizable, template <typename Expression, typename Device, bool Vectorizable,
TiledEvaluation Tiling> TiledEvaluation Tiling>

View File

@ -12,21 +12,6 @@
namespace Eigen { 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 { namespace internal {
template<typename NullaryOp, typename XprType> template<typename NullaryOp, typename XprType>
struct traits<TensorCwiseNullaryOp<NullaryOp, XprType> > struct traits<TensorCwiseNullaryOp<NullaryOp, XprType> >
@ -46,11 +31,16 @@ struct traits<TensorCwiseNullaryOp<NullaryOp, XprType> >
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename NullaryOp, typename XprType> *
class TensorCwiseNullaryOp : public TensorBase<TensorCwiseNullaryOp<NullaryOp, XprType>, ReadOnlyAccessors> * \brief Tensor nullary expression.
{ *
* The TensorCwiseNullaryOp class applies a nullary operators to an expression.
* This is typically used to generate constants.
*/
template <typename NullaryOp, typename XprType>
class TensorCwiseNullaryOp : public TensorBase<TensorCwiseNullaryOp<NullaryOp, XprType>, ReadOnlyAccessors> {
public: public:
typedef typename Eigen::internal::traits<TensorCwiseNullaryOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorCwiseNullaryOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
@ -109,11 +99,16 @@ struct nested<TensorCwiseUnaryOp<UnaryOp, XprType>, 1, typename eval<TensorCwise
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename UnaryOp, typename XprType> *
class TensorCwiseUnaryOp : public TensorBase<TensorCwiseUnaryOp<UnaryOp, XprType>, ReadOnlyAccessors> * \brief Tensor unary expression.
{ *
* The TensorCwiseUnaryOp class represents an expression where a unary operator
* (e.g. cwiseSqrt) is applied to an expression.
*/
template <typename UnaryOp, typename XprType>
class TensorCwiseUnaryOp : public TensorBase<TensorCwiseUnaryOp<UnaryOp, XprType>, ReadOnlyAccessors> {
public: public:
// TODO(phli): Add InputScalar, InputPacket. Check references to // TODO(phli): Add InputScalar, InputPacket. Check references to
// current Scalar/Packet to see if the intent is Input or Output. // current Scalar/Packet to see if the intent is Input or Output.
@ -190,12 +185,18 @@ struct nested<TensorCwiseBinaryOp<BinaryOp, LhsXprType, RhsXprType>, 1, typename
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename BinaryOp, typename LhsXprType, typename RhsXprType> *
class TensorCwiseBinaryOp : public TensorBase<TensorCwiseBinaryOp<BinaryOp, LhsXprType, RhsXprType>, ReadOnlyAccessors> * \brief Tensor binary expression.
{ *
public: * The TensorCwiseBinaryOp class represents an expression where a binary
* operator (e.g. addition) is applied to a lhs and a rhs expression.
*/
template <typename BinaryOp, typename LhsXprType, typename RhsXprType>
class TensorCwiseBinaryOp
: public TensorBase<TensorCwiseBinaryOp<BinaryOp, LhsXprType, RhsXprType>, ReadOnlyAccessors> {
public:
// TODO(phli): Add Lhs/RhsScalar, Lhs/RhsPacket. Check references to // TODO(phli): Add Lhs/RhsScalar, Lhs/RhsPacket. Check references to
// current Scalar/Packet to see if the intent is Inputs or Output. // current Scalar/Packet to see if the intent is Inputs or Output.
typedef typename Eigen::internal::traits<TensorCwiseBinaryOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorCwiseBinaryOp>::Scalar Scalar;

View File

@ -12,18 +12,8 @@
namespace Eigen { namespace Eigen {
/** \class TensorFFT template <bool NeedUprade>
* \ingroup CXX11_Tensor_Module struct MakeComplex {
*
* \brief Tensor FFT class.
*
* TODO:
* Vectorize the Cooley Tukey and the Bluestein algorithm
* Add support for multithreaded evaluation
* Improve the performance on GPU
*/
template <bool NeedUprade> struct MakeComplex {
template <typename T> template <typename T>
EIGEN_DEVICE_FUNC EIGEN_DEVICE_FUNC
T operator() (const T& val) const { return val; } T operator() (const T& val) const { return val; }
@ -82,6 +72,16 @@ struct nested<TensorFFTOp<FFT, XprType, FFTResultType, FFTDirection>, 1, typenam
} // end namespace internal } // 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 <typename FFT, typename XprType, int FFTResultType, int FFTDir> template <typename FFT, typename XprType, int FFTResultType, int FFTDir>
class TensorFFTOp : public TensorBase<TensorFFTOp<FFT, XprType, FFTResultType, FFTDir>, ReadOnlyAccessors> { class TensorFFTOp : public TensorBase<TensorFFTOp<FFT, XprType, FFTResultType, FFTDir>, ReadOnlyAccessors> {
public: public:

View File

@ -12,20 +12,18 @@
namespace Eigen { namespace Eigen {
/** \class TensorFixedSize /**
* \ingroup CXX11_Tensor_Module * \ingroup CXX11_Tensor_Module
* *
* \brief The fixed sized version of the tensor class. * \brief The fixed sized version of the tensor class.
* *
* The fixed sized equivalent of * The fixed sized equivalent of
* Eigen::Tensor<float, 3> t(3, 5, 7); * Eigen::Tensor<float, 3> t(3, 5, 7);
* is * is
* Eigen::TensorFixedSize<float, Sizes<3,5,7>> t; * Eigen::TensorFixedSize<float, Sizes<3,5,7>> t;
*/ */
template <typename Scalar_, typename Dimensions_, int Options_, typename IndexType>
template<typename Scalar_, typename Dimensions_, int Options_, typename IndexType> class TensorFixedSize : public TensorBase<TensorFixedSize<Scalar_, Dimensions_, Options_, IndexType> > {
class TensorFixedSize : public TensorBase<TensorFixedSize<Scalar_, Dimensions_, Options_, IndexType> >
{
public: public:
typedef TensorFixedSize<Scalar_, Dimensions_, Options_, IndexType> Self; typedef TensorFixedSize<Scalar_, Dimensions_, Options_, IndexType> Self;
typedef TensorBase<TensorFixedSize<Scalar_, Dimensions_, Options_, IndexType> > Base; typedef TensorBase<TensorFixedSize<Scalar_, Dimensions_, Options_, IndexType> > Base;

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorForcedEval
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor reshaping class.
*
*
*/
namespace internal { namespace internal {
template<typename XprType> template<typename XprType>
struct traits<TensorForcedEvalOp<XprType> > struct traits<TensorForcedEvalOp<XprType> >
@ -53,12 +46,14 @@ struct nested<TensorForcedEvalOp<XprType>, 1, typename eval<TensorForcedEvalOp<X
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename XprType> *
class TensorForcedEvalOp : public TensorBase<TensorForcedEvalOp<XprType>, ReadOnlyAccessors> * \brief Tensor reshaping class.
{ */
public: template <typename XprType>
class TensorForcedEvalOp : public TensorBase<TensorForcedEvalOp<XprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorForcedEvalOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorForcedEvalOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename internal::remove_const<typename XprType::CoeffReturnType>::type CoeffReturnType; typedef typename internal::remove_const<typename XprType::CoeffReturnType>::type CoeffReturnType;

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorGeneratorOp
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor generator class.
*
*
*/
namespace internal { namespace internal {
template<typename Generator, typename XprType> template<typename Generator, typename XprType>
struct traits<TensorGeneratorOp<Generator, XprType> > : public traits<XprType> struct traits<TensorGeneratorOp<Generator, XprType> > : public traits<XprType>
@ -48,12 +41,14 @@ struct nested<TensorGeneratorOp<Generator, XprType>, 1, typename eval<TensorGene
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename Generator, typename XprType> *
class TensorGeneratorOp : public TensorBase<TensorGeneratorOp<Generator, XprType>, ReadOnlyAccessors> * \brief Tensor generator class.
{ */
public: template <typename Generator, typename XprType>
class TensorGeneratorOp : public TensorBase<TensorGeneratorOp<Generator, XprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorGeneratorOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorGeneratorOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename XprType::CoeffReturnType CoeffReturnType;

View File

@ -12,20 +12,6 @@
namespace Eigen { 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 { namespace internal {
template<DenseIndex Rows, DenseIndex Cols, typename XprType> template<DenseIndex Rows, DenseIndex Cols, typename XprType>
@ -116,10 +102,23 @@ struct ImagePatchPaddingOp {
} // end namespace internal } // end namespace internal
template<DenseIndex Rows, DenseIndex Cols, typename XprType> /**
class TensorImagePatchOp : public TensorBase<TensorImagePatchOp<Rows, Cols, XprType>, ReadOnlyAccessors> * \ingroup CXX11_Tensor_Module
{ *
public: * \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 <DenseIndex Rows, DenseIndex Cols, typename XprType>
class TensorImagePatchOp : public TensorBase<TensorImagePatchOp<Rows, Cols, XprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorImagePatchOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorImagePatchOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename XprType::CoeffReturnType CoeffReturnType;

View File

@ -17,26 +17,6 @@
namespace Eigen { 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 <Index n> template <Index n>
struct type2index { struct type2index {
static const Index value = n; static const Index value = n;
@ -294,9 +274,26 @@ struct tuple_coeff<0, ValueT> {
}; };
} // namespace internal } // 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 <typename FirstType, typename... OtherTypes>
template<typename FirstType, typename... OtherTypes>
struct IndexList : internal::IndexTuple<FirstType, OtherTypes...> { struct IndexList : internal::IndexTuple<FirstType, OtherTypes...> {
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Index operator[] (const Index i) const { EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Index operator[] (const Index i) const {
return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...> >::value-1, Index>::get(i, *this); return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...> >::value-1, Index>::get(i, *this);

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorInflation
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor inflation class.
*
*
*/
namespace internal { namespace internal {
template<typename Strides, typename XprType> template<typename Strides, typename XprType>
struct traits<TensorInflationOp<Strides, XprType> > : public traits<XprType> struct traits<TensorInflationOp<Strides, XprType> > : public traits<XprType>
@ -48,10 +41,14 @@ struct nested<TensorInflationOp<Strides, XprType>, 1, typename eval<TensorInflat
} // end namespace internal } // end namespace internal
template<typename Strides, typename XprType> /**
class TensorInflationOp : public TensorBase<TensorInflationOp<Strides, XprType>, ReadOnlyAccessors> * \ingroup CXX11_Tensor_Module
{ *
public: * \brief Tensor inflation class.
*/
template <typename Strides, typename XprType>
class TensorInflationOp : public TensorBase<TensorInflationOp<Strides, XprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorInflationOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorInflationOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename XprType::CoeffReturnType CoeffReturnType;

View File

@ -16,13 +16,13 @@
namespace Eigen { namespace Eigen {
/** \class TensorInitializer
* \ingroup CXX11_Tensor_Module
*
* \brief Helper template to initialize Tensors from std::initializer_lists.
*/
namespace internal { namespace internal {
/**
* \ingroup CXX11_Tensor_Module
*
* \brief Helper template to initialize Tensors from std::initializer_lists.
*/
template <typename Derived, int N> template <typename Derived, int N>
struct Initializer { struct Initializer {
typedef std::initializer_list< typedef std::initializer_list<

View File

@ -13,19 +13,6 @@
namespace Eigen { 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 { namespace internal {
// Note: result is undefined if val == 0 // Note: result is undefined if val == 0
@ -134,6 +121,17 @@ namespace internal {
} }
}; };
/** \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 <typename T, bool div_gt_one = false> template <typename T, bool div_gt_one = false>
struct TensorIntDivisor { struct TensorIntDivisor {
public: public:

View File

@ -12,28 +12,6 @@
namespace Eigen { 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<float, 2, ColMajor> input(2, 4);
* Tensor<float, 2, RowMajor> output = input.swap_layout();
* eigen_assert(output.dimension(0) == 4);
* eigen_assert(output.dimension(1) == 2);
*
* array<int, 2> shuffle(1, 0);
* output = input.swap_layout().shuffle(shuffle);
* eigen_assert(output.dimension(0) == 2);
* eigen_assert(output.dimension(1) == 4);
*
*/
namespace internal { namespace internal {
template<typename XprType> template<typename XprType>
struct traits<TensorLayoutSwapOp<XprType> > : public traits<XprType> struct traits<TensorLayoutSwapOp<XprType> > : public traits<XprType>
@ -63,11 +41,30 @@ struct nested<TensorLayoutSwapOp<XprType>, 1, typename eval<TensorLayoutSwapOp<X
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename XprType> *
class TensorLayoutSwapOp : public TensorBase<TensorLayoutSwapOp<XprType>, WriteAccessors> * \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<float, 2, ColMajor> input(2, 4);
* Tensor<float, 2, RowMajor> output = input.swap_layout();
* eigen_assert(output.dimension(0) == 4);
* eigen_assert(output.dimension(1) == 2);
*
* array<int, 2> shuffle(1, 0);
* output = input.swap_layout().shuffle(shuffle);
* eigen_assert(output.dimension(0) == 2);
* eigen_assert(output.dimension(1) == 4);
*
*/
template <typename XprType>
class TensorLayoutSwapOp : public TensorBase<TensorLayoutSwapOp<XprType>, WriteAccessors> {
public: public:
typedef TensorBase<TensorLayoutSwapOp<XprType>, WriteAccessors> Base; typedef TensorBase<TensorLayoutSwapOp<XprType>, WriteAccessors> Base;
typedef typename Eigen::internal::traits<TensorLayoutSwapOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorLayoutSwapOp>::Scalar Scalar;

View File

@ -14,12 +14,12 @@ namespace Eigen {
// FIXME use proper doxygen documentation (e.g. \tparam MakePointer_) // FIXME use proper doxygen documentation (e.g. \tparam MakePointer_)
/** \class TensorMap /**
* \ingroup CXX11_Tensor_Module * \ingroup CXX11_Tensor_Module
* *
* \brief A tensor expression mapping an existing array of data. * \brief A tensor expression mapping an existing array of data.
* *
*/ */
/// `template <class> class MakePointer_` is added to convert the host pointer to the device pointer. /// `template <class> 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. /// 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`. /// If we wanted to use the same Evaluator functions we have to convert that type to our pointer `T`.

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorReshaping
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor reshaping class.
*
*
*/
namespace internal { namespace internal {
template<typename NewDimensions, typename XprType> template<typename NewDimensions, typename XprType>
struct traits<TensorReshapingOp<NewDimensions, XprType> > : public traits<XprType> struct traits<TensorReshapingOp<NewDimensions, XprType> > : public traits<XprType>
@ -48,12 +41,14 @@ struct nested<TensorReshapingOp<NewDimensions, XprType>, 1, typename eval<Tensor
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename NewDimensions, typename XprType> *
class TensorReshapingOp : public TensorBase<TensorReshapingOp<NewDimensions, XprType>, WriteAccessors> * \brief Tensor reshaping class.
{ */
public: template <typename NewDimensions, typename XprType>
class TensorReshapingOp : public TensorBase<TensorReshapingOp<NewDimensions, XprType>, WriteAccessors> {
public:
typedef TensorBase<TensorReshapingOp<NewDimensions, XprType>, WriteAccessors> Base; typedef TensorBase<TensorReshapingOp<NewDimensions, XprType>, WriteAccessors> Base;
typedef typename Eigen::internal::traits<TensorReshapingOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorReshapingOp>::Scalar Scalar;
typedef typename internal::remove_const<typename XprType::CoeffReturnType>::type CoeffReturnType; typedef typename internal::remove_const<typename XprType::CoeffReturnType>::type CoeffReturnType;

View File

@ -12,13 +12,6 @@
namespace Eigen { 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 { namespace internal {
template<typename PaddingDimensions, typename XprType> template<typename PaddingDimensions, typename XprType>
struct traits<TensorPaddingOp<PaddingDimensions, XprType> > : public traits<XprType> struct traits<TensorPaddingOp<PaddingDimensions, XprType> > : public traits<XprType>
@ -48,12 +41,16 @@ struct nested<TensorPaddingOp<PaddingDimensions, XprType>, 1, typename eval<Tens
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename PaddingDimensions, typename XprType> *
class TensorPaddingOp : public TensorBase<TensorPaddingOp<PaddingDimensions, XprType>, ReadOnlyAccessors> * \brief Tensor padding class.
{ * At the moment only padding with a constant value is supported.
public: *
*/
template <typename PaddingDimensions, typename XprType>
class TensorPaddingOp : public TensorBase<TensorPaddingOp<PaddingDimensions, XprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorPaddingOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorPaddingOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename XprType::CoeffReturnType CoeffReturnType;

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorPatch
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor patch class.
*
*
*/
namespace internal { namespace internal {
template<typename PatchDim, typename XprType> template<typename PatchDim, typename XprType>
struct traits<TensorPatchOp<PatchDim, XprType> > : public traits<XprType> struct traits<TensorPatchOp<PatchDim, XprType> > : public traits<XprType>
@ -48,12 +41,14 @@ struct nested<TensorPatchOp<PatchDim, XprType>, 1, typename eval<TensorPatchOp<P
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename PatchDim, typename XprType> *
class TensorPatchOp : public TensorBase<TensorPatchOp<PatchDim, XprType>, ReadOnlyAccessors> * \brief Tensor patch class.
{ */
public: template <typename PatchDim, typename XprType>
class TensorPatchOp : public TensorBase<TensorPatchOp<PatchDim, XprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorPatchOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorPatchOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename XprType::CoeffReturnType CoeffReturnType;

View File

@ -24,14 +24,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorReduction
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor reduction class.
*
*/
namespace internal { namespace internal {
template<typename Op, typename Dims, typename XprType,template <class> class MakePointer_ > template<typename Op, typename Dims, typename XprType,template <class> class MakePointer_ >
struct traits<TensorReductionOp<Op, Dims, XprType, MakePointer_> > struct traits<TensorReductionOp<Op, Dims, XprType, MakePointer_> >
@ -470,8 +462,13 @@ struct ReductionReturnType {
} // end namespace internal } // end namespace internal
/**
template <typename Op, typename Dims, typename XprType, template <class> class MakePointer_> * \ingroup CXX11_Tensor_Module
*
* \brief Tensor reduction class.
*
*/
template <typename Op, typename Dims, typename XprType, template <class> class MakePointer_>
class TensorReductionOp : public TensorBase<TensorReductionOp<Op, Dims, XprType, MakePointer_>, ReadOnlyAccessors> { class TensorReductionOp : public TensorBase<TensorReductionOp<Op, Dims, XprType, MakePointer_>, ReadOnlyAccessors> {
public: public:
typedef typename Eigen::internal::traits<TensorReductionOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorReductionOp>::Scalar Scalar;

View File

@ -12,12 +12,6 @@
#define EIGEN_CXX11_TENSOR_TENSOR_REVERSE_H #define EIGEN_CXX11_TENSOR_TENSOR_REVERSE_H
namespace Eigen { namespace Eigen {
/** \class TensorReverse
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor reverse elements class.
*
*/
namespace internal { namespace internal {
template<typename ReverseDimensions, typename XprType> template<typename ReverseDimensions, typename XprType>
struct traits<TensorReverseOp<ReverseDimensions, struct traits<TensorReverseOp<ReverseDimensions,
@ -49,19 +43,22 @@ struct nested<TensorReverseOp<ReverseDimensions, XprType>, 1,
} // end namespace internal } // end namespace internal
template<typename ReverseDimensions, typename XprType> /**
class TensorReverseOp : public TensorBase<TensorReverseOp<ReverseDimensions, * \ingroup CXX11_Tensor_Module
XprType>, WriteAccessors> *
{ * \brief Tensor reverse elements class.
public: *
typedef TensorBase<TensorReverseOp<ReverseDimensions, XprType>, WriteAccessors>Base; */
typedef typename Eigen::internal::traits<TensorReverseOp>::Scalar Scalar; template <typename ReverseDimensions, typename XprType>
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; class TensorReverseOp : public TensorBase<TensorReverseOp<ReverseDimensions, XprType>, WriteAccessors> {
typedef typename XprType::CoeffReturnType CoeffReturnType; public:
typedef typename Eigen::internal::nested<TensorReverseOp>::type Nested; typedef TensorBase<TensorReverseOp<ReverseDimensions, XprType>, WriteAccessors> Base;
typedef typename Eigen::internal::traits<TensorReverseOp>::StorageKind typedef typename Eigen::internal::traits<TensorReverseOp>::Scalar Scalar;
StorageKind; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename Eigen::internal::traits<TensorReverseOp>::Index Index; typedef typename XprType::CoeffReturnType CoeffReturnType;
typedef typename Eigen::internal::nested<TensorReverseOp>::type Nested;
typedef typename Eigen::internal::traits<TensorReverseOp>::StorageKind StorageKind;
typedef typename Eigen::internal::traits<TensorReverseOp>::Index Index;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReverseOp( EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReverseOp(
const XprType& expr, const ReverseDimensions& reverse_dims) const XprType& expr, const ReverseDimensions& reverse_dims)

View File

@ -41,11 +41,11 @@ struct nested<TensorScanOp<Op, XprType>, 1,
}; };
} // end namespace internal } // end namespace internal
/** \class TensorScan /**
* \ingroup CXX11_Tensor_Module * \ingroup CXX11_Tensor_Module
* *
* \brief Tensor scan class. * \brief Tensor scan class.
*/ */
template <typename Op, typename XprType> template <typename Op, typename XprType>
class TensorScanOp class TensorScanOp
: public TensorBase<TensorScanOp<Op, XprType>, ReadOnlyAccessors> { : public TensorBase<TensorScanOp<Op, XprType>, ReadOnlyAccessors> {

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorShuffling
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor shuffling class.
*
*
*/
namespace internal { namespace internal {
template<typename Shuffle, typename XprType> template<typename Shuffle, typename XprType>
struct traits<TensorShufflingOp<Shuffle, XprType> > : public traits<XprType> struct traits<TensorShufflingOp<Shuffle, XprType> > : public traits<XprType>
@ -48,11 +41,13 @@ struct nested<TensorShufflingOp<Shuffle, XprType>, 1, typename eval<TensorShuffl
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename Shuffle, typename XprType> *
class TensorShufflingOp : public TensorBase<TensorShufflingOp<Shuffle, XprType> > * \brief Tensor shuffling class.
{ */
template <typename Shuffle, typename XprType>
class TensorShufflingOp : public TensorBase<TensorShufflingOp<Shuffle, XprType> > {
public: public:
typedef TensorBase<TensorShufflingOp<Shuffle, XprType> > Base; typedef TensorBase<TensorShufflingOp<Shuffle, XprType> > Base;
typedef typename Eigen::internal::traits<TensorShufflingOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorShufflingOp>::Scalar Scalar;

View File

@ -20,19 +20,18 @@
namespace Eigen { namespace Eigen {
/** \internal /** \internal
* *
* \class TensorStorage * \ingroup CXX11_Tensor_Module
* \ingroup CXX11_Tensor_Module *
* * \brief Stores the data of a tensor
* \brief Stores the data of a tensor *
* * This class stores the data of fixed-size, dynamic-size or mixed tensors
* This class stores the data of fixed-size, dynamic-size or mixed tensors * in a way as compact as possible.
* in a way as compact as possible. *
* * \sa Tensor
* \sa Tensor */
*/ template <typename T, typename Dimensions, int Options>
template<typename T, typename Dimensions, int Options> class TensorStorage; class TensorStorage;
// Pure fixed-size storage // Pure fixed-size storage
template<typename T, typename FixedDimensions, int Options_> template<typename T, typename FixedDimensions, int Options_>

View File

@ -12,13 +12,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorStriding
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor striding class.
*
*
*/
namespace internal { namespace internal {
template<typename Strides, typename XprType> template<typename Strides, typename XprType>
struct traits<TensorStridingOp<Strides, XprType> > : public traits<XprType> struct traits<TensorStridingOp<Strides, XprType> > : public traits<XprType>
@ -48,11 +41,13 @@ struct nested<TensorStridingOp<Strides, XprType>, 1, typename eval<TensorStridin
} // end namespace internal } // end namespace internal
/**
* \ingroup CXX11_Tensor_Module
template<typename Strides, typename XprType> *
class TensorStridingOp : public TensorBase<TensorStridingOp<Strides, XprType> > * \brief Tensor striding class.
{ */
template <typename Strides, typename XprType>
class TensorStridingOp : public TensorBase<TensorStridingOp<Strides, XprType> > {
public: public:
typedef TensorBase<TensorStridingOp<Strides, XprType> > Base; typedef TensorBase<TensorStridingOp<Strides, XprType> > Base;
typedef typename Eigen::internal::traits<TensorStridingOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorStridingOp>::Scalar Scalar;

View File

@ -13,14 +13,6 @@
namespace Eigen { namespace Eigen {
/** \class TensorTrace
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor Trace class.
*
*
*/
namespace internal { namespace internal {
template<typename Dims, typename XprType> template<typename Dims, typename XprType>
struct traits<TensorTraceOp<Dims, XprType> > : public traits<XprType> struct traits<TensorTraceOp<Dims, XprType> > : public traits<XprType>
@ -49,10 +41,13 @@ struct nested<TensorTraceOp<Dims, XprType>, 1, typename eval<TensorTraceOp<Dims,
} // end namespace internal } // end namespace internal
/**
template<typename Dims, typename XprType> * \ingroup CXX11_Tensor_Module
class TensorTraceOp : public TensorBase<TensorTraceOp<Dims, XprType> > *
{ * \brief Tensor Trace class.
*/
template <typename Dims, typename XprType>
class TensorTraceOp : public TensorBase<TensorTraceOp<Dims, XprType> > {
public: public:
typedef typename Eigen::internal::traits<TensorTraceOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorTraceOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;

View File

@ -6,21 +6,6 @@
namespace Eigen { 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 { namespace internal {
template<DenseIndex Planes, DenseIndex Rows, DenseIndex Cols, typename XprType> template<DenseIndex Planes, DenseIndex Rows, DenseIndex Cols, typename XprType>
@ -52,10 +37,24 @@ struct nested<TensorVolumePatchOp<Planes, Rows, Cols, XprType>, 1, typename eval
} // end namespace internal } // end namespace internal
template<DenseIndex Planes, DenseIndex Rows, DenseIndex Cols, typename XprType> /**
class TensorVolumePatchOp : public TensorBase<TensorVolumePatchOp<Planes, Rows, Cols, XprType>, ReadOnlyAccessors> * \ingroup CXX11_Tensor_Module
{ *
public: * \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 <DenseIndex Planes, DenseIndex Rows, DenseIndex Cols, typename XprType>
class TensorVolumePatchOp : public TensorBase<TensorVolumePatchOp<Planes, Rows, Cols, XprType>, ReadOnlyAccessors> {
public:
typedef typename Eigen::internal::traits<TensorVolumePatchOp>::Scalar Scalar; typedef typename Eigen::internal::traits<TensorVolumePatchOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType; typedef typename XprType::CoeffReturnType CoeffReturnType;