未验证 提交 41da96c8 编写于 作者: A Aurelius84 提交者: GitHub

[Fluid clean]Migrate base/call/print et.al transformer into paddle.jit (#48513)

* [Fluid clean]Migrate base/call/print et.al transformer into paddle.jit

* fix phi kernel

* Revert "fix phi kernel"

This reverts commit eff8891c7efda6e49799edbcaef2ca50379d50ef.
上级 16562a9d
......@@ -21,7 +21,8 @@ import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid.dygraph.dygraph_to_static.logical_transformer import (
from paddle.jit import ProgramTranslator
from paddle.jit.dy2static.logical_transformer import (
cmpop_node_to_str,
)
from paddle.jit import ProgramTranslator
......
......@@ -18,7 +18,7 @@ from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
......@@ -18,7 +18,7 @@
# See details in https://github.com/serge-sans-paille/gast/
import os
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
from .early_return_transformer import (
......@@ -27,47 +27,47 @@ from .early_return_transformer import (
from .assert_transformer import (
AssertTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.basic_api_transformer import (
from .basic_api_transformer import (
BasicApiTransformer,
)
from .break_continue_transformer import (
BreakContinueTransformer,
BreakTransformOptimizer,
)
from paddle.fluid.dygraph.dygraph_to_static.call_transformer import (
from .call_transformer import (
CallTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.cast_transformer import (
from .cast_transformer import (
CastTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.typehint_transformer import (
from .typehint_transformer import (
TypeHintTransformer,
)
from .ifelse_transformer import (
IfElseTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.logical_transformer import (
from .logical_transformer import (
LogicalTransformer,
)
from .loop_transformer import (
LoopTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.print_transformer import (
from .print_transformer import (
PrintTransformer,
)
from .return_transformer import (
ReturnTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.create_variable_transformer import (
from .create_variable_transformer import (
CreateVariableTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
StaticAnalysisVisitor,
)
from paddle.fluid.dygraph.dygraph_to_static.tensor_shape_transformer import (
from .tensor_shape_transformer import (
TensorShapeTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.decorator_transformer import (
from .decorator_transformer import (
DecoratorTransformer,
)
......
......@@ -14,25 +14,17 @@
from paddle.utils import gast
from paddle.fluid import unique_name
from paddle.fluid.dygraph.dygraph_to_static.utils import get_attribute_full_name
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code
from paddle.fluid.dygraph.dygraph_to_static.utils import create_assign_node
from paddle.fluid.dygraph.dygraph_to_static.utils import ORIGI_INFO
from paddle.fluid.dygraph.dygraph_to_static.utils import FOR_ITER_INDEX_PREFIX
from paddle.fluid.dygraph.dygraph_to_static.utils import FOR_ITER_TUPLE_PREFIX
from paddle.fluid.dygraph.dygraph_to_static.utils import (
FOR_ITER_TUPLE_INDEX_PREFIX,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import FOR_ITER_VAR_LEN_PREFIX
from paddle.fluid.dygraph.dygraph_to_static.utils import (
ORIGI_INFO,
FOR_ITER_INDEX_PREFIX,
FOR_ITER_VAR_LEN_PREFIX,
FOR_ITER_TARGET_PREFIX,
FOR_ITER_VAR_NAME_PREFIX,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import (
FOR_ITER_ZIP_TO_LIST_PREFIX,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import FOR_ITER_TARGET_PREFIX
from paddle.fluid.dygraph.dygraph_to_static.utils import (
FOR_ITER_ITERATOR_PREFIX,
create_assign_node,
ast_to_source_code,
get_attribute_full_name,
)
......
......@@ -19,7 +19,7 @@ from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
)
from paddle.fluid.dygraph.dygraph_to_static import utils
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code
......
......@@ -20,10 +20,10 @@ from paddle.fluid.dygraph.dygraph_to_static.utils import BaseNodeVisitor
from paddle.fluid.dygraph.dygraph_to_static.variable_trans_func import (
create_bool_node,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
ForNodeVisitor,
)
......
......@@ -19,7 +19,7 @@ from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
)
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code
from paddle.fluid.dygraph.dygraph_to_static.utils import is_paddle_api
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
......@@ -18,7 +18,7 @@ from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
......@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from paddle.utils import gast
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
)
......@@ -22,7 +21,7 @@ from paddle.fluid.dygraph.dygraph_to_static.utils import (
from paddle.fluid.dygraph.dygraph_to_static.variable_trans_func import (
create_undefined_var,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
......@@ -17,19 +17,17 @@ from paddle.utils import gast
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import (
create_funcDef_node,
RE_PYNAME,
RE_PYMODULE,
ast_to_source_code,
is_paddle_api,
Dygraph2StaticException,
)
import warnings
import re
from paddle.fluid.dygraph.dygraph_to_static.utils import RE_PYNAME, RE_PYMODULE
IGNORE_NAMES = [
'declarative',
......
......@@ -16,7 +16,7 @@ from paddle.utils import gast
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
......@@ -39,7 +39,7 @@ from paddle.fluid.dygraph.dygraph_to_static.utils import (
create_get_args_node,
create_set_args_node,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import (
......
......@@ -14,7 +14,7 @@
from paddle.utils import gast
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
......@@ -35,15 +35,12 @@ from paddle.fluid.dygraph.dygraph_to_static.utils import (
FunctionNameLivenessAnalysis,
)
from .ifelse_transformer import ARGS_NAME
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
ForLoopTuplePreTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
ForNodeVisitor,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import (
GetterSetterHelper,
create_name_str,
......
......@@ -18,7 +18,7 @@ from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
StaticAnalysisVisitor,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
......@@ -20,7 +20,7 @@ from .break_continue_transformer import (
ForToWhileTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
from paddle.fluid.dygraph.dygraph_to_static.utils import Dygraph2StaticException
......
......@@ -18,7 +18,7 @@ from paddle.fluid.dygraph.dygraph_to_static.utils import ast_to_source_code
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
)
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
......@@ -12,14 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from paddle.utils import gast
import warnings
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import (
AstNodeWrapper,
)
from paddle.fluid.dygraph.dygraph_to_static import utils
from paddle.fluid.dygraph.dygraph_to_static.base_transformer import (
from .base_transformer import (
BaseTransformer,
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册