Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fluid Clean]move inplace_apis_indygraph_only from paddle.flud.dygraph.inplace_utils to paddle.utils #48744

Merged
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
2 changes: 0 additions & 2 deletions python/paddle/fluid/dygraph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@

from .math_op_patch import monkey_patch_math_varbase

from .inplace_utils import inplace_apis_in_dygraph_only

__all__ = []
__all__ += layers.__all__
__all__ += base.__all__
Expand Down
1 change: 1 addition & 0 deletions python/paddle/fluid/dygraph/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
in_dygraph_mode,
_in_legacy_dygraph,
)

from ..data_feeder import (
convert_dtype,
check_variable_and_dtype,
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/nn/functional/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import paddle
from paddle import _C_ops, _legacy_C_ops, in_dynamic_mode
from paddle.framework import core
from paddle.utils.inplace_utils import inplace_apis_in_dygraph_only

from ...fluid.data_feeder import check_dtype, check_variable_and_dtype
from ...fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only
from ...fluid.framework import (
_in_legacy_dygraph,
convert_np_dtype_to_dtype_,
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.utils.inplace_utils import inplace_apis_in_dygraph_only

from ..common_ops_import import _varbase_creator, fill_constant
from ..fluid.data_feeder import (
Expand All @@ -28,7 +29,6 @@
check_variable_and_dtype,
convert_dtype,
)
from ..fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only
from ..fluid.framework import _in_legacy_dygraph, _non_static_mode
from ..fluid.layers import utils
from ..framework import (
Expand Down
5 changes: 3 additions & 2 deletions python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"""
math functions
"""

# TODO: define math functions

import numpy as np
Expand All @@ -23,13 +22,15 @@
from paddle import _C_ops, _legacy_C_ops
from paddle.common_ops_import import VarDesc, dygraph_only, dygraph_utils

# TODO: define math functions
from paddle.utils.inplace_utils import inplace_apis_in_dygraph_only

from ..fluid.data_feeder import (
check_dtype,
check_type,
check_variable_and_dtype,
convert_dtype,
)
from ..fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only
from ..fluid.layers import elementwise_sub, utils
from ..framework import (
LayerHelper,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2022 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.
Expand All @@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from ..wrapped_decorator import wrap_decorator
from ..framework import _non_static_mode
import warnings
import paddle
from paddle import _C_ops, _legacy_C_ops
from paddle.fluid.framework import _non_static_mode
from paddle.fluid.wrapped_decorator import wrap_decorator


# NOTE(pangyoki): The Inplace APIs with underline(`_`) is only valid for the method of calling `_C_ops`
Expand Down