-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
预测原名Inference,包含Capi预测问题等原名Inference,包含Capi预测问题等
Description
Suggested by @qingqing01 , we may implement another Run()
in paddle/framework/executor.h which do the same things as the Run()
of Python Executor
.
Paddle/python/paddle/v2/fluid/executor.py
Lines 125 to 132 in 144854d
def run(self, | |
program=None, | |
feed=None, | |
fetch_list=None, | |
feed_var_name='feed', | |
fetch_var_name='fetch', | |
scope=None, | |
return_numpy=True): |
The interface maybe like and will do following things:
void Run(const ProgramDesc& program,
Scope* scope,
std::map<std::string, Tensor>& feeds,
std::map<std::string, Tensor>& fetchs,
std::string& feed_var_name="feed",
std::string& fetch_var_name="fetch") {
1. clone the program
2. prepend feed_op
3. set feed variables
4. append fetch_op
5. call Run(const ProgramDesc&, Scope*, int, bool create_local_scope = true, bool create_vars = true)
6. get fetch variables
}
So that we can directly Run
both in Python API and C++ API.
luotao1, kexinzhao, sidgoyal78 and tonyyang-svail
Metadata
Metadata
Assignees
Labels
预测原名Inference,包含Capi预测问题等原名Inference,包含Capi预测问题等