Skip to content

Conversation

@Xreki
Copy link
Contributor

@Xreki Xreki commented Apr 4, 2018

In #9000, the basic Executor.Run was split into two low-level functions, Executor.Prepare and Executor.RunPreparedContext. In Executor.Prepare, operators are created in advance and saved in a ExecutorPrepareContext. We can always call Executor.RunPreparedContext to use the ExecutorPrepareContext instead to avoid frequently creating and destroying of operators if there is no change to the program.

For inference, a high level Executor.Run is defined for direct use in C++ inference codes. We should also provide a corresponding high level Executor.RunPreparedContext if users want to avoid the cost of frequently creating and destroying of operators.

@Xreki Xreki added the 预测 原名Inference,包含Capi预测问题等 label Apr 4, 2018
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

可以在第一个comment里面补充一些这个PR的背景么,即为什么要拆分成两个?

"'%s' variable should be 'FEED_MINIBATCH' type",
feed_holder_name);
if (!feed_holder_name.empty()) {
// When feed operator are present, so should be feed_holder
Copy link
Contributor

Choose a reason for hiding this comment

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

  • When feed operators are present
  • so should be feed_holder缺少主语?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这似乎是一种英语句法:https://zhidao.baidu.com/question/6942604.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这似乎是一种英语句法:https://zhidao.baidu.com/question/6942604.html


executor.Run(*inference_program, scope, feed_targets, fetch_targets);
if (PrepareContext) {
// Note: if you changed the inference_program, you need to call
Copy link
Contributor

Choose a reason for hiding this comment

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

changed->change

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.

@Xreki Xreki force-pushed the core_inference_prepare branch from 31516c8 to 449bdde Compare April 12, 2018 08:17
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 2c552d4 into PaddlePaddle:develop Apr 13, 2018
@Xreki Xreki deleted the core_inference_prepare branch November 14, 2018 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

预测 原名Inference,包含Capi预测问题等

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants