torch.nn.functional.adaptive_max_pool2d_with_indices
function adaptive_max_pool2d_with_indices(input: Tensor, output_size: number | [number, number]): PoolWithIndicesResultApplies 2D adaptive max pooling and returns both output and indices. This is equivalent to adaptive_max_pool2d(input, output_size, true).
Parameters
inputTensor- Input tensor of shape (N, C, H, W)
output_sizenumber | [number, number]- Target output size (H_out, W_out)
Returns
PoolWithIndicesResult– Tuple of (output, indices) tensors