Hi @Caruso,
thank you for you answer!
I am new to pytorch and trying to use this code, which is a bit above my current level of understanding. I really appreciate your help.
This code below used to work until recently, with only a warning for the @staticmethod change. now it gives an error and doesn’t work anymore.
This is the original code that worked:
class SparseMM(torch.autograd.Function):

 def __init__(self, sparse):
    super(SparseMM, self).__init__()
    self.sparse = sparse

 def forward(self, dense):
    return torch.mm(self.sparse, dense)

 def backward(self, grad_output):
    grad_input = None
    if self.needs_input_grad[0]:
        grad_input = torch.mm(self.sparse.t(), grad_output)
    return grad_input


x = SparseMM(D)(x.t()).t() 

I tried the way you implemented it, but I still get the same error- the autograd style error.
I tried several other things I saw other people did… but I still can’t make it run
Looking at the original code, do you know how to adjust it to the new style?
thanks again