-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[PIR]Support set_dynamic_shape and refine DoValueCheck #59722
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
x = paddle.static.data('x', [2, 2], dtype='int8') | ||
out = paddle.pow(x, 2) | ||
|
||
self.assertRaises(ValueError, x_dtype_error) |
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.
C++端新增error类型后这里的error会修改为TypeError
paddle/fluid/pybind/pir.cc
Outdated
@@ -848,6 +848,33 @@ void BindType(py::module *m) { | |||
print_stream << self; | |||
return print_stream.str(); | |||
}); | |||
|
|||
m->def("set_shape", [](Type &type, const std::vector<int> &shape) -> Type { |
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.
这个叫create_shaped_type怎么样,感觉set_shape含义不够准确
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.
如果是动转静专用 api,感觉叫 update_shape_with 或者 replace_shape_with 是不是更准确一些?
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.
这里函数名改为了create_shaped_type,感觉这个名字准确一点
PR types
Others
PR changes
Others
Description
[PIR]Support set_dynamic_shape and refine DoValueCheck
Pcard-67164