[0-size Tensor Job2 No.106] Add 0-size Tensor support for roi_pool#73740
Merged
DanielSun11 merged 6 commits intoPaddlePaddle:developfrom Jul 9, 2025
Merged
[0-size Tensor Job2 No.106] Add 0-size Tensor support for roi_pool#73740DanielSun11 merged 6 commits intoPaddlePaddle:developfrom
DanielSun11 merged 6 commits intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Comment on lines
+118
to
+121
| int channels = x_dims[1]; | ||
| int height = x_dims[2]; | ||
| int width = x_dims[3]; | ||
| int rois_num = boxes.dims()[0]; |
Contributor
There was a problem hiding this comment.
这里不应该将int64_t改为int。因为对于大Tensor而言,任何一个维度的大小都有可能超过int的上限。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #73740 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 2
Lines ? 9
Branches ? 0
===========================================
Hits ? 9
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
请签署下CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Operator Mechanism
PR Types
Bug fixes
Description
roi_align函数输出Tensor的shape为 [box[0], input[1], pooled_height, pooled_width],其中pooled_height, pooled_width 是都要大于0,所以需要对 input和box的numel为0时进行特殊处理。
修复前,存在cuda error(9) 问题,需要进行修复。

修复:
cuda error(9) 报错修复:
使用--paddle_only 和 --accuracy 选项时,出现numpy error错误(不做处理)
pcard-67164