I found a solution and will leave it here for other users. First I updated PyTorch. Then I realized that Numpy-style indexing is not allowed in the latest release. Instead of Numpy indexing, I used .index_select. Like this the optimizer parameters update when .step() is called.
On a side note, Numpy style indexing is a super-cool feature, hopefully on the horizon 
class SimpleLayer(nn.Module):

    def __init__(self, size_in, size_out, ignore_zeros=True):
        super(SimpleLayer, self).__init__()
        self.weight = nn.Parameter(
            torch.randn(size_in, size_out) * 1e-5,
            requires_grad=True
        )
        self.ignore_zeros = ignore_zeros

    def forward(self, input_var):
        if self.ignore_zeros:
            nz_inds = ann.Variable(input_var.data.nonzero()[:, 1])
            inp_nz = input_var.index_select(1, nz_inds)
            weight_nz = self.weight.index_select(0, nz_inds)
            out = inp_nz.mm(weight_nz)
            return out
        else:
            return input_var.mm(self.weight)