xlnstorch.csrc.sum_forward

Contents

xlnstorch.csrc.sum_forward#

xlnstorch.csrc.sum_forward(x, base, dim, keepdim)#

Perform LNS summation over specified dimensions.

Parameters:
  • x (torch.Tensor) – The input tensor in LNS format (torch.int64).

  • base (torch.Tensor) – The base for the LNS representation.

  • dim (List[int]) – The dimensions over which to sum.

  • keepdim (bool) – Whether to keep the dimensions of the output tensor the same as the input tensor.

Returns:

The output tensor in LNS format (torch.int64) after summation.

Return type:

torch.Tensor