MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Prepare

Function Prepare

tensorflow/lite/kernels/fake_quant.cc:43–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41};
42
43TfLiteStatus 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
64template <KernelType kernel_type>
65TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {

Callers

nothing calls this directly

Calls 5

NumInputsFunction · 0.85
TfLiteIntArrayCopyFunction · 0.85
ResizeTensorMethod · 0.80
NumOutputsFunction · 0.70
ReportErrorMethod · 0.45

Tested by

no test coverage detected