未验证 提交 b731fb82 编写于 作者: R risemeup1 提交者: GitHub

[Fluid Clean]move inplace_apis_indygraph_only from...

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

* move inplace_apis_indygraph_only from paddle.flud.dygraph.inplace_utils to paddle.utils

* modify conflict

* modify conflict

* modify conflict

* modify conflict

* modify conflict

* modify conflict

* modify conflict

* modify static-check ci error

* fix conflict

* modify failed tests

* fix conflict

* fix conflict

* fix pool2d examples

* modify conflict

* fix failed tests

* fix conflict

* fix failed tests

* modfiy problem of deleting pool2d
上级 e89a50c1
...@@ -51,8 +51,6 @@ from .amp import * ...@@ -51,8 +51,6 @@ from .amp import *
from .math_op_patch import monkey_patch_math_varbase from .math_op_patch import monkey_patch_math_varbase
from .inplace_utils import inplace_apis_in_dygraph_only
__all__ = [] __all__ = []
__all__ += layers.__all__ __all__ += layers.__all__
__all__ += base.__all__ __all__ += base.__all__
......
...@@ -30,6 +30,7 @@ from ..framework import ( ...@@ -30,6 +30,7 @@ from ..framework import (
in_dygraph_mode, in_dygraph_mode,
_in_legacy_dygraph, _in_legacy_dygraph,
) )
from ..data_feeder import ( from ..data_feeder import (
convert_dtype, convert_dtype,
check_variable_and_dtype, check_variable_and_dtype,
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops, in_dynamic_mode from paddle import _C_ops, _legacy_C_ops, in_dynamic_mode
from paddle.framework import core 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.data_feeder import check_dtype, check_variable_and_dtype
from ...fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only
from ...fluid.framework import ( from ...fluid.framework import (
_in_legacy_dygraph, _in_legacy_dygraph,
convert_np_dtype_to_dtype_, convert_np_dtype_to_dtype_,
......
...@@ -20,6 +20,7 @@ import numpy as np ...@@ -20,6 +20,7 @@ import numpy as np
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops 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 ..common_ops_import import _varbase_creator, fill_constant
from ..fluid.data_feeder import ( from ..fluid.data_feeder import (
...@@ -28,7 +29,6 @@ from ..fluid.data_feeder import ( ...@@ -28,7 +29,6 @@ from ..fluid.data_feeder import (
check_variable_and_dtype, check_variable_and_dtype,
convert_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.framework import _in_legacy_dygraph, _non_static_mode
from ..fluid.layers import utils from ..fluid.layers import utils
from ..framework import ( from ..framework import (
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
""" """
math functions math functions
""" """
# TODO: define math functions # TODO: define math functions
import numpy as np import numpy as np
...@@ -23,13 +22,15 @@ import paddle ...@@ -23,13 +22,15 @@ import paddle
from paddle import _C_ops, _legacy_C_ops from paddle import _C_ops, _legacy_C_ops
from paddle.common_ops_import import VarDesc, dygraph_only, dygraph_utils 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 ( from ..fluid.data_feeder import (
check_dtype, check_dtype,
check_type, check_type,
check_variable_and_dtype, check_variable_and_dtype,
convert_dtype, convert_dtype,
) )
from ..fluid.dygraph.inplace_utils import inplace_apis_in_dygraph_only
from ..fluid.layers import elementwise_sub, utils from ..fluid.layers import elementwise_sub, utils
from ..framework import ( from ..framework import (
LayerHelper, LayerHelper,
......
# 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"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from ..wrapped_decorator import wrap_decorator
from ..framework import _non_static_mode
import warnings import warnings
import paddle import paddle
from paddle import _C_ops, _legacy_C_ops 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` # NOTE(pangyoki): The Inplace APIs with underline(`_`) is only valid for the method of calling `_C_ops`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册