From 21a8a2487c824e5ae05566f4fcc49540053b2702 Mon Sep 17 00:00:00 2001 From: "Maozhou, Ge" Date: Fri, 15 Jan 2021 11:51:49 +0800 Subject: fix paddings of TensorVolumePatchOp --- unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'unsupported') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h index 000ed5b41..81bed57f3 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h @@ -258,12 +258,12 @@ struct TensorEvaluator, D m_outputPlanes = numext::ceil(m_input_planes_eff / static_cast(m_plane_strides)); m_outputRows = numext::ceil(m_input_rows_eff / static_cast(m_row_strides)); m_outputCols = numext::ceil(m_input_cols_eff / static_cast(m_col_strides)); - const Index dz = m_outputPlanes * m_plane_strides + m_patch_planes_eff - 1 - m_input_planes_eff; - const Index dy = m_outputRows * m_row_strides + m_patch_rows_eff - 1 - m_input_rows_eff; - const Index dx = m_outputCols * m_col_strides + m_patch_cols_eff - 1 - m_input_cols_eff; - m_planePaddingTop = dz - dz / 2; - m_rowPaddingTop = dy - dy / 2; - m_colPaddingLeft = dx - dx / 2; + const Index dz = (m_outputPlanes - 1) * m_plane_strides + m_patch_planes_eff - m_input_planes_eff; + const Index dy = (m_outputRows - 1) * m_row_strides + m_patch_rows_eff - m_input_rows_eff; + const Index dx = (m_outputCols - 1) * m_col_strides + m_patch_cols_eff - m_input_cols_eff; + m_planePaddingTop = dz / 2; + m_rowPaddingTop = dy / 2; + m_colPaddingLeft = dx / 2; break; } default: -- cgit v1.2.3