-
Notifications
You must be signed in to change notification settings - Fork 5.8k
listen_and_serv use local scope #10663
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
listen_and_serv use local scope #10663
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create_vars
为false
时,create_local_scope
为true
或者false
都没有意义啦,不会再创建local_scope
。create_vars
为true
时,同时创建local_scope
比较好。- 这个接口目前应该只有inference用到,用户对于是否创建
local_scope
没有必要感知。你们需要调用到这个接口吗?如果不需要的话,就暂时不要加这个参数吧。。。
There was a problem hiding this comment.
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_scope
和create_vars
总是同时为true的话,是否可以改成一个参数:create_local_scope_and_vars
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done merging
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上。。。
606e8c5
to
5db564f
Compare
… remove_create_vars_in_executor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Provide another fix to #10626 (review)