未验证 提交 f8c8538f 编写于 作者: W Wangzheee 提交者: GitHub

Update matrix_nms_compute.cc

上级 5c60f411
...@@ -274,7 +274,7 @@ void MatrixNmsCompute::Run() { ...@@ -274,7 +274,7 @@ void MatrixNmsCompute::Run() {
Tensor boxes_slice, scores_slice; Tensor boxes_slice, scores_slice;
size_t num_out = 0; size_t num_out = 0;
std::vector<size_t> offsets = {0}; std::vector<uint64_t> offsets = {0};
std::vector<float> detections; std::vector<float> detections;
std::vector<int> indices; std::vector<int> indices;
detections.reserve(out_dim * num_boxes * batch_size); detections.reserve(out_dim * num_boxes * batch_size);
...@@ -298,10 +298,10 @@ void MatrixNmsCompute::Run() { ...@@ -298,10 +298,10 @@ void MatrixNmsCompute::Run() {
post_threshold, post_threshold,
use_gaussian, use_gaussian,
gaussian_sigma); gaussian_sigma);
offsets.push_back(offsets.back() + num_out); offsets.push_back(offsets.back() + static_cast<uint64_t>(num_out));
} }
size_t num_kept = offsets.back(); uint64_t num_kept = offsets.back();
if (num_kept == 0) { if (num_kept == 0) {
outs->Resize({0, out_dim}); outs->Resize({0, out_dim});
index->Resize({0, 1}); index->Resize({0, 1});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册