diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-06-16 14:43:46 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-06-16 14:43:46 +0200 |
commit | 38874b16511f25c5e712d7e294a02b0d9aa6c397 (patch) | |
tree | 866242d846c9561eba81d98ffd04b1ac449e5b85 /unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h | |
parent | e2e66930c67673f34d812e126f0100891af7e0d2 (diff) |
Fix shadow warnings in Tensor module
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h index 2a7dd45c0..5a165dab0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h @@ -185,11 +185,13 @@ struct TensorEvaluator<const TensorPaddingOp<PaddingDimensions, ArgType>, Device { Index inputIndex; if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) { - const Index idx = coords[0]; - if (idx < m_padding[0].first || idx >= m_dimensions[0] - m_padding[0].second) { - return Scalar(0); + { + const Index idx = coords[0]; + if (idx < m_padding[0].first || idx >= m_dimensions[0] - m_padding[0].second) { + return Scalar(0); + } + inputIndex = idx - m_padding[0].first; } - inputIndex = idx - m_padding[0].first; for (int i = 1; i < NumDims; ++i) { const Index idx = coords[i]; if (idx < m_padding[i].first || idx >= m_dimensions[i] - m_padding[i].second) { @@ -198,11 +200,13 @@ struct TensorEvaluator<const TensorPaddingOp<PaddingDimensions, ArgType>, Device inputIndex += (idx - m_padding[i].first) * m_inputStrides[i]; } } else { - const Index idx = coords[NumDims-1]; - if (idx < m_padding[NumDims-1].first || idx >= m_dimensions[NumDims-1] - m_padding[NumDims-1].second) { - return Scalar(0); + { + const Index idx = coords[NumDims-1]; + if (idx < m_padding[NumDims-1].first || idx >= m_dimensions[NumDims-1] - m_padding[NumDims-1].second) { + return Scalar(0); + } + inputIndex = idx - m_padding[NumDims-1].first; } - inputIndex = idx - m_padding[NumDims-1].first; for (int i = NumDims - 2; i >= 0; --i) { const Index idx = coords[i]; if (idx < m_padding[i].first || idx >= m_dimensions[i] - m_padding[i].second) { |