Skip to content

Commit

Permalink
[CodeStyle][PLR0206] Cannot have defined parameters for properties (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yllhwa authored Apr 5, 2023
1 parent 2236286 commit ea8aa43
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
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

0 comments on commit ea8aa43

Please sign in to comment.