1for (size_t y = 0; y < out_height; ++y) {
2 for (size_t x = 0; x < out_width; ++x) {
3 for (size_t i = 0; i < pool_y; ++i) {
4 for (size_t j = 0; j < pool_x; ++j) {
5 for (size_t c = 0; c < depth; ++c) {
6 float value = in[y * pool_y + i][x * pool_x + j][c];
7 out[y][x][c] = max(out[y][x][c], value);
8 }
9 }
10 }
11 }
12}
13