Repository navigation
[CodeStyle][F821] fix remaining F821 issues - #47968
Merged
Merged
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
SigureMo
commented
Nov 14, 2022
|
|
||
|
|
||
| def _set_item(t, i, e, np_dtype): | ||
| def _set_item(t, i, e, np_dtype, place): |
Collaborator
Author
There was a problem hiding this comment.
69 行使用了 place 但没有传递进来,因此这里加一下 place
|
|
||
| if dtype == paddle.float32 or dtype == paddle.int32: | ||
| dtype_factor = 4 | ||
| elif node.dtype == paddle.int64: |
Collaborator
Author
There was a problem hiding this comment.
和第一个 if 一样,这里应该就是 dtype,不需要 node.dtype
| print(paddle.jit.to_static(vlist_of_dict)(x)) | ||
|
|
||
| def test4(self): | ||
| import numpy as np |
Collaborator
Author
There was a problem hiding this comment.
这里是否 import 不影响测试效果,因为 test2、3 也加了,所以这里就加上了
| # Ignore undefined variables in CMake config and some dygraph_to_static tests | ||
| .cmake-format.py: F821 | ||
| python/paddle/fluid/tests/unittests/dygraph_to_static/test_loop.py: F821 | ||
| python/paddle/fluid/tests/unittests/dygraph_to_static/test_closure_analysis.py: F821 |
Collaborator
Author
There was a problem hiding this comment.
.cmake-format.py 配置里的 section 确实不存在,所以可以 ignore 掉
部分动转静单测需要测试的一些用例存在 F821 问题,所以也可以在这里直接 ignore 掉
luotao1
approved these changes
Nov 15, 2022
SigureMo
added a commit
to gouzil/Paddle
that referenced
this pull request
Jun 29, 2024
SigureMo
added a commit
to gouzil/Paddle
that referenced
this pull request
Jun 29, 2024
This reverts commit 05b4c5e.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR types
Others
PR changes
Others
Describe
本 PR 消除剩余全部 21 个 Flake8 F821 错误码(undefined variables)
noqa: F821方式、配置里 ignore 掉本 PR 含配置修改,无需额外修改配置
Related links
namecattidea/paddle-flake8-project#79parameterizedrelated code #47869