Drop InitGraphAndContextTensorData() from MicroAllocator.

This method is trivial and this file is easier to trace by just calling the two methods that it calls instead.

PiperOrigin-RevId: 318357169
Change-Id: Ib75aaaf67f4aa6908e5aabc7ce0fb7a84a87608e
This commit is contained in:
Nick Kreeger 2020-06-25 15:10:52 -07:00 committed by TensorFlower Gardener
parent f0b9d27774
commit aa1499f356
2 changed files with 2 additions and 14 deletions

View File

@ -612,8 +612,9 @@ TfLiteStatus MicroAllocator::StartModelAllocation(
TFLITE_DCHECK(subgraph != nullptr);
model_is_allocating_ = true;
TF_LITE_ENSURE_STATUS(AllocateTfLiteTensorArray(context, subgraph));
TF_LITE_ENSURE_STATUS(
InitGraphAndContextTensorData(model, context, subgraph));
PopulateTfLiteTensorArrayFromFlatbuffer(model, context, subgraph));
TF_LITE_ENSURE_STATUS(
AllocateNodeAndRegistrations(subgraph, node_and_registrations));
TF_LITE_ENSURE_STATUS(PrepareNodeAndRegistrationDataFromFlatbuffer(
@ -866,14 +867,6 @@ ErrorReporter* MicroAllocator::error_reporter() const {
return error_reporter_;
}
TfLiteStatus MicroAllocator::InitGraphAndContextTensorData(
const Model* model, TfLiteContext* context, const SubGraph* subgraph) {
TF_LITE_ENSURE_STATUS(AllocateTfLiteTensorArray(context, subgraph));
TF_LITE_ENSURE_STATUS(
PopulateTfLiteTensorArrayFromFlatbuffer(model, context, subgraph));
return kTfLiteOk;
}
const SubGraph* MicroAllocator::GetSubGraphFromModel(const Model* model) {
auto* subgraphs = model->subgraphs();
if (subgraphs->size() != 1) {

View File

@ -179,11 +179,6 @@ class MicroAllocator {
ErrorReporter* error_reporter() const;
private:
// Initializes the graph and allocates TfLiteContext tensor data.
TfLiteStatus InitGraphAndContextTensorData(const Model* model,
TfLiteContext* context,
const SubGraph* subgraph);
// Returns the first subgraph from the model.
const SubGraph* GetSubGraphFromModel(const Model* model);