Change the nn.init methods to the inplace versions and remove the .data usage as:
    nn.init.xavier_uniform_(self.linear.weight)
    nn.init.xavier_uniform_(self.linear2.weight)

Also, I’m unsure if this fits your use case, but you are setting the batch size to the input and output size, so you should double check, if this is indeed correct.
Play around with some hyperparameters, such as lowering the learing rate, changing the nn.Sigmoid for nn.ReLU or another non-linearity etc. and try to overfit a small dataset first (e.g. just 10 samples).