There is already a patch for torch.mm. You can use that in the meantime. I am using it currently and it if working fine.

  
    
    
    Does PyTorch support autograd on sparse matrix? autograd
  
  
    Hi there, 
I am a beginner trying to learn PyTorch and there is one question bugging me. I know PyTorch support sparse x dense -> dense function in torch.mm. However, I don’t think it currently supports autograd on sparse variables (say sparse matrix). Examples are: 
x = torch.sparse.FloatTensor(2,10)
y = torch.FloatTensor(10, 5)
sx = torch.autograd.Variable(x)
sy = torch.autograd.Variable(y)

torch.mm(sx, sy) # fails

Errors: TypeError: Type torch.sparse.FloatTensor doesn’t implement stateless …