未验证 提交 ea8aa432 编写于 作者: H hwa 提交者: GitHub

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

上级 2236286c
...@@ -96,7 +96,7 @@ select = [ ...@@ -96,7 +96,7 @@ select = [
# "PLE2514", # "PLE2514",
# "PLE2515", # "PLE2515",
# "PLR0133", # "PLR0133",
# "PLR0206", "PLR0206",
"PLR0402", "PLR0402",
# "PLR0911", # "PLR0911",
# "PLR0912", # "PLR0912",
......
...@@ -16,7 +16,6 @@ from functools import reduce ...@@ -16,7 +16,6 @@ from functools import reduce
import paddle import paddle
import paddle.fluid.param_attr as attr import paddle.fluid.param_attr as attr
from paddle.common_ops_import import Variable
from paddle.jit.api import to_static from paddle.jit.api import to_static
from paddle.nn import Layer from paddle.nn import Layer
...@@ -363,16 +362,6 @@ class FC(Layer): ...@@ -363,16 +362,6 @@ class FC(Layer):
attr=self._bias_attr, shape=size, dtype=self._dtype, is_bias=True 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 @property
def weight(self): def weight(self):
if len(self.__w) > 1: if len(self.__w) > 1:
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
from functools import reduce from functools import reduce
import paddle import paddle
from paddle.common_ops_import import Variable
class EmbeddingLayer: class EmbeddingLayer:
...@@ -349,16 +348,6 @@ class FC(paddle.nn.Layer): ...@@ -349,16 +348,6 @@ class FC(paddle.nn.Layer):
attr=self._bias_attr, shape=size, dtype=self._dtype, is_bias=True 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 @property
def weight(self): def weight(self):
if len(self.__w) > 1: if len(self.__w) > 1:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册