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

Update grad_op_builder after refactoring framework proto. #7

Merged

Conversation

qingqing01
Copy link
Collaborator

The input_format and output_format can be removed.

  • pass unit test grad_op_builder_test
  • pass unit test operator_test

std::string dst_name = is_grad ? GradVarName(src_name) : src_name;
for (auto& var_name : src_inout.at(src_name)) {
std::string s = is_grad ? GradVarName(var_name)
: (arg.no_gradient() ? kEmptyVarName : var_name);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If arg.no_gradient && !is_grad, just continue the outter loop.

kEmptyVarName is not needed. If map does not have that key, it means that input is empty.

for (auto& var_name : src_inout.at(src_name)) {
std::string s = is_grad ? GradVarName(var_name)
: (arg.no_gradient() ? kEmptyVarName : var_name);
dst_inout[dst_name].emplace_back(s);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems that the vector should be reserve before?

@wangkuiyi wangkuiyi merged commit 5f6e5ed into wangkuiyi:refactorize_framework_proto Aug 9, 2017
@wangkuiyi
Copy link
Owner

I merged it so to accelerate the overall process. Let's fix @reyoung 's comments in following PRs.

@qingqing01 qingqing01 deleted the grad_op_builder branch March 7, 2018 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants