Skip to content

pool

torch_to_nnef.op.aten.pool

adaptive_avg_poolnd

adaptive_avg_poolnd(g, node, op_helper, **kwargs)

Map PyTorch: 'aten:adaptive_avg_pool{1,2,3}d' to NNEF.

adaptive_max_poolnd

adaptive_max_poolnd(node, op_helper, **kwargs)

Map PyTorch: adaptive_max_pool{1,2,3}d to NNEF.

avg_pool1d

avg_pool1d(node, op_helper, **kwargs)

Map PyTorch: 'aten:avg_pool1d' to NNEF.

avg_pool_nd

avg_pool_nd(node, op_helper, **kwargs)

Map PyTorch: 'aten:avg_pool(2|3)d', 'aten:max_pool3d' to NNEF.

Cpp func parameters:. (const Tensor& input, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional divisor_override

_pooling_op expect:

(input_node, kernel_size_node, stride_node, padding_node, dilation_node, ceil_mode_node)

max_pool1d

max_pool1d(g, node, op_helper, **kwargs)

Map PyTorch: 'aten:max_pool1d' to NNEF.

max_pool_nd

max_pool_nd(node, op_helper, **kwargs)

Map PyTorch: 'aten:max_pool2d', 'aten:max_pool3d' to NNEF.

max_pool_nd_with_indices

max_pool_nd_with_indices(node, op_helper, **kwargs)

Map PyTorch: 'aten:max_pool{1,2,3}d_with_indices' to NNEF.

Lowers to NNEF stdlib's max_pool_with_index fragment which returns both the pooled values and the (per-window argmax) indices. Tract only -- the fragment requires the argmax_pool + sample primitives behind it.

upsample_nearest_nd

upsample_nearest_nd(node, op_helper, **kwargs)

Map PyTorch aten::upsample_nearest{1,2,3}d to NNEF.

All three variants share (input, output_size, scales) (with the 1-D / 3-D versions packing scales into a single List[float]). The implementation is rank-agnostic for the debox path (tract

= 0.22 with upsample_with_debox=True); the legacy deconv fallback only handles the original 2-D case.