[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
This commit is contained in:
Mihai Maruseac 2020-09-18 18:40:41 -07:00
parent 42ed6ac868
commit 7e283f97d8

View File

@ -95,12 +95,7 @@ inline int64_t NumElements(const TfLiteTensor* t) {
inline const TfLiteTensor* GetOptionalInputTensor(TfLiteContext* context,
const TfLiteNode* node,
int index) {
const bool use_tensor = index < node->inputs->size &&
node->inputs->data[index] != kTfLiteOptionalTensor;
if (use_tensor) {
return &context->tensors[node->inputs->data[index]];
}
return nullptr;
return GetInput(context, node, index);
}
// Determines whether tensor is constant.