Skip to content

Conversation

@Manfredss
Copy link
Contributor

PR Category

User Experience

PR Types

New features

Description

Param alias for paddle.lerp using decorator
Add out param

@paddle-bot
Copy link

paddle-bot bot commented Jan 1, 2026

你的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 Jan 1, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@a977b32). Learn more about missing BASE report.

Files with missing lines Patch % Lines
python/paddle/tensor/math.py 66.66% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (66.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   #77170   +/-   ##
==========================================
  Coverage           ?   66.66%           
==========================================
  Files              ?        1           
  Lines              ?        6           
  Branches           ?        0           
==========================================
  Hits               ?        4           
  Misses             ?        2           
  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.

@Manfredss
Copy link
Contributor Author

/re-run all-failed

zhwesky2010
zhwesky2010 previously approved these changes Jan 5, 2026
Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 requested a review from SigureMo January 5, 2026 11:49
if in_dynamic_or_pir_mode():
return _C_ops.lerp(x, y, weight)
if out is None:
return _C_ops.lerp(x, y, weight)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个为何不采用下沉的方式

@zhwesky2010 zhwesky2010 self-requested a review January 5, 2026 11:55
SigureMo
SigureMo previously approved these changes Jan 5, 2026
if in_dynamic_or_pir_mode():
return _C_ops.lerp(x, y, weight)
if out is None:
return _C_ops.lerp(x, y, weight)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个看起来是可以直接采用下沉的方式。再看看吧。

@zhwesky2010 zhwesky2010 self-requested a review January 7, 2026 10:05
weight = paddle.full(shape=[], fill_value=weight, dtype=x.dtype)

if in_dynamic_or_pir_mode():
return _C_ops.lerp(x, y, weight)
Copy link
Contributor

Choose a reason for hiding this comment

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

如果out非None,这里没有处理。这里其实不需要处理,因为_C_ops里面自己会处理是否为None的情况

if in_dynamic_or_pir_mode():
return _C_ops.lerp(x, y, weight)
if out is None:
return _C_ops.lerp(x, y, weight, out=out)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个可以看下ops.yaml里,使用 Scalar(double) weight 的形式能否下沉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

没太理解,可以稍微解释一下吗

Copy link
Contributor

Choose a reason for hiding this comment

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

没太理解,可以稍微解释一下吗

下沉的主要问题是这个weight可以传float或Tensor,paddle内部内型Scalar可以接收Tensor以及任意的float/int/double等scalar类型,所以可以将op参数改成Scalar类型。这个你可以试一下,参考下allclose就是用scalar实现的,但是还需要改kernel的参数类型,不排除有兼容性问题。如果有问题就还是用装饰器。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants