Skip to content

Commit 4784673

Browse files
authored
【Hackathon No.89】 Remove circle import Part1 (#50677)
* modify the 'import' position * rollback * move 'from paddle.fluid.io import save_inference_model' to head of api.py
1 parent af3a067 commit 4784673

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

python/paddle/jit/api.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
)
7474
from paddle.fluid.framework import dygraph_only, _non_static_mode
7575
from paddle.fluid.wrapped_decorator import wrap_decorator
76+
from paddle.fluid.io import save_inference_model
7677

7778

7879
def create_program_from_desc(program_desc):
@@ -1159,8 +1160,6 @@ def fun(inputs):
11591160
)
11601161

11611162
# 5. save inference model
1162-
from paddle.fluid.io import save_inference_model
1163-
11641163
# construct new save_inference_model arguments
11651164
model_path = dirname
11661165
# NOTE(chenweihang): because prefix contains model and params filename,
@@ -1817,8 +1816,6 @@ def forward(self, input):
18171816
if dirname and not os.path.exists(dirname):
18181817
os.makedirs(dirname)
18191818

1820-
from paddle.fluid.io import save_inference_model
1821-
18221819
def get_feed_fetch(all_vars, partial_vars):
18231820
if partial_vars is None:
18241821
return all_vars

0 commit comments

Comments
 (0)