| 41 | }; |
| 42 | |
| 43 | TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) { |
| 44 | TF_LITE_ENSURE_EQ(context, NumInputs(node), 1); |
| 45 | TF_LITE_ENSURE_EQ(context, NumOutputs(node), 1); |
| 46 | |
| 47 | const auto* params = |
| 48 | reinterpret_cast<TfLiteFakeQuantParams*>(node->builtin_data); |
| 49 | |
| 50 | if (params->narrow_range) { |
| 51 | context->ReportError( |
| 52 | context, |
| 53 | "narrow_range FakeQuant is not currently supported at runtime. " |
| 54 | "narrow_range is only meant to be applied to weights, not activations"); |
| 55 | return kTfLiteError; |
| 56 | } |
| 57 | |
| 58 | OpContext op_context(context, node); |
| 59 | TfLiteIntArray* output_dims = TfLiteIntArrayCopy(op_context.input->dims); |
| 60 | op_context.output->type = op_context.input->type; |
| 61 | return context->ResizeTensor(context, op_context.output, output_dims); |
| 62 | } |
| 63 | |
| 64 | template <KernelType kernel_type> |
| 65 | TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) { |
nothing calls this directly
no test coverage detected