Skip to content
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
7 changes: 0 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ ignore = [
# Ignore unnecessary lambda in dy2st unittest test_lambda
"test/dygraph_to_static/test_lambda.py" = ["PLC3002"]

# Temporarily ignored
"python/paddle/base/**" = [
"B019", # Confirmation required
"C416",
"F821",
]

# B017
"test/auto_parallel/spmd_rules/test_reshape_rule.py" = ["B017"]
"test/dygraph_to_static/test_assert.py" = ["B017"]
Expand Down
11 changes: 7 additions & 4 deletions python/paddle/base/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,11 @@ def _can_use_interpreter_core(program, place):
return True


@lru_cache()
def _warning_once(msg):
logging.warning(msg)


class FetchHandler:
def __init__(self, var_dict=None, period_secs=60):
assert var_dict is not None
Expand Down Expand Up @@ -1177,10 +1182,8 @@ def _add_micro_scopes_cache(self, program_cache_key, micro_scopes: list):
def _get_micro_scopes_cache(self, program_cache_key):
return self.micro_scope_cache.get(program_cache_key, None)

# just for testing, will be removed later
@lru_cache()
def _log_force_set_program_cache(self, use_program_cache):
logging.warning(
_warning_once(
f"use_program_cache is force set to {use_program_cache} by FLAGS_FORCE_USE_PROGRAM_CACHE"
)

Expand Down Expand Up @@ -2722,7 +2725,7 @@ def _run_using_fleet_executor(
if return_numpy:
tensor = as_numpy(tensor)
else:
tensor = [t for t in tensor]
tensor = list(tensor)

if tensor:
scope_result_list.append(tensor)
Expand Down
1 change: 1 addition & 0 deletions python/paddle/base/variable_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import itertools
import warnings
from functools import reduce

import numpy as np

Expand Down