Skip to content

Conversation

@gouzil
Copy link
Member

@gouzil gouzil commented Dec 5, 2023

PR types

Others

PR changes

Others

Description

test/legacy_test/test_model.py 好像没跑动转静,我就直接删除了

相关链接:

@paddle-bot
Copy link

paddle-bot bot commented Dec 5, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Dec 5, 2023
Copy link
Contributor

@DrRyanHuang DrRyanHuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work! 🍢🍢YYDS! LGTM

SigureMo
SigureMo previously approved these changes Dec 7, 2023
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改写一下吧,尽可能不要加缩进

def train():
    ...

def test_xxx():
    with guard(False):
        train()

    train()

Comment on lines 69 to 82
with enable_to_static_guard(True):
model_path = os.path.join(self.temp_dir.name, 'multi_program')
paddle.jit.save(model, model_path, combine_params=True)
place = paddle.CPUPlace()
if paddle.is_compiled_with_cuda():
place = paddle.CUDAPlace(0)
jit_layer = Layer()
jit_layer.load(model_path, place)
forward_out2 = jit_layer.forward(x)
infer_out2 = jit_layer.infer(x)
np.testing.assert_allclose(
forward_out1, forward_out2[0], rtol=1e-05
)
np.testing.assert_allclose(infer_out1, infer_out2[0], rtol=1e-05)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这块不需要 with enable_to_static_guard(True):

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow

@SigureMo SigureMo merged commit 389da7d into PaddlePaddle:develop Dec 15, 2023
@gouzil gouzil deleted the dy2st_with_enable_to_static_46_49 branch December 27, 2023 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants