Skip to content

Conversation

typhoonzero
Copy link
Contributor

Provide another fix to #10626 (review)

@typhoonzero typhoonzero requested review from Xreki and Yancey0623 May 15, 2018 10:35
Yancey0623
Yancey0623 previously approved these changes May 15, 2018
Copy link
Contributor

@Yancey0623 Yancey0623 left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM!!

std::map<std::string, const LoDTensor*>* feed_targets,
std::map<std::string, LoDTensor*>* fetch_targets,
bool create_vars, const std::string& feed_holder_name,
bool create_local_scope, bool create_vars,
Copy link
Contributor

@Xreki Xreki May 15, 2018

Choose a reason for hiding this comment

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

  • create_varsfalse时,create_local_scopetrue或者false都没有意义啦,不会再创建local_scope
  • create_varstrue时,同时创建local_scope比较好。
  • 这个接口目前应该只有inference用到,用户对于是否创建local_scope没有必要感知。你们需要调用到这个接口吗?如果不需要的话,就暂时不要加这个参数吧。。。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我觉得保持接口一致会比较友好,开始是计划去掉create_vars这个参数,不过inference看起来也在用了,所以就保留了和Run一致的接口。如果create_local_scopecreate_vars总是同时为true的话,是否可以改成一个参数:create_local_scope_and_vars?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done merging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

发现merge这两个参数之后会有问题,while_op中用了create_local_scope=false并且并且create_vars=true还是revert到两个参数的版本了。

std::map<std::string, const LoDTensor*>* feed_targets,
std::map<std::string, LoDTensor*>* fetch_targets, bool create_vars,
const std::string& feed_holder_name, const std::string& fetch_holder_name) {
std::map<std::string, LoDTensor*>* fetch_targets, bool create_local_scope,
Copy link
Contributor

Choose a reason for hiding this comment

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

同上。。。

Copy link
Contributor

@Yancey0623 Yancey0623 left a comment

Choose a reason for hiding this comment

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

LGTM

@typhoonzero typhoonzero merged commit ebc7303 into PaddlePaddle:develop May 18, 2018
@typhoonzero typhoonzero deleted the remove_create_vars_in_executor branch May 18, 2018 02:21
chen2016013 pushed a commit to chen2016013/Paddle that referenced this pull request Jun 6, 2025
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.

3 participants