xlnstorch.csrc.matmul_backward

xlnstorch.csrc.matmul_backward#

xlnstorch.csrc.matmul_backward(grad, A, B, base)#

Perform the backward pass for LNS matrix multiplication.

Parameters:
  • grad (torch.Tensor) – The gradient tensor in LNS format (torch.int64).

  • A (torch.Tensor) – The first tensor in LNS format (torch.int64).

  • B (torch.Tensor) – The second tensor in LNS format (torch.int64).

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

Returns:

The output gradient tensor in LNS format (torch.int64).

Return type:

torch.Tensor