- make_const(Int(32), 1));
- return pool_sum(indices) / divide_factor;
- }
- }, "tensor", kElementWise);
- } else {
- LOG(ERROR) << "Unrecognized pool_type: " << pool_type;
- return x;
- }
- }
-
- inline Tensor pool_grad_impl(const Tensor& out_grad, const Tensor& x,
- const Array<Expr>& kernel_size, const Array<Expr>& stride_size,
- const Array<Expr>& padding_size, PoolType pool_type, bool ceil_mode,
- const size_t height_axis, const size_t width_axis,
- bool count_include_pad) {
- CHECK(out_grad->shape.size() >= 2) << "Pooling grad output must >= 2-D (H, W)";
- CHECK(x->shape.size() >= 2) << "Pooling input must >= 2-D (H, W)";
- CHECK_EQ(kernel_size.size(), 2) << "Pooling kernel_size must have 2 elements";
- CHECK_EQ(stride_size.size(), 2) << "Pooling stride_size must have 2 elements";
- CHECK_EQ(padding_size.size(), 4) << "Pooling padding_size must have 4 elements";
-