trdavidson:

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


are you sure you’re on the latest pytorch? I think a bunch of methods were added for sparse in 0.1.12. Anyway, looks pretty much the same as what does work for me (with memory leak), except that I don’t call the forward() method explicitly, but create a new function object and call it immediately. I don’t think that would explain the error you get, though.