[API Compatibility No.359] param alias for deg2rad -part#77168
[API Compatibility No.359] param alias for deg2rad -part#77168zhwesky2010 merged 15 commits intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Removed commented-out implementation and documentation for the tangent operator.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #77168 +/- ##
===========================================
Coverage ? 100.00%
===========================================
Files ? 1
Lines ? 3
Branches ? 0
===========================================
Hits ? 3
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/re-run all-failed |
python/paddle/tensor/math.py
Outdated
| if in_dynamic_or_pir_mode(): | ||
| if convert_dtype(x.dtype) in ['int32', 'int64']: | ||
| x = cast(x, dtype="float32") | ||
| if out is not None: |
There was a problem hiding this comment.
_C_ops会自动处理out=None的情况,无需再额外判断,直接透传。
| args_mapper : | ||
| func : ArgSumMapper | ||
|
|
||
| - op : tan |
There was a problem hiding this comment.
tan已经下沉了,这个PR不用再改了。只用修改deg2rad即可。
|
看看CI问题 |
… ApiEnhance361_378
python/paddle/tensor/math.py
Outdated
| 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 |
There was a problem hiding this comment.
这个return看起来不太对?直接return _C_ops.scale(x, deg2rad_scale, 0.0, True, out=out)
… ApiEnhance361_378
|
/re-run all-failed |
python/paddle/tensor/math.py
Outdated
| 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(): |
There was a problem hiding this comment.
不用区分pir了,dygraph测out就行。
这里直接:return _C_ops.scale(x, deg2rad_scale, 0.0, True, out=out)
test/legacy_test/test_deg2rad.py
Outdated
|
|
||
| # Test out | ||
| out = paddle.zeros([1], dtype="float32") | ||
| res = paddle.deg2rad(x, out=out) |
… ApiEnhance361_378
test/legacy_test/test_deg2rad.py
Outdated
| import os | ||
| import unittest | ||
|
|
||
| os.environ['FLAGS_enable_pir_api'] = '0' |
test/legacy_test/test_deg2rad.py
Outdated
| with paddle.static.program_guard(startup_program, train_program): | ||
| x = paddle.static.data(name='input', dtype='float32', shape=[1]) | ||
| out = paddle.static.data(name='out', dtype='float32', shape=[1]) | ||
| result = paddle.deg2rad(x, out=out) |
There was a problem hiding this comment.
静态图下你可以测下别名其他这些,out不用测
… ApiEnhance361_378
… ApiEnhance361_378
… ApiEnhance361_378
|
/re-run all-failed |
…e#77168) * cpp sink for tan, param alias for deg2rad * Remove commented-out tan function and its documentation Removed commented-out implementation and documentation for the tangent operator. * Refactor deg2rad function to simplify output handling * Update Python API information in yaml file * fix * increase coverage * fix tests for deg2rad * fix
PR Category
User Experience
PR Types
New features
Description
add param alias for paddle.deg2rad