[CPU] fix coverity issue in multiclass and a bug in matrix_nms (#17180)

* fix coverity issue in multiclass_nms

Signed-off-by: Hu Yuan2 <yuan2.hu@intel.com>

* fix issue in matrix_nms.cpp

Signed-off-by: Hu Yuan2 <yuan2.hu@intel.com>

---------

Signed-off-by: Hu Yuan2 <yuan2.hu@intel.com>
This commit is contained in:
Yuan Hu
2023-05-04 16:34:56 +08:00
committed by GitHub
parent bc6402fb27
commit 88c154953e
2 changed files with 2 additions and 2 deletions

View File

@@ -376,7 +376,7 @@ void MatrixNms::execute(dnnl::stream strm) {
// NMS-alike nodes are always transformed to NMSIEInternal node in case of legacy api, for compatibility.
// And on the other hand in case of api 2.0, keep them internal dynamic for better performance and functionality.
if (isDynamicNode()) {
if (!m_outStaticShape) {
size_t totalBox = std::accumulate(m_numPerBatch.begin(), m_numPerBatch.end(), size_t(0));
redefineOutputMemory({{totalBox, 6}, {totalBox, 1}, {m_numBatches}});
}

View File

@@ -166,7 +166,7 @@ void MultiClassNms::prepareParams() {
} else {
m_numBatches = boxes_dims[0];
}
m_numBoxes = shared ? boxes_dims[1] : boxes_dims[1];
m_numBoxes = boxes_dims[1];
m_numClasses = shared ? scores_dims[1] : scores_dims[0];
int max_output_boxes_per_class = 0;