Feature/switch program#5932
Merged
reyoung merged 13 commits intoPaddlePaddle:developfrom Nov 30, 2017
Merged
Conversation
Change books just use `import fluid`, not submodules
Use default_main_program/default_startup_program instead
* Two functions: switch_main_program/switch_startup_program * A guard: program_guard. Users can use the `with` statement change default programs * Change unittests in `test_layers`
QiJune
reviewed
Nov 29, 2017
| global _main_program_ | ||
| prev_program = _main_program_ | ||
| _main_program_ = program | ||
| return prev_program |
Member
There was a problem hiding this comment.
Here, why return prev_program, not _main_program_? We are switch to a new program, not previous one
QiJune
reviewed
Nov 29, 2017
| Get default main program. The main program is used for training or testing. | ||
|
|
||
| Returns: | ||
| Program: main program |
Member
There was a problem hiding this comment.
Why we need this default_main_program() function, not use _main_program_ directly?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second step of #5929.
Fix #5929.
Please review #5930 first.