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