Skip to content

Conversation

@co63oc
Copy link
Contributor

@co63oc co63oc commented Jun 24, 2025

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

43 paddle.diag
修改infermeta,符号推导,如果size < 0, size = 0
修改kernel,如果out numel为0,Alloc后返回

PaddleAPITest测试通过
image

131 paddle.masked_fill
Job2 87 paddle.Tensor.masked_fill
输出维度是x,mask维度broadcast后的维度
反向填充0

torch测试填充为0

import torch
x=torch.randn([2,1,3])
x.requires_grad=True
y=torch.randn([2,0,3]).type(torch.bool)
v=torch.tensor(1.0)
v.requires_grad=True
out=torch.masked_fill(x, y, v)
out.sum().backward()
print(x.grad)
print(v.grad)

tensor([[[0., 0., 0.]],

        [[0., 0., 0.]]])
tensor(0.)

PaddleAPITest测试通过
image

@paddle-bot
Copy link

paddle-bot bot commented Jun 24, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Jun 24, 2025
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jun 24, 2025
@co63oc co63oc changed the title [0-size Tensor No.43] Add 0-size Tensor support for paddle.diag [0-size Tensor No.43、131] Add 0-size Tensor support for paddle.diag Jun 24, 2025
@co63oc co63oc changed the title [0-size Tensor No.43、131] Add 0-size Tensor support for paddle.diag [0-size Tensor No.43、131] Add 0-size Tensor support for paddle.diag/masked_fill Jun 25, 2025
@DanielSun11
Copy link
Contributor

请合一下最新的develop

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 26.66667% with 11 lines in your changes missing coverage. Please review.

Please upload report for BASE (develop@3efb8db). Learn more about missing BASE report.

Files with missing lines Patch % Lines
paddle/phi/kernels/cpu/masked_fill_grad_kernel.cc 12.50% 7 Missing ⚠️
paddle/phi/kernels/cpu/masked_fill_kernel.cc 33.33% 2 Missing ⚠️
.../interface/infer_symbolic_shape/unary_infer_sym.cc 0.00% 1 Missing ⚠️
paddle/phi/kernels/cpu/diag_grad_kernel.cc 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (26.66%) 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   #73570   +/-   ##
==========================================
  Coverage           ?   26.66%           
==========================================
  Files              ?        6           
  Lines              ?       15           
  Branches           ?        0           
==========================================
  Hits               ?        4           
  Misses             ?       11           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@co63oc
Copy link
Contributor Author

co63oc commented Jun 29, 2025

/re-run all-failed

1 similar comment
@co63oc
Copy link
Contributor Author

co63oc commented Jun 29, 2025

/re-run all-failed

Copy link
Contributor

@DanielSun11 DanielSun11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DanielSun11
Copy link
Contributor

涉及到符号推导的改动请 @luotao1 协调云飞看一下

@luotao1 luotao1 merged commit e991019 into PaddlePaddle:develop Jul 1, 2025
137 of 147 checks passed
@co63oc co63oc changed the title [0-size Tensor No.43、131] Add 0-size Tensor support for paddle.diag/masked_fill [0-size Tensor Job2 No.87] Add 0-size Tensor support for masked_fill Jul 2, 2025
@co63oc co63oc deleted the f46 branch July 10, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants