提交 7e283f97 编写于 作者: M Mihai Maruseac

[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
上级 42ed6ac8
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册