Fixed the delegate memory ownership issue w/ the benchmark model tool.

PiperOrigin-RevId: 302360006
Change-Id: I5cb9bd50463448d96076f27a864b939ca30e72f8
This commit is contained in:
Chao Mei 2020-03-22 21:59:17 -07:00 committed by TensorFlower Gardener
parent 85b36ef350
commit 0c487d6417
2 changed files with 3 additions and 0 deletions

View File

@ -646,6 +646,7 @@ TfLiteStatus BenchmarkTfLiteModel::Init() {
<< " delegate, and the model graph will be "
<< delegate_status << " executed w/ the delegate.";
}
owned_delegates_.emplace_back(std::move(delegate));
}
auto interpreter_inputs = interpreter_->inputs();

View File

@ -119,6 +119,8 @@ class BenchmarkTfLiteModel : public BenchmarkModel {
std::unique_ptr<BenchmarkListener> profiling_listener_ = nullptr;
std::unique_ptr<BenchmarkListener> ruy_profiling_listener_ = nullptr;
std::mt19937 random_engine_;
std::vector<Interpreter::TfLiteDelegatePtr> owned_delegates_;
};
} // namespace benchmark