torch.quantized_max_pool1d — PyTorch 2.5 documentation (original) (raw)

torch.quantized_max_pool1d(input, kernel_size, stride=[], padding=0, dilation=1, ceil_mode=False) → Tensor

Applies a 1D max pooling over an input quantized tensor composed of several input planes.

Parameters

Returns

A quantized tensor with max_pool1d applied.

Return type

Tensor

Example:

qx = torch.quantize_per_tensor(torch.rand(2, 2), 1.5, 3, torch.quint8) torch.quantized_max_pool1d(qx, [2]) tensor([[0.0000], [1.5000]], size=(2, 1), dtype=torch.quint8, quantization_scheme=torch.per_tensor_affine, scale=1.5, zero_point=3)