Added a test for shuffling

This commit is contained in:
Benoit Steiner
2015-07-29 15:01:21 -07:00
parent 0570594f2c
commit e1d28b7ea7
2 changed files with 49 additions and 8 deletions

View File

@@ -67,7 +67,7 @@ class TensorShufflingOp : public TensorBase<TensorShufflingOp<Shuffle, XprType>
: m_xpr(expr), m_shuffle(shuffle) {}
EIGEN_DEVICE_FUNC
const Shuffle& shuffle() const { return m_shuffle; }
const Shuffle& shufflePermutation() const { return m_shuffle; }
EIGEN_DEVICE_FUNC
const typename internal::remove_all<typename XprType::Nested>::type&
@@ -119,7 +119,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device>
: m_impl(op.expression(), device)
{
const typename TensorEvaluator<ArgType, Device>::Dimensions& input_dims = m_impl.dimensions();
const Shuffle& shuffle = op.shuffle();
const Shuffle& shuffle = op.shufflePermutation();
for (int i = 0; i < NumDims; ++i) {
m_dimensions[i] = input_dims[shuffle[i]];
}