-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Add API: Switch global program #5260
Conversation
@@ -71,6 +56,7 @@ | |||
fetch_list=[avg_cost]) | |||
out = np.array(outs[0]) | |||
|
|||
print out |
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.
Remove print?
g_program_dict = dict() | ||
|
||
|
||
def switch_g_program(prog, init_prog): |
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.
Is this API supposed to exposed to PaddlePaddle users? It might be dangerous to expose the fact that we are having two programs -- the main one and the initializer -- to the user at this moment.
I think it is reasonable to have the main program and the initializer program -- the former is like the main
function in C/C++, and the latter the C/C++ runtime entry point that initializes the global variables. It is just that we might expose only the main program to the users.
g_program_dict['init_program'] = init_prog | ||
|
||
|
||
def g_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.
g_program => main_program
It seems that the C/C++ code that initializes the global variables is known as "startup code", and the main function is known as the main program. https://gcc.gnu.org/ml/gcc-help/2007-07/msg00097.html
return g_program_dict['program'] | ||
|
||
|
||
def g_init_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.
g_init_program => startup_program
It seems that the C/C++ code that initializes the global variables is known as "startup code", and the main function is known as the main program. https://gcc.gnu.org/ml/gcc-help/2007-07/msg00097.html
Closed since code change too much, use #5932 instead. |
No description provided.