| 38 | return &context->tensors[tensor_index]; |
| 39 | } |
| 40 | inline TfLiteTensor* GetVariableInput(TfLiteContext* context, TfLiteNode* node, |
| 41 | int index) { |
| 42 | const int tensor_index = flatbuffers::EndianScalar(node->inputs->data[index]); |
| 43 | if (tensor_index < 0) { |
| 44 | return nullptr; |
| 45 | } |
| 46 | TfLiteTensor* tensor = &context->tensors[tensor_index]; |
| 47 | return (tensor->is_variable) ? tensor : nullptr; |
| 48 | } |
| 49 | inline TfLiteTensor* GetOutput(TfLiteContext* context, TfLiteNode* node, |
| 50 | int index) { |
| 51 | const int tensor_index = flatbuffers::EndianScalar(node->outputs->data[index]); |