Skip to content
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

[CodeStyle][PLR0206] Cannot have defined parameters for properties #52539

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ select = [
# "PLE2514",
# "PLE2515",
# "PLR0133",
# "PLR0206",
"PLR0206",
"PLR0402",
# "PLR0911",
# "PLR0912",
Expand Down
11 changes: 0 additions & 11 deletions test/dygraph_to_static/simnet_dygraph_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import paddle
import paddle.fluid.param_attr as attr
from paddle.common_ops_import import Variable
from paddle.jit.api import to_static
from paddle.nn import Layer

Expand Down Expand Up @@ -363,16 +362,6 @@ def _build_once(self, input):
attr=self._bias_attr, shape=size, dtype=self._dtype, is_bias=True
)

# TODO(songyouwei): We should remove _w property
@property
def _w(self, i=0):
return self.__w[i]

@_w.setter
def _w(self, value, i=0):
assert isinstance(self.__w[i], Variable)
self.__w[i].set_value(value)

@property
def weight(self):
if len(self.__w) > 1:
Expand Down
11 changes: 0 additions & 11 deletions test/dygraph_to_static/simnet_dygraph_model_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from functools import reduce

import paddle
from paddle.common_ops_import import Variable


class EmbeddingLayer:
Expand Down Expand Up @@ -349,16 +348,6 @@ def _build_once(self, input):
attr=self._bias_attr, shape=size, dtype=self._dtype, is_bias=True
)

# TODO(songyouwei): We should remove _w property
@property
def _w(self, i=0):
return self.__w[i]

@_w.setter
def _w(self, value, i=0):
assert isinstance(self.__w[i], Variable)
self.__w[i].set_value(value)

@property
def weight(self):
if len(self.__w) > 1:
Expand Down