39 nnfw::cker::AveragePool<T>(params,
getShape(input), getBuffer<T>(input),
getShape(output),
47 nnfw::cker::MaxPool<T>(params,
getShape(input), getBuffer<T>(input),
getShape(output),
57 return std::bind(&avgPool2D<T>, params, std::placeholders::_1, std::placeholders::_2);
61 return std::bind(&maxPool2D<T>, params, std::placeholders::_1, std::placeholders::_2);
89 const uint32_t paddingTop,
const uint32_t,
const uint32_t strideWidth,
90 const uint32_t strideHeight,
const uint32_t kernelWidth,
94 assert(input !=
nullptr);
95 assert(output !=
nullptr);
104 case OperandType::FLOAT32:
106 float output_activation_min = 0;
107 float output_activation_max = 0;
108 CalculateActivationRange<float>(activation, &output_activation_min, &output_activation_max);
109 op_params.float_activation_min = output_activation_min;
110 op_params.float_activation_max = output_activation_max;
112 _kernel = generateKernelGeneric<float>(op_params, op_type);
115 case OperandType::QUANT_UINT8_ASYMM:
117 int32_t output_activation_min = 0;
118 int32_t output_activation_max = 0;
120 &output_activation_max);
121 op_params.quantized_activation_min = output_activation_min;
122 op_params.quantized_activation_max = output_activation_max;
123 _kernel = generateKernelGeneric<uint8_t>(op_params, op_type);
126 case OperandType::QUANT_INT8_ASYMM:
128 int32_t output_activation_min = 0;
129 int32_t output_activation_max = 0;
131 &output_activation_max);
132 op_params.quantized_activation_min = output_activation_min;
133 op_params.quantized_activation_max = output_activation_max;
134 _kernel = generateKernelGeneric<int8_t>(op_params, op_type);
138 throw std::runtime_error{
"Pool: unsupported data type"};
void configure(const IPortableTensor *input, const uint32_t paddingLeft, const uint32_t paddingRight, const uint32_t paddingTop, const uint32_t paddingBottom, const uint32_t strideWidth, const uint32_t strideHeight, const uint32_t kernelWidth, const uint32_t kernelHeight, const ir::Activation activation, IPortableTensor *output, const PoolType op_type)