Skip to content

Conversation

@Manfredss
Copy link
Contributor

@Manfredss Manfredss commented Dec 31, 2025

PR Category

User Experience

PR Types

New features

Description

add param alias for paddle.deg2rad

@paddle-bot
Copy link

paddle-bot bot commented Dec 31, 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 Dec 31, 2025
Removed commented-out implementation and documentation for the tangent operator.
@codecov-commenter
Copy link

codecov-commenter commented Jan 1, 2026

Codecov Report

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

Files with missing lines Patch % Lines
python/paddle/tensor/math.py 66.66% 4 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   #77168   +/-   ##
==========================================
  Coverage           ?   66.66%           
==========================================
  Files              ?        1           
  Lines              ?       12           
  Branches           ?        0           
==========================================
  Hits               ?        8           
  Misses             ?        4           
  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

@Manfredss Manfredss changed the title [API Compatibility No.361、378] cpp sink for tan, param alias for deg2rad -part [API Compatibility No.359、378] cpp sink for tan, param alias for deg2rad -part Jan 1, 2026
if in_dynamic_or_pir_mode():
if convert_dtype(x.dtype) in ['int32', 'int64']:
x = cast(x, dtype="float32")
if out is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

_C_ops会自动处理out=None的情况,无需再额外判断,直接透传。

args_mapper :
func : ArgSumMapper

- op : tan
Copy link
Contributor

Choose a reason for hiding this comment

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

tan已经下沉了,这个PR不用再改了。只用修改deg2rad即可。

zhwesky2010
zhwesky2010 previously approved these changes Jan 12, 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
Copy link
Contributor

看看CI问题

x = cast(x, dtype="float32")
return _C_ops.scale(x, deg2rad_scale, 0.0, True)
_C_ops.scale(x, deg2rad_scale, 0.0, True, out=out)
return out
Copy link
Contributor

Choose a reason for hiding this comment

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

这个return看起来不太对?直接return _C_ops.scale(x, deg2rad_scale, 0.0, True, out=out)

@zhwesky2010 zhwesky2010 changed the title [API Compatibility No.359、378] cpp sink for tan, param alias for deg2rad -part [API Compatibility No.359、378] param alias for deg2rad -part Jan 13, 2026
@CLAassistant
Copy link

CLAassistant commented Jan 13, 2026

CLA assistant check
All committers have signed the CLA.

@Manfredss
Copy link
Contributor Author

/re-run all-failed

if convert_dtype(x.dtype) in ['int32', 'int64']:
x = cast(x, dtype="float32")
return _C_ops.scale(x, deg2rad_scale, 0.0, True)
if in_pir_mode():
Copy link
Contributor

Choose a reason for hiding this comment

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

不用区分pir了,dygraph测out就行。

这里直接:return _C_ops.scale(x, deg2rad_scale, 0.0, True, out=out)


# Test out
out = paddle.zeros([1], dtype="float32")
res = paddle.deg2rad(x, 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.

PIR无需测out

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