


a
        tensor(indices=tensor([[0, 0, 0, 1, 1, 1],
                               [0, 1, 2, 0, 1, 2]]),
               values=tensor([ 1.5901,  0.0183, -0.6146,  1.8061, -0.0112,  0.6302]),
               size=(2, 3), nnz=6, layout=torch.sparse_coo, requires_grad=True)



    >>> b = torch.randn(3, 2, requires_grad=True)
    >>> b
    tensor([[-0.6479,  0.7874],
            [-1.2056,  0.5641],
            [-1.1716, -0.9923]], requires_grad=True)

    >>> y = torch.sparse.mm(a, b)
    >>> y
    tensor([[-0.3323,  1.8723],
            [-1.8951,  0.7904]], grad_fn=<SparseAddmmBackward>)
    >>> y.sum().backward()
    >>> a.grad
    tensor(indices=tensor([[0, 0, 0, 1, 1, 1],
                           [0, 1, 2, 0, 1, 2]]),
           values=tensor([ 0.1394, -0.6415, -2.1639,  0.1394, -0.6415, -2.1639]),
           size=(2, 3), nnz=6, layout=torch.sparse_coo)
