-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Feature/switch program #5932
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
Feature/switch program #5932
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`
global _main_program_ | ||
prev_program = _main_program_ | ||
_main_program_ = program | ||
return prev_program |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, why return prev_program
, not _main_program_
? We are switch to a new program, not previous one
Get default main program. The main program is used for training or testing. | ||
|
||
Returns: | ||
Program: main program |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need this default_main_program()
function, not use _main_program_
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Second step of #5929.
Fix #5929.
Please review #5930 first.