86{
87 assert(input != nullptr);
88 assert(output != nullptr);
89
92
94
95 switch (_input->data_type())
96 {
97 case OperandType::FLOAT32:
98 {
99 float output_activation_min = 0;
100 float output_activation_max = 0;
101 CalculateActivationRange<float>(activation, &output_activation_min, &output_activation_max);
102 op_params.float_activation_min = output_activation_min;
103 op_params.float_activation_max = output_activation_max;
104
105 _kernel = generateKernelGeneric<float>(op_params, op_type);
106 break;
107 }
108 case OperandType::QUANT_UINT8_ASYMM:
109 {
110 int32_t output_activation_min = 0;
111 int32_t output_activation_max = 0;
113 &output_activation_max);
114 op_params.quantized_activation_min = output_activation_min;
115 op_params.quantized_activation_max = output_activation_max;
116 _kernel = generateKernelGeneric<uint8_t>(op_params, op_type);
117 break;
118 }
119 case OperandType::QUANT_INT8_ASYMM:
120 {
121 int32_t output_activation_min = 0;
122 int32_t output_activation_max = 0;
124 &output_activation_max);
125 op_params.quantized_activation_min = output_activation_min;
126 op_params.quantized_activation_max = output_activation_max;
127 _kernel = generateKernelGeneric<int8_t>(op_params, op_type);
128 break;
129 }
130 default:
131 throw std::runtime_error{"Pool: unsupported data type"};
132 }
133}
134
135void PoolLayer::run() { _kernel(_input, _output); }
136
137#undef AVGPOOLING_PARAMETERS
138
139}
#define POOLING_PARAMETERS
void CalculateActivationRangeQuantized(ir::Activation activation, const IPortableTensor *output, int32_t *act_min, int32_t *act_max)