Skip to content

torch_to_nnef.op.aten.pool

Functions:

Name Description
adaptive_avg_poolnd

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

adaptive_max_poolnd

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

avg_pool1d

Map PyTorch: 'aten:avg_pool1d' to NNEF.

avg_pool_nd

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

grid_sampler

Map aten::grid_sampler{,_2d,_3d} to tract_core_grid_sample.

max_pool1d

Map PyTorch: 'aten:max_pool1d' to NNEF.

max_pool_nd

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

max_pool_nd_with_indices

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

upsample_bicubic2d

Map aten::upsample_bicubic2d to tract_core_resize (cubic).

upsample_linear_nd

Map aten::upsample_{linear1d,bilinear2d,trilinear3d} to resize.

upsample_nearest_exact_nd

Map aten::_upsample_nearest_exact{1,2,3}d to tract_core_resize.

upsample_nearest_nd

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

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)

grid_sampler

grid_sampler(node, op_helper, **kwargs)

Map aten::grid_sampler{,_2d,_3d} to tract_core_grid_sample.

(input, grid, interpolation_mode, padding_mode, align_corners) with the integer enums decoded to tract's string options.

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_bicubic2d

upsample_bicubic2d(node, op_helper, **kwargs)

Map aten::upsample_bicubic2d to tract_core_resize (cubic).

upsample_linear_nd

upsample_linear_nd(node, op_helper, **kwargs)

Map aten::upsample_{linear1d,bilinear2d,trilinear3d} to resize.

align_corners selects the coordinate transform; PyTorch's align_corners=False matches ONNX pytorch_half_pixel.

upsample_nearest_exact_nd

upsample_nearest_exact_nd(node, op_helper, **kwargs)

Map aten::_upsample_nearest_exact{1,2,3}d to tract_core_resize.

The "exact" variant centres samples (half-pixel) and rounds, unlike plain nearest which floors from the asymmetric grid.

upsample_nearest_nd

upsample_nearest_nd(node, op_helper, **kwargs)

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

On tract releases exposing tract_core_resize this lowers to a single resize (nearest / asymmetric / floor). Older targets fall back to the debox path (tract >= 0.22 with upsample_with_debox=True), the rank-generic reshape/tile trick, or the legacy 2-D deconv.