Pytorch: Sparse Matrix multiplcation
Given:  

self.A = torch.autograd.Variable(random_sparse(n = dim)) 
self.w = torch.autograd.Variable(torch.Tensor(np.random.normal(0,1,(dim,dim))))


Goal1:  

torch.mm(self.A, self.w)


Goal2:

torch.spmm(self.A, self.w)


Result1:  

TypeError: Type torch.sparse.FloatTensor doesn't implement stateless method addmm


Result2:  

AttributeError: 'module' object has no attribute 'spmm'


My PyTorch version is 0.1.12_2 - would greatly appreciate possible solutions.

spmm has been moved from torch module to torch.sparse module. For official documentation please check this link. There is also a warning in the beginning of the documentation of torch.sparse module:


  This API is currently experimental and may change in the near future.

