Skip to content

Conversation

0x45f
Copy link
Contributor

@0x45f 0x45f commented Dec 5, 2023

PR types

Others

PR changes

Others

Description

[PIR]Support set_dynamic_shape and refine DoValueCheck
Pcard-67164

Copy link

paddle-bot bot commented Dec 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.

x = paddle.static.data('x', [2, 2], dtype='int8')
out = paddle.pow(x, 2)

self.assertRaises(ValueError, x_dtype_error)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

C++端新增error类型后这里的error会修改为TypeError

@@ -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 {
Copy link
Contributor

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含义不够准确

Copy link
Contributor

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 是不是更准确一些?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里函数名改为了create_shaped_type,感觉这个名字准确一点

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.

4 participants