From 3a53872f739b75d9fd91d5ffafda6c1c86d535cc Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 3 Jul 2020 11:18:35 +0800 Subject: [PATCH] fix(dnn/native): also fix native logic GitOrigin-RevId: a80f090271d86dada59d5f21cc92e6a609cac562 --- dnn/src/naive/deformable_ps_roi_pooling/opr_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dnn/src/naive/deformable_ps_roi_pooling/opr_impl.cpp b/dnn/src/naive/deformable_ps_roi_pooling/opr_impl.cpp index 643e06668..e8c04fa24 100644 --- a/dnn/src/naive/deformable_ps_roi_pooling/opr_impl.cpp +++ b/dnn/src/naive/deformable_ps_roi_pooling/opr_impl.cpp @@ -293,7 +293,7 @@ void Fwd::exec(_megdnn_tensor_in data, _megdnn_tensor_in rois, float trans_std = param.trans_std, scale = param.spatial_scale; size_t nr_bbox = rois.layout[0]; - size_t nr_cls = no_trans ? 1 : trans.layout[0]; + size_t nr_cls = no_trans ? 1 : trans.layout[1] / 2; size_t IC = data.layout[1], IH = data.layout[2], IW = data.layout[3]; const float* data_ptr = data.ptr(); @@ -339,7 +339,7 @@ void Bwd::exec(_megdnn_tensor_in data, _megdnn_tensor_in rois, float trans_std = param.trans_std, scale = param.spatial_scale; size_t nr_bbox = rois.layout[0]; - size_t nr_cls = no_trans ? 1 : trans.layout[0]; + size_t nr_cls = no_trans ? 1 : trans.layout[1] / 2; size_t IC = data.layout[1], IH = data.layout[2], IW = data.layout[3]; const float* data_ptr = data.ptr(); -- GitLab