-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Simpily demo, add paddle.default_main_program() and paddle.default_startup_program() #5615
Conversation
5f1c9eb
to
349c078
Compare
python/paddle/v2/__init__.py
Outdated
@@ -35,8 +35,12 @@ | |||
import image | |||
import model | |||
import paddle.trainer.config_parser as cp | |||
import paddle.v2.framework.framework.default_startup_program as default_startup_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.
v2这个应该不用修改,目前重构的代码都在 framework下
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.
嗯,确认下是这样用吗:paddle.framework.default_startup_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.
Will we publish our new API under framework
? It is a little strange that our refactorization API all put into framework directory.
def default_startup_program(): | ||
return g_startup_program | ||
|
||
def default_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 to wrap the main program into a global function....
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 explains: #5614
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.
okay..
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.
The only one concern is the default_startup_program location. Other parts look good to me.
…artup_program - Removed all main_program and startup_program in the demo. - Using paddle.default_main_program() hides the implementation detail (e.g., using g_main_program) from the user, we can change the implementation in the future much easier.
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.
Fixes: #5614 #5305 #5301