Skip to content
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

Merged
merged 6 commits into from
Nov 15, 2017

Conversation

helinwang
Copy link
Contributor

  • 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.

Fixes: #5614 #5305 #5301

@@ -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
Copy link
Member

Choose a reason for hiding this comment

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

v2这个应该不用修改,目前重构的代码都在 framework下

Copy link
Contributor Author

@helinwang helinwang Nov 14, 2017

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()

Copy link
Contributor

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():
Copy link
Contributor

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....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here explains: #5614

Copy link
Contributor

Choose a reason for hiding this comment

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

okay..

dzhwinter
dzhwinter previously approved these changes Nov 14, 2017
Copy link
Contributor

@dzhwinter dzhwinter left a 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.
Copy link
Contributor

@dzhwinter dzhwinter left a comment

Choose a reason for hiding this comment

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

LGTM.

@helinwang helinwang merged commit 3d74615 into PaddlePaddle:develop Nov 15, 2017
@helinwang helinwang deleted the demo branch November 15, 2017 00:01
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.

None yet

3 participants