Skip to content
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ ignore = [
"UP031",
"C408",
"UP030",
"F522",
"F403",
"C405",
"C417",
"PLR0402",
Expand Down
47 changes: 42 additions & 5 deletions python/paddle/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,48 @@

# import all class inside framework into base module
from . import framework
from .framework import * # noqa: F403
from .framework import (
Program,
default_startup_program,
default_main_program,
program_guard,
name_scope,
ipu_shard_guard,
set_ipu_shard,
cuda_places,
cpu_places,
xpu_places,
cuda_pinned_places,
in_dygraph_mode,
in_pir_mode,
in_dynamic_or_pir_mode,
is_compiled_with_cinn,
is_compiled_with_cuda,
is_compiled_with_rocm,
is_compiled_with_xpu,
Variable,
require_version,
device_guard,
set_flags,
get_flags,
)

# import all class inside executor into base module
from . import executor
from .executor import * # noqa: F403
from .executor import (
Executor,
global_scope,
scope_guard,
)

from . import data_feed_desc
from .data_feed_desc import * # noqa: F403
from .data_feed_desc import DataFeedDesc

from . import dataset
from .dataset import * # noqa: F403
from .dataset import (
DatasetFactory,
InMemoryDataset,
)

from . import trainer_desc

Expand Down Expand Up @@ -72,7 +103,13 @@

from . import unique_name
from . import compiler
from .compiler import * # noqa: F403
from .compiler import (
CompiledProgram,
ExecutionStrategy,
BuildStrategy,
IpuCompiledProgram,
IpuStrategy,
)
from paddle.base.layers.math_op_patch import monkey_patch_variable
from .dygraph.base import enable_dygraph, disable_dygraph
from .dygraph.tensor_patch_methods import monkey_patch_tensor
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/base/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def to_list(s):
# assign tensor alias
libpaddle.LoDTensor = libpaddle.Tensor

from .libpaddle import *
from .libpaddle import * # noqa: F403
from .libpaddle import ( # noqa: F401
__doc__,
__file__,
Expand Down
13 changes: 11 additions & 2 deletions python/paddle/base/dygraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@
# limitations under the License.

from . import base
from .base import * # noqa: F403
from .base import (
no_grad,
no_grad_,
grad,
guard,
enable_dygraph,
disable_dygraph,
enabled,
to_variable,
)

from . import tracer
from .tracer import * # noqa: F403
from .tracer import Tracer


__all__ = []
Expand Down
5 changes: 4 additions & 1 deletion python/paddle/base/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

from paddle.base.log_helper import get_logger
from . import reader
from .reader import *
from .reader import ( # noqa: F401
PyReader,
DataLoader,
)

__all__ = reader.__all__

Expand Down