[2] Review comments handled

This commit is contained in:
ANSHUMAN TRIPATHY 2019-03-29 23:54:39 +05:30
parent 155e74fc4d
commit a3e0328146
2 changed files with 24 additions and 2 deletions

View File

@ -176,6 +176,21 @@ void SingleOpModel::Invoke() { ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); }
TfLiteStatus SingleOpModel::InvokeUnchecked() { return interpreter_->Invoke(); }
void SingleOpModel::BuildInterpreter(
std::vector<std::vector<int>> input_shapes) {
BuildInterpreter(input_shapes, -1, false);
}
void SingleOpModel::BuildInterpreter(std::vector<std::vector<int>> input_shapes,
int num_threads) {
BuildInterpreter(input_shapes, num_threads, false);
}
void SingleOpModel::BuildInterpreter(std::vector<std::vector<int>> input_shapes,
bool allow_fp32_relax_to_fp16) {
BuildInterpreter(input_shapes, -1, allow_fp32_relax_to_fp16);
}
// static
void SingleOpModel::SetForceUseNnapi(bool use_nnapi) {
force_use_nnapi = use_nnapi;

View File

@ -250,8 +250,15 @@ class SingleOpModel {
// Build the interpreter for this model. Also, resize and allocate all
// tensors given the shapes of the inputs.
void BuildInterpreter(std::vector<std::vector<int>> input_shapes,
int num_threads = -1,
bool allow_fp32_relax_to_fp16 = false);
int num_threads, bool allow_fp32_relax_to_fp16);
void BuildInterpreter(std::vector<std::vector<int>> input_shapes,
int num_threads);
void BuildInterpreter(std::vector<std::vector<int>> input_shapes,
bool allow_fp32_relax_to_fp16);
void BuildInterpreter(std::vector<std::vector<int>> input_shapes);
// Executes inference, asserting success.
void Invoke();