提交 f911af10 编写于 作者: 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
上级 38cbad75
......@@ -92,12 +92,7 @@ inline int64_t NumElements(const TfLiteTensor* t) {
inline const TfLiteTensor* GetOptionalInputTensor(TfLiteContext* context,
const TfLiteNode* node,
int index) {
const bool use_tensor = node->inputs->data[index] != kOptionalTensor;
if (use_tensor) {
return &context
->tensors[flatbuffers::EndianScalar(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.
先完成此消息的编辑!
想要评论请 注册