Skip to content

Conversation

@reyoung
Copy link
Collaborator

@reyoung reyoung commented Oct 31, 2017

No description provided.

fetch_list=[avg_cost])
out = np.array(outs[0])

print out
Copy link
Collaborator

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

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

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

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

@reyoung
Copy link
Collaborator Author

reyoung commented Nov 27, 2017

Closed since code change too much, use #5932 instead.

@reyoung reyoung closed this Nov 27, 2017
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.

2 participants