| 33 | constexpr int kInputValue = 1; |
| 34 | |
| 35 | TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { |
| 36 | TF_LITE_ENSURE_EQ(context, NumInputs(node), 2); |
| 37 | // TODO(b/137042749): TFLite infrastructure (converter, delegate) doesn't |
| 38 | // fully support 0-output ops yet. Currently it works if we manually crfat |
| 39 | // a TFLite graph that contains variable ops. Note: |
| 40 | // * The TFLite Converter need to be changed to be able to produce an op |
| 41 | // with 0 output. |
| 42 | // * The delegation code need to be changed to handle 0 output ops. However |
| 43 | // everything still works fine when variable ops aren't used. |
| 44 | TF_LITE_ENSURE_EQ(context, NumOutputs(node), 0); |
| 45 | |
| 46 | const TfLiteTensor* input_variable_id_tensor = |
| 47 | GetInput(context, node, kInputVariableId); |
| 48 | TF_LITE_ENSURE_EQ(context, input_variable_id_tensor->type, kTfLiteInt32); |
| 49 | TF_LITE_ENSURE_EQ(context, NumElements(input_variable_id_tensor), 1); |
| 50 | |
| 51 | return kTfLiteOk; |
| 52 | } |
| 53 | |
| 54 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| 55 | Subgraph* subgraph = reinterpret_cast<Subgraph*>(context->impl_); |
nothing calls this directly
no test coverage detected