Skip to content

Conversation

jacquesqiao
Copy link
Member

@jacquesqiao jacquesqiao commented Oct 11, 2017

project: #4679
fix: #4694

wangkuiyi
wangkuiyi previously approved these changes Oct 11, 2017
const OperatorBase& forwardOp,
const std::unordered_set<std::string>& no_grad_vars);

// TODO(someone): Add target as parameter and generate backward op
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's assign this TODO to some specific person when we create it.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

py::return_value_policy::reference)
.def("append_block", &ProgramDescBind::AppendBlock,
py::return_value_policy::reference)
.def("backward",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think append_backward is a better name. backward means the process that executes gradient op one by one, not append them.

Copy link
Member Author

Choose a reason for hiding this comment

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

done


self.assertEqual(len(block.all_ops()), 1)
prog.backward(set())
self.assertEqual(len(block.all_ops()), 3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add more check here to make sure additional ops are exactly what we want.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@JiayiFeng JiayiFeng left a comment

Choose a reason for hiding this comment

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

LGTM

@jacquesqiao jacquesqiao merged commit 5e9d439 into PaddlePaddle:develop Oct 11, 2017
reyoung added a commit to reyoung/Paddle that referenced this pull request Oct 11, 2017
…backward"

This reverts commit 5e9d439, reversing
changes made to 134a073.
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.

expose backward of ProgramDesc

3 participants