I’m not sure the SGD optimizer supports sparse tensors. It looks like the ge (>=) and le (<=) ops aren’t defined for sparse tensors. Perhaps try something like http://pytorch.org/docs/master/optim.html#torch.optim.SparseAdam 4