Skip to content

Conversation

xiaoguoguo626807
Copy link
Contributor

PR types

Bug fixes

PR changes

others

Description

pcard-67164
修复fill_any_like 新ir测试(适配python api, vartype -> datatype 的转换)

@paddle-bot
Copy link

paddle-bot bot commented Sep 5, 2023

你的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.

@xiaoguoguo626807 xiaoguoguo626807 changed the title Fill any like 【NewIR】modify Fill any like optest Sep 5, 2023
@@ -822,6 +823,16 @@ def full_like(x, fill_value, dtype=None, name=None):
[[2. 2. 2.]
[2. 2. 2.]]
"""

if in_new_ir_mode():
Copy link
Contributor

@0x45f 0x45f Sep 7, 2023

Choose a reason for hiding this comment

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

修改一下convert_np_dtype_to_dtype_内部的逻辑这里应该可以和下面的in_dynamic_mode统一?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

from paddle.base.libpaddle import DataType
from paddle.base.libpaddle.ir import Program, set_global_program

from ..base.wrapped_decorator import signature_safe_contextmanager

vartype_int_to_datatype_int = {
Copy link
Contributor

Choose a reason for hiding this comment

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

python 支持对enum 自动转型,只需要下面的vartype_to_datatype就可以了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

if in_dynamic_mode():
return _C_ops.full_like(x, fill_value, dtype, x.place)
elif in_new_ir_mode():
place = _current_expected_place()
Copy link
Contributor

Choose a reason for hiding this comment

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

这个后面我们也可以考虑统一

@Aurelius84 Aurelius84 changed the title 【NewIR】modify Fill any like optest [NewIR]modify Fill any like optest Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants