__init__.py 4.8 KB
Newer Older
1
#   Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
2
#   Copyright (c) 2021 NVIDIA Corporation. All rights reserved.
3 4 5 6 7 8 9 10 11 12 13 14 15
#
# 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.

16 17
import os

18 19
from . import amp  # noqa: F401
from . import nn  # noqa: F401
20 21 22

from .nn.common import py_func  # noqa: F401

23 24 25 26 27 28 29 30 31
from .io import save_inference_model  # noqa: F401
from .io import load_inference_model  # noqa: F401
from .io import deserialize_persistables  # noqa: F401
from .io import serialize_persistables  # noqa: F401
from .io import deserialize_program  # noqa: F401
from .io import serialize_program  # noqa: F401
from .io import load_from_file  # noqa: F401
from .io import save_to_file  # noqa: F401
from .io import normalize_program  # noqa: F401
32 33 34 35 36 37 38
from .io import is_persistable  # noqa: F401
from .io import save_vars  # noqa: F401
from .io import load_vars  # noqa: F401
from .io import save  # noqa: F401
from .io import load  # noqa: F401
from .io import load_program_state  # noqa: F401
from .io import set_program_state  # noqa: F401
39 40 41
from ..fluid import Scope  # noqa: F401
from .input import data  # noqa: F401
from .input import InputSpec  # noqa: F401
42
from .input import setitem  # noqa: F401
43 44

from ..tensor.creation import create_parameter  # noqa: F401
45
from ..tensor.creation import create_global_var  # noqa: F401
46

47 48 49 50 51 52 53
from ..fluid.executor import Executor  # noqa: F401
from ..fluid.executor import global_scope  # noqa: F401
from ..fluid.executor import scope_guard  # noqa: F401
from ..fluid.backward import append_backward  # noqa: F401
from ..fluid.backward import gradients  # noqa: F401
from ..fluid.compiler import BuildStrategy  # noqa: F401
from ..fluid.compiler import CompiledProgram  # noqa: F401
J
jianghaicheng 已提交
54 55
from ..fluid.compiler import IpuCompiledProgram  # noqa: F401
from ..fluid.compiler import IpuStrategy  # noqa: F401
56 57 58 59
from ..fluid.compiler import ExecutionStrategy  # noqa: F401
from ..fluid.framework import default_main_program  # noqa: F401
from ..fluid.framework import default_startup_program  # noqa: F401
from ..fluid.framework import device_guard  # noqa: F401
60

61 62 63 64 65
from ..fluid.framework import name_scope  # noqa: F401
from ..fluid.framework import cpu_places  # noqa: F401
from ..fluid.framework import cuda_places  # noqa: F401
from ..fluid.framework import xpu_places  # noqa: F401
from ..fluid.framework import Variable  # noqa: F401
66 67
from ..fluid.framework import Operator  # noqa: F401
from ..fluid.framework import Parameter  # noqa: F401
J
jianghaicheng 已提交
68
from ..fluid.framework import ipu_shard_guard  # noqa: F401
69
from ..fluid.framework import set_ipu_shard  # noqa: F401
Q
qizhaoaoe 已提交
70
from .nn.control_flow import Print  # noqa: F401
71
from ..fluid.param_attr import WeightNormParamAttr  # noqa: F401
72 73
from ..fluid.optimizer import Optimizer  # noqa: F401
from ..fluid.optimizer import Adam  # noqa: F401
74
from ..fluid.optimizer import ExponentialMovingAverage  # noqa: F401
75

76
from ..fluid.layers import exponential_decay  # noqa: F401
77
from ..fluid.layers import learning_rate_scheduler  # noqa: F401
78

79 80
from .nn.metric import auc  # noqa: F401
from .nn.metric import accuracy  # noqa: F401
81
from .nn.metric import ctr_metric_bundle  # noqa: F401
82

83 84 85 86 87 88 89 90 91
import paddle

if paddle.ir.core._use_new_ir_api():
    from ..ir import Program  # noqa: F401
    from ..ir import program_guard  # noqa: F401
else:
    from ..fluid.framework import program_guard  # noqa: F401
    from ..fluid.framework import Program  # noqa: F401

92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
__all__ = [  # noqa
    'append_backward',
    'gradients',
    'Executor',
    'global_scope',
    'scope_guard',
    'BuildStrategy',
    'CompiledProgram',
    'ipu_shard_guard',
    'IpuCompiledProgram',
    'IpuStrategy',
    'Print',
    'py_func',
    'ExecutionStrategy',
    'name_scope',
    'program_guard',
    'WeightNormParamAttr',
    'ExponentialMovingAverage',
    'default_main_program',
    'default_startup_program',
    'Program',
    'data',
    'InputSpec',
    'save',
    'load',
    'save_inference_model',
    'load_inference_model',
    'serialize_program',
    'serialize_persistables',
    'save_to_file',
    'deserialize_program',
    'deserialize_persistables',
    'load_from_file',
    'normalize_program',
    'load_program_state',
    'set_program_state',
    'cpu_places',
    'cuda_places',
    'xpu_places',
    'Variable',
    'create_global_var',
    'accuracy',
    'auc',
    'device_guard',
    'create_parameter',
    'set_ipu_shard',
    'ctr_metric_bundle',
    'exponential_decay',
140
]