RuntimeError: SparseAdam does not support dense gradients, please consider Adam instead

I suspect it only works with sparse tensors. I am actually working with dense tensors (to learn a sparse representation). Regardless, I think I will make do with SGD for now. Thank you again @albanD