-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[NewIR]modify Fill any like optest #56961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NewIR]modify Fill any like optest #56961
Conversation
… fill_constant
你的PR提交成功,感谢你对开源项目的贡献! |
… fill_constant
… fill_constant
python/paddle/tensor/creation.py
Outdated
@@ -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(): |
There was a problem hiding this comment.
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统一?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
python/paddle/ir/core.py
Outdated
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 = { |
There was a problem hiding this comment.
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就可以了
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个后面我们也可以考虑统一
PR types
Bug fixes
PR changes
others
Description
pcard-67164
修复fill_any_like 新ir测试(适配python api, vartype -> datatype 的转换)