xlnstorch.csrc.avg_pool1d_backward#
- xlnstorch.csrc.avg_pool1d_backward(grad, x, kernel_size, base, stride, padding, ceil_mode, count_include_pad)#
Perform the backward pass for LNS 1D average pooling.
- Parameters:
grad (torch.Tensor) – The gradient tensor in LNS format (torch.int64).
x (torch.Tensor) – The input tensor in LNS format (torch.int64).
kernel_size (int) – The size of the pooling kernel.
base (torch.Tensor) – The base for the LNS representation.
stride (int, optional) – The stride of the pooling operation. Defaults to kernel_size if None.
padding (int) – The padding applied to the input tensor.
ceil_mode (bool) – If True, will use ceil instead of floor to compute the output shape.
count_include_pad (bool) – If True, will include the zero-padding in the averaging calculation.
- Returns:
The output gradient tensor in LNS format (torch.int64).
- Return type: