| 106 | } |
| 107 | |
| 108 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
| 109 | OpData* data = reinterpret_cast<OpData*>(node->user_data); |
| 110 | |
| 111 | const TfLiteTensor* input1 = GetInput(context, node, kInputTensor1); |
| 112 | const TfLiteTensor* input2 = GetInput(context, node, kInputTensor2); |
| 113 | TfLiteTensor* output = GetOutput(context, node, kOutputTensor); |
| 114 | |
| 115 | switch (output->type) { |
| 116 | case kTfLiteInt32: { |
| 117 | // TensorFlow does not support negative for int32. |
| 118 | TF_LITE_ENSURE_OK(context, CheckValue(context, input2)); |
| 119 | PowImpl<int32_t>(input1, input2, output, data->requires_broadcast); |
| 120 | break; |
| 121 | } |
| 122 | case kTfLiteFloat32: { |
| 123 | PowImpl<float>(input1, input2, output, data->requires_broadcast); |
| 124 | break; |
| 125 | } |
| 126 | default: { |
| 127 | context->ReportError(context, "Unsupported data type: %d", output->type); |
| 128 | return kTfLiteError; |
| 129 | } |
| 130 | } |
| 131 | return kTfLiteOk; |
| 132 | } |
| 133 | |
| 134 | } // namespace |
| 135 | } // namespace pow |
nothing calls this directly
no test coverage detected