-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
simplify inference api #11104
simplify inference api #11104
Conversation
// Create variables | ||
// TODO(panyx0718): Why need to test share_variables here? | ||
if (config_.share_variables) { | ||
executor_->CreateVariables(*inference_program_, scope_.get(), 0); |
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.
why is this deleted?
@@ -124,7 +118,7 @@ bool NativePaddlePredictor::Run(const std::vector<PaddleTensor> &inputs, | |||
scope_.get(), | |||
&feed_targets, | |||
&fetch_targets, | |||
!config_.share_variables); | |||
true /*create_variable*/); |
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.
if share_variable is true, this should be false by default?
// API. | ||
// TODO(Superjomn) this should be modified when `Clone` is valid for | ||
// multi-thread application. | ||
executor_->CreateVariables(*inference_program_, scope_.get(), 0); |
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.
I've restored the CreateVariable here. @panyx0718
int device; | ||
float fraction_of_gpu_memory; | ||
int device{0}; | ||
float fraction_of_gpu_memory{-1.f}; // Negative to notify initialization. |
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.
I suggest the default one to be a workable value.
No description provided.