Skip to content

Use for_test=True in the Fluid Trainer to clone the test program #11323

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

Merged
merged 3 commits into from
Jun 8, 2018

Conversation

jetfuel
Copy link
Contributor

@jetfuel jetfuel commented Jun 8, 2018

As @qingqing01 and @panyx0718 suggested, use for_test=True when cloning the test program.

@@ -115,7 +115,7 @@ def __init__(self,
program_func_outs = train_func()
self.train_func_outputs = program_func_outs if isinstance(
program_func_outs, list) else [program_func_outs]
self.test_program = self.train_program.clone()
self.test_program = self.train_program.clone(for_test=True)

# The fisrt element of program_func_outs is loss.
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: can you also fix the comment? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure thing.

@jetfuel jetfuel requested a review from kexinzhao June 8, 2018 20:47
Copy link
Contributor

@kexinzhao kexinzhao left a comment

Choose a reason for hiding this comment

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

LGTM

@jetfuel
Copy link
Contributor Author

jetfuel commented Jun 8, 2018

This should fix #11299

@jetfuel jetfuel merged commit 637827a into PaddlePaddle:develop Jun 8, 2018
@jetfuel jetfuel deleted the trainerProgramCloneForTest branch June 8, 2018 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants