diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-06-16 19:43:49 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-06-16 19:43:49 -0700 |
commit | 367794e668fab068a9e35e1d915ef19f362f9d78 (patch) | |
tree | 2e8c60566fe3e0161bb9963abe07451e8e476f21 /unsupported/Eigen | |
parent | 2f2a441a4d37963ecf8934176d16aaa008ccd96c (diff) |
Fixed compilation warnings triggered by clang
Diffstat (limited to 'unsupported/Eigen')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h | 16 | ||||
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h | 8 |
2 files changed, 12 insertions, 12 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h index 78214df11..1a736ee2b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h @@ -155,20 +155,20 @@ struct TensorEvaluator<const TensorConcatenationOp<Axis, LeftArgType, RightArgTy m_rightStrides[0] = 1; m_outputStrides[0] = 1; - for (int i = 1; i < NumDims; ++i) { - m_leftStrides[i] = m_leftStrides[i-1] * lhs_dims[i-1]; - m_rightStrides[i] = m_rightStrides[i-1] * rhs_dims[i-1]; - m_outputStrides[i] = m_outputStrides[i-1] * m_dimensions[i-1]; + for (int j = 1; j < NumDims; ++j) { + m_leftStrides[j] = m_leftStrides[j-1] * lhs_dims[j-1]; + m_rightStrides[j] = m_rightStrides[j-1] * rhs_dims[j-1]; + m_outputStrides[j] = m_outputStrides[j-1] * m_dimensions[j-1]; } } else { m_leftStrides[NumDims - 1] = 1; m_rightStrides[NumDims - 1] = 1; m_outputStrides[NumDims - 1] = 1; - for (int i = NumDims - 2; i >= 0; --i) { - m_leftStrides[i] = m_leftStrides[i+1] * lhs_dims[i+1]; - m_rightStrides[i] = m_rightStrides[i+1] * rhs_dims[i+1]; - m_outputStrides[i] = m_outputStrides[i+1] * m_dimensions[i+1]; + for (int j = NumDims - 2; j >= 0; --j) { + m_leftStrides[j] = m_leftStrides[j+1] * lhs_dims[j+1]; + m_rightStrides[j] = m_rightStrides[j+1] * rhs_dims[j+1]; + m_outputStrides[j] = m_outputStrides[j+1] * m_dimensions[j+1]; } } } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h index 59b70ad5c..a513f1891 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h @@ -142,15 +142,15 @@ struct TensorEvaluator<const TensorImagePatchOp<Rows, Cols, ArgType>, Device> switch (op.padding_type()) { case PADDING_VALID: - m_outputRows = ceil((m_inputRows - op.patch_rows() + 1.f) / static_cast<float>(m_row_strides)); - m_outputCols = ceil((m_inputCols - op.patch_cols() + 1.f) / static_cast<float>(m_col_strides)); + m_outputRows = std::ceil((m_inputRows - op.patch_rows() + 1.f) / static_cast<float>(m_row_strides)); + m_outputCols = std::ceil((m_inputCols - op.patch_cols() + 1.f) / static_cast<float>(m_col_strides)); // Calculate the padding m_rowPaddingTop = ((m_outputRows - 1) * m_row_strides + op.patch_rows() - m_inputRows) / 2; m_colPaddingLeft = ((m_outputCols - 1) * m_col_strides + op.patch_cols() - m_inputCols) / 2; break; case PADDING_SAME: - m_outputRows = ceil(m_inputRows / static_cast<float>(m_row_strides)); - m_outputCols = ceil(m_inputCols / static_cast<float>(m_col_strides)); + m_outputRows = std::ceil(m_inputRows / static_cast<float>(m_row_strides)); + m_outputCols = std::ceil(m_inputCols / static_cast<float>(m_col_strides)); // Calculate the padding m_rowPaddingTop = ((m_outputRows - 1) * m_row_strides + op.patch_rows() - m_inputRows) / 2; m_colPaddingLeft = ((m_outputCols - 1) * m_col_strides + op.patch_cols() - m_inputCols) / 2; |