Skip to content

Conversation

pkuyym
Copy link
Contributor

@pkuyym pkuyym commented Jan 15, 2018

Resolves #7478

Copy link
Contributor

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

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

LGTM

if (inputs.find("In") != inputs.end() && !Inputs("In").empty()) {
in_var_ptr = scope.FindVar(Input("In"));
printed_var_name = Inputs("In").front();
} else if (inputs.find("In@GRAD") != inputs.end() &&
Copy link
Contributor

Choose a reason for hiding this comment

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

In@GRAD -> some const string variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To use the same PrintOp in forward and backward, I just rename the input in GradOpMaker. We can judge whether current phase is forward or backward using the name.
op_desc_ptr->SetInput("In@GRAD", OutputGrad("Out"));

@pkuyym pkuyym merged commit 60eba8b into PaddlePaddle:develop Jan 15, 2018
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