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

Function AverageEvalFloat

tensorflow/lite/kernels/pooling.cc:112–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111template <KernelType kernel_type>
112TfLiteStatus AverageEvalFloat(TfLiteContext* context, TfLiteNode* node,
113 TfLitePoolParams* params, OpData* data,
114 const TfLiteTensor* input, TfLiteTensor* output) {
115 float activation_min, activation_max;
116 CalculateActivationRange(params->activation, &activation_min,
117 &activation_max);
118#define TF_LITE_AVERAGE_POOL(type) \
119 tflite::PoolParams op_params; \
120 op_params.stride_height = params->stride_height; \
121 op_params.stride_width = params->stride_width; \
122 op_params.filter_height = params->filter_height; \
123 op_params.filter_width = params->filter_width; \
124 op_params.padding_values.height = data->padding.height; \
125 op_params.padding_values.width = data->padding.width; \
126 op_params.float_activation_min = activation_min; \
127 op_params.float_activation_max = activation_max; \
128 TF_LITE_ENSURE(context, type::AveragePool(op_params, GetTensorShape(input), \
129 GetTensorData<float>(input), \
130 GetTensorShape(output), \
131 GetTensorData<float>(output)))
132 if (kernel_type == kReference) {
133 TF_LITE_AVERAGE_POOL(reference_ops);
134 } else {
135 TF_LITE_AVERAGE_POOL(optimized_ops);
136 }
137#undef TF_LITE_AVERAGE_POOL
138 return kTfLiteOk;
139}
140
141template <KernelType kernel_type>
142TfLiteStatus AverageEvalQuantizedUint8(TfLiteContext* context, TfLiteNode* node,

Callers

nothing calls this directly

Calls 1

CalculateActivationRangeFunction · 0.85

Tested by

no test coverage detected