2020-03-23 22:01:54 +08:00
|
|
|
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
2022-06-05 10:58:58 +08:00
|
|
|
# TODO: import framework api under this directory
|
2020-04-20 10:47:23 +08:00
|
|
|
|
2023-09-07 17:26:19 +08:00
|
|
|
from ..base import core # noqa: F401
|
2023-10-11 01:28:34 +08:00
|
|
|
from ..base.core import ( # noqa: F401
|
|
|
|
|
CPUPlace,
|
|
|
|
|
CUDAPinnedPlace,
|
|
|
|
|
CUDAPlace,
|
|
|
|
|
CustomPlace,
|
|
|
|
|
IPUPlace,
|
2025-03-24 16:09:58 +08:00
|
|
|
XPUPinnedPlace,
|
2023-10-11 01:28:34 +08:00
|
|
|
XPUPlace,
|
|
|
|
|
)
|
2024-02-23 22:06:57 +08:00
|
|
|
from ..base.dygraph import base # noqa: F401
|
2023-12-18 16:33:48 +08:00
|
|
|
from ..base.dygraph.base import ( # noqa: F401
|
|
|
|
|
disable_dygraph as enable_static,
|
|
|
|
|
enable_dygraph as disable_static,
|
|
|
|
|
grad,
|
|
|
|
|
no_grad_ as no_grad,
|
|
|
|
|
)
|
2023-10-11 01:28:34 +08:00
|
|
|
from ..base.framework import ( # noqa: F401
|
|
|
|
|
Block,
|
|
|
|
|
IrGraph,
|
|
|
|
|
OpProtoHolder,
|
|
|
|
|
Parameter,
|
|
|
|
|
Program,
|
|
|
|
|
_apply_pass,
|
|
|
|
|
_create_tensor,
|
|
|
|
|
_current_expected_place,
|
2023-10-18 15:17:01 +08:00
|
|
|
_current_expected_place_,
|
2023-10-11 01:28:34 +08:00
|
|
|
_dygraph_tracer,
|
|
|
|
|
_get_paddle_place,
|
|
|
|
|
_global_flags,
|
|
|
|
|
_set_expected_place,
|
|
|
|
|
_stride_in_no_check_dy2st_diff as _no_check_dy2st_diff,
|
|
|
|
|
convert_np_dtype_to_dtype_,
|
|
|
|
|
deprecate_stat_dict,
|
|
|
|
|
disable_signal_handler,
|
|
|
|
|
dygraph_not_support,
|
|
|
|
|
dygraph_only,
|
|
|
|
|
generate_control_dev_var_name,
|
|
|
|
|
get_flags,
|
2023-12-18 16:33:48 +08:00
|
|
|
in_dygraph_mode as in_dynamic_mode,
|
2023-10-11 01:28:34 +08:00
|
|
|
in_dynamic_or_pir_mode,
|
2024-07-05 14:05:27 +08:00
|
|
|
in_pir_executor_mode,
|
2023-10-11 01:28:34 +08:00
|
|
|
in_pir_mode,
|
|
|
|
|
set_flags,
|
|
|
|
|
switch_main_program,
|
|
|
|
|
switch_startup_program,
|
|
|
|
|
use_pir_api,
|
|
|
|
|
)
|
|
|
|
|
from ..base.layer_helper import LayerHelper # noqa: F401
|
2023-12-18 16:33:48 +08:00
|
|
|
from .io import async_save, clear_async_save_task_queue # noqa: F401
|
2023-03-08 10:36:50 +08:00
|
|
|
|
2023-10-11 01:28:34 +08:00
|
|
|
# isort: off
|
2023-04-25 11:25:13 +08:00
|
|
|
# Do the *DUPLICATED* monkey-patch for the tensor object.
|
|
|
|
|
# We need remove the duplicated code here once we fix
|
|
|
|
|
# the illogical implement in the monkey-patch methods later.
|
2023-10-11 01:28:34 +08:00
|
|
|
from ..base.dygraph.math_op_patch import monkey_patch_math_tensor # noqa: F401
|
2025-08-16 01:37:34 +08:00
|
|
|
|
2023-10-11 01:28:34 +08:00
|
|
|
from ..base.layers.math_op_patch import monkey_patch_variable # noqa: F401
|
2022-02-22 15:07:11 +08:00
|
|
|
|
2023-10-11 01:28:34 +08:00
|
|
|
# isort: on
|
|
|
|
|
from ..base.param_attr import ParamAttr # noqa: F401
|
|
|
|
|
from . import random # noqa: F401
|
|
|
|
|
from .framework import get_default_dtype, set_default_dtype # noqa: F401
|
|
|
|
|
from .io import load, save # noqa: F401
|
|
|
|
|
from .io_utils import ( # noqa: F401
|
|
|
|
|
_clone_var_in_block_,
|
|
|
|
|
_load_program_scope,
|
|
|
|
|
_open_file_buffer,
|
|
|
|
|
_pack_loaded_dict,
|
|
|
|
|
_pickle_loads_mac,
|
|
|
|
|
_unpack_saved_dict,
|
|
|
|
|
is_belong_to_optimizer,
|
|
|
|
|
is_parameter,
|
|
|
|
|
is_persistable,
|
|
|
|
|
)
|
|
|
|
|
from .random import seed # noqa: F401
|
2022-04-08 14:39:01 +08:00
|
|
|
|
2021-04-29 19:31:40 +08:00
|
|
|
__all__ = []
|