diff --git a/pyproject.toml b/pyproject.toml index 8d847e53bd46672854d9f023ab7f31c54cc23fc9..8c27dfbe3328f4b0ab96570b4c7b556d6221f77c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,7 +96,7 @@ select = [ # "PLE2514", # "PLE2515", # "PLR0133", - # "PLR0206", + "PLR0206", "PLR0402", # "PLR0911", # "PLR0912", diff --git a/test/dygraph_to_static/simnet_dygraph_model.py b/test/dygraph_to_static/simnet_dygraph_model.py index c2bf12bc970c24f6ad76a3188a04e3de8c6ee053..341785a9d6a5a5c9a8ce13586d4a63ff33fcc11a 100644 --- a/test/dygraph_to_static/simnet_dygraph_model.py +++ b/test/dygraph_to_static/simnet_dygraph_model.py @@ -16,7 +16,6 @@ from functools import reduce 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 @@ -363,16 +362,6 @@ class FC(Layer): 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: diff --git a/test/dygraph_to_static/simnet_dygraph_model_v2.py b/test/dygraph_to_static/simnet_dygraph_model_v2.py index 55b95638e3c3b30318e57008c32fe942287653b9..e843f6b82e820f54d96e7fd74653bcbc2eaf4e23 100644 --- a/test/dygraph_to_static/simnet_dygraph_model_v2.py +++ b/test/dygraph_to_static/simnet_dygraph_model_v2.py @@ -15,7 +15,6 @@ from functools import reduce import paddle -from paddle.common_ops_import import Variable class EmbeddingLayer: @@ -349,16 +348,6 @@ class FC(paddle.nn.Layer): 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: