Skip to content
Permalink
Browse files Browse the repository at this point in the history
[tflite] Make GetOptionalInputTensor the same as GetInput.
With the previous change, there is no more need for two separate APIs. We would deprecate `GetOptionalInputTensor` in the future.

PiperOrigin-RevId: 332513386
Change-Id: Id7110271c25ebd6126ad8c82a493e37e0e0756b3
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Sep 18, 2020
1 parent f2ebefb commit 0030278
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions tensorflow/lite/kernels/kernel_util.cc
Expand Up @@ -75,12 +75,7 @@ TfLiteTensor* GetOutput(TfLiteContext* context, const TfLiteNode* node,

const TfLiteTensor* GetOptionalInputTensor(const TfLiteContext* context,
const TfLiteNode* node, int index) {
const bool use_tensor = index < node->inputs->size &&
node->inputs->data[index] != kTfLiteOptionalTensor;
if (use_tensor) {
return GetMutableInput(context, node, index);
}
return nullptr;
return GetInput(context, node, index);
}

// Per-axis
Expand Down

0 comments on commit 0030278

Please sign in to comment.