github.com
  
  
    pytorch/pytorch/blob/690eaf9c43f3f71051d90e9f47f25b014ce84681/aten/src/ATen/native/cpu/AdaptiveAvgPoolKernel.cpp#L13-L64 5

template <typename scalar_t>void cpu_adaptive_avg_pool(    Tensor& output_,    const Tensor& input_,    IntArrayRef output_size) {  auto input = input_.contiguous();  auto output = output_.contiguous();  auto input_data = input.data_ptr<scalar_t>();  auto output_data = output.data_ptr<scalar_t>();  int64_t ndim = input.ndimension();  // treat batch size and channels as one dimension  int64_t channels = ndim == 3 ? input.size(0) : input.size(0) * input.size(1);  int64_t input_height = input.size(-2);  int64_t input_width = input.size(-1);  int64_t output_height = output_size[0];  int64_t output_width = output_size[1];  // parallel on dim of N, C


  This file has been truncated. show original