mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Small cleanup and small fix to the contraction of row major tensors
This commit is contained in:
parent
47076bf00e
commit
7ce932edd3
@ -147,8 +147,6 @@ struct TensorContractionEvaluatorBase
|
|||||||
static const int ContractDims = internal::array_size<Indices>::value;
|
static const int ContractDims = internal::array_size<Indices>::value;
|
||||||
static const int NumDims = max_n_1<LDims + RDims - 2 * ContractDims>::size;
|
static const int NumDims = max_n_1<LDims + RDims - 2 * ContractDims>::size;
|
||||||
|
|
||||||
typedef array<Index, LDims> left_dim_mapper_t;
|
|
||||||
typedef array<Index, RDims> right_dim_mapper_t;
|
|
||||||
typedef array<Index, ContractDims> contract_t;
|
typedef array<Index, ContractDims> contract_t;
|
||||||
typedef array<Index, max_n_1<LDims - ContractDims>::size> left_nocontract_t;
|
typedef array<Index, max_n_1<LDims - ContractDims>::size> left_nocontract_t;
|
||||||
typedef array<Index, max_n_1<RDims - ContractDims>::size> right_nocontract_t;
|
typedef array<Index, max_n_1<RDims - ContractDims>::size> right_nocontract_t;
|
||||||
@ -195,8 +193,8 @@ struct TensorContractionEvaluatorBase
|
|||||||
// We need to flip all the pairs of contracting indices as well as
|
// We need to flip all the pairs of contracting indices as well as
|
||||||
// reversing the dimensions.
|
// reversing the dimensions.
|
||||||
for (int i = 0; i < ContractDims; i++) {
|
for (int i = 0; i < ContractDims; i++) {
|
||||||
eval_op_indices[i].first = LDims - 1 - op.indices()[i].second;
|
eval_op_indices[i].first = LDims - 1 - op.indices()[ContractDims - 1 - i].second;
|
||||||
eval_op_indices[i].second = RDims - 1 - op.indices()[i].first;
|
eval_op_indices[i].second = RDims - 1 - op.indices()[ContractDims - 1 - i].first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,9 +502,6 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
internal::array_size<typename TensorEvaluator<EvalRightArgType, Device>::Dimensions>::value;
|
internal::array_size<typename TensorEvaluator<EvalRightArgType, Device>::Dimensions>::value;
|
||||||
static const int ContractDims = internal::array_size<Indices>::value;
|
static const int ContractDims = internal::array_size<Indices>::value;
|
||||||
|
|
||||||
typedef array<Index, LDims> left_dim_mapper_t;
|
|
||||||
typedef array<Index, RDims> right_dim_mapper_t;
|
|
||||||
|
|
||||||
typedef array<Index, ContractDims> contract_t;
|
typedef array<Index, ContractDims> contract_t;
|
||||||
typedef array<Index, max_n_1<LDims - ContractDims>::size> left_nocontract_t;
|
typedef array<Index, max_n_1<LDims - ContractDims>::size> left_nocontract_t;
|
||||||
typedef array<Index, max_n_1<RDims - ContractDims>::size> right_nocontract_t;
|
typedef array<Index, max_n_1<RDims - ContractDims>::size> right_nocontract_t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user