include_nn_kernels.h#

namespace ONNX_LIGHT_NAMESPACE
namespace onnx_backend_test
namespace kernel
class AveragePool#
#include <include_nn_kernels.h>

N-D average pooling on a FLOAT tensor laid out as (N, C, D1, ..., Dk). kernel_shape must have k entries; strides and pads (lengths k and 2 * k respectively) default to all-ones and all-zeros when omitted.

Public Functions

inline explicit AveragePool(const KernelContext &ctx)#
Tensor operator()(const Tensor &x, const std::vector<int64_t> &kernel_shape, const std::vector<int64_t> &strides = {}, const std::vector<int64_t> &pads = {}, bool ceil_mode = false, bool count_include_pad = false) const#

All attributes explicit. strides may be empty (treated as all 1) and pads may be empty (treated as all 0).

void operator()(const Tensor &x, const std::vector<int64_t> &kernel_shape, const std::vector<int64_t> &strides, const std::vector<int64_t> &pads, bool ceil_mode, bool count_include_pad, Tensor &output) const#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#

Output shape generally differs from the input shape, so the output buffer cannot in general alias the input buffer.

Private Members

KernelContext ctx_#