@ptrblck thx for respond my question. I fixed that problem but now I got this error
Traceback (most recent call last):
  File "fev.py", line 227, in <module>
    outputs = model(inputs)
  File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "fev.py", line 183, in forward
    x = F.relu(self.linear1(x))  
  File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 92, in forward
    return F.linear(input, self.weight, self.bias)
  File "/usr/local/lib/python3.7/site-packages/torch/nn/functional.py", line 1404, in linear
    if input.dim() == 2 and bias is not None:
AttributeError: 'list' object has no attribute 'dim'

my nn is:
class Modele(nn.Module):
        def __init__(self, D_in, H1, H2, D_out):
                super().__init__()
                self.linear1 = nn.Linear(D_in, H1)
                self.linear2 = nn.Linear(H1, H2)
                self.linear3 = nn.Linear(H2, D_out)
        def forward(self, x):
                x = F.relu(self.linear1(x))  
                x = F.relu(self.linear2(x))
                x = self.linear3(x)
                return x


and my calculations are:
batch_size=1000
epochs=5
device=torch.device("cuda:0"if torch.cuda.is_available() else "cpu")
train_x=train_x.view(-1,1,3)
dataset=TensorDataset(train_x,train_y)
tr=torch.utils.data.DataLoader(dataset,batch_size=100,shuffle=False)
val=torch.utils.data.DataLoader(val_x,batch_size=100,shuffle=False)
model=Modele(1,100,65,1).to(device)

criterion = nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.0001)
for e in range(epochs):
  
        running_loss = 0.0
        running_corrects = 0.0
        val_running_loss = 0.0
        val_running_corrects = 0.0
  
        for inputs in tr:
                

                outputs = model(inputs)

                
                loss = criterion(outputs, inputs)
                _,preds=torch.max(outputs,1)
                outputss.append(preds.max().detach().numpy())
                losses.append(loss)
                optimizer.zero_grad()
                loss.backward()
                optimizer.step()

                #outputss.append(outputs.detach().numpy())
                #print(loss.item())