-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Cleanup][B-4] clean some paddle.base.dygraph.to_variable for test #61793
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
需要按照模板重新填写下 PR 描述,另外 PR 描述里应该包含 tracking issue,PR 标题应该符合 tracking issue 里的模式,都需要调整下,可参考其它 PR
当前不需要处理 |
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.
以及
- 标题没改
- 没链 tracking issue
- 描述改的不对,仍然不符合模板,在没有确定内容之前不要随便删模板内容,模板内容在这里 https://github.com/PaddlePaddle/Paddle/blob/develop/.github/PULL_REQUEST_TEMPLATE.md?plain=1
@@ -31,8 +31,8 @@ def compare(self): | |||
b = np.array([[1.0 + 1.0j, 1.0 + 1.0j]]).astype(self._dtype) | |||
|
|||
with dg.guard(): | |||
x = dg.to_variable(a, "x") | |||
y = dg.to_variable(b) | |||
x = paddle.to_tensor(a, "x") |
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.
两者签名分别如下
def to_variable(value, name=None, zero_copy=None, dtype=None): ...
def to_tensor(data, dtype=None, place=None, stop_gradient=True): ...
这里将原来的 name 传递到 dtype 了,name 参数在这里无用,删掉吧
x = dg.to_variable(a, "x") | ||
y = dg.to_variable(b) | ||
x = paddle.to_tensor(a, "x") | ||
y = paddle.to_tensor(b) | ||
out = paddle.add(x, y) | ||
self.assertIsNotNone(f"{out}") |
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.
这个 assert 删掉吧,没啥用,f"{out}"
永远不可能为 None
var_x = dg.to_variable(x) | ||
var_y = dg.to_variable(y) | ||
var_x = paddle.to_tensor(x) | ||
var_y = paddle.to_tensor(x) |
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.
var_y = paddle.to_tensor(x) | |
var_y = paddle.to_tensor(y) |
paddle.base.dygraph.to_variable
for test
paddle.base.dygraph.to_variable
for testThere 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
Others
PR changes
Others
Description
B4
@gouzil