From 77e3ccfa41f82d948f184cc7bcab5c4b08359bd6 Mon Sep 17 00:00:00 2001 From: ooooo <3164076421@qq.com> Date: Fri, 15 Sep 2023 19:48:46 +0800 Subject: [PATCH] enable F522 --- pyproject.toml | 1 - python/paddle/base/framework.py | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index edc174738481b2..fbc60adfc6d3a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,7 +110,6 @@ ignore = [ "C408", "UP030", "F403", - "F522", "B010", "PLR1722", "UP028", diff --git a/python/paddle/base/framework.py b/python/paddle/base/framework.py index 7709599c25468e..04bea2109890e8 100644 --- a/python/paddle/base/framework.py +++ b/python/paddle/base/framework.py @@ -3200,7 +3200,7 @@ def _to_readable_code(self, skip_op_callstack=True): if attr_type == core.AttrType.VAR: attr_var_name = self.desc.attr(name, True).name() a = "{name} = Var['{value}']".format( - name=name, type=attr_type, value=attr_var_name + name=name, value=attr_var_name ) attrs_str += a if i != len(attr_names) - 1: @@ -3212,7 +3212,7 @@ def _to_readable_code(self, skip_op_callstack=True): "'%s'" % var.name() for var in self.desc.attr(name, True) ] a = "{name} = Vars[{value}]".format( - name=name, type=attr_type, value=','.join(attr_var_names) + name=name, value=','.join(attr_var_names) ) attrs_str += a if i != len(attr_names) - 1: @@ -3221,7 +3221,7 @@ def _to_readable_code(self, skip_op_callstack=True): if attr_type == core.AttrType.BLOCK: a = "{name} = block[{value}]".format( - name=name, type=attr_type, value=self._block_attr_id(name) + name=name, value=self._block_attr_id(name) ) attrs_str += a if i != len(attr_names) - 1: @@ -3230,7 +3230,7 @@ def _to_readable_code(self, skip_op_callstack=True): if attr_type == core.AttrType.BLOCKS: a = "{name} = blocks{value}".format( - name=name, type=attr_type, value=self._blocks_attr_ids(name) + name=name, value=self._blocks_attr_ids(name) ) attrs_str += a if i != len(attr_names) - 1: @@ -3254,9 +3254,7 @@ def _to_readable_code(self, skip_op_callstack=True): else: value = self.desc.attr(name) - a = "{name} = {value}".format( - name=name, type=attr_type, value=value - ) + a = "{name} = {value}".format(name=name, value=value) attrs_str += a if i != len(attr_names) - 1: