[0-size Tensor Job2 No.2、3、10] Add 0-size Tensor support for equal_all [fluid_ops]#73550
[0-size Tensor Job2 No.2、3、10] Add 0-size Tensor support for equal_all [fluid_ops]#73550DanielSun11 merged 8 commits intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (65.38%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #73550 +/- ##
==========================================
Coverage ? 65.38%
==========================================
Files ? 7
Lines ? 26
Branches ? 0
==========================================
Hits ? 17
Misses ? 9
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/re-run all-failed |
| np.testing.assert_allclose(static_out[0], infer_out) | ||
|
|
||
|
|
||
| class TestBincountOp_ZeroSize(TestBincountOp): |
There was a problem hiding this comment.
TestBincountOp的def test_check_output(self): self.check_output(check_pir=True, check_symbol_infer=False) 。没有检查symbol_infer导致覆盖不到paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/binary_infer_sym.cc:285新增的代码。请重载这个方法并开启check_symbol_infer
|
/re-run all-failed |
|
/re-run all-failed |
|
涉及到infer_symbolic_shape的修改,请 @luotao1 协调云飞再次review |

PR Category
Operator Mechanism
PR Types
Bug fixes
Description
2 paddle.add_n

修改infermeta, 符号推导,如果多个维度中有一个维度为0,结果维度设置为0,如果都不为0,比较是否相等
修改前向,如果输出维度为0返回
增加单测
PaddleAPITest中是对输入broadcast后使用torch.stack实现
PaddleAPITest 测试通过

3 paddle.bincount
修改infermeta,符号推导,如果输入维度为0,不比较weight对应维度是否相同
修改kernel,如果输入维度为0,输出大小为minlength,同时用0填充
PaddleAPITest测试通过

10 paddle.equal_all
修改kernel,如果x numel为0,填充True,kernel已有shape是否相等的判断
torch返回为True
PaddleAPITest测试通过
