i see nothing wrong in it.
and i can’t reproduce the error.
import torch
import torch.nn as nn

class Net(nn.Module):
    def __init__(self, feature_number, hidden_number, output_number):
        super(Net, self).__init__()
        self.hidden1 = nn.Linear(feature_number, hidden_number)
        self.hidden2 = nn.Linear(hidden_number, hidden_number)
        self.out = nn.Linear(hidden_number, output_number)

    def forward(self, x):
        x = self.hidden1(x)
        x = self.hidden2(x)
        x = torch.sigmoid(x)
        x = self.out(x)
        return x



model = Net(feature_number=2, hidden_number=6, output_number=1)


eta = torch.nn.functional.softmax(10*torch.randn(1000,2),-1)
dl = torch.utils.data.DataLoader(eta,batch_size=200,shuffle=True)



optim = torch.optim.Rprop(model.parameters(), lr=0.02)



for i in range(10):
    totalLoss = 0
    for x in dl:
        optim.zero_grad()
        out=model(x)
        loss=((out-1)**2).mean()
        loss.backward()
        optim.step()
        totalLoss += loss.item()
    print(i,totalLoss)