import torch
import torch.nn as nn
from torch.autograd import Variable
import pandas as pd
import numpy as np

train = pd.read_csv('train.csv')

train_x = np.array(train['x'])
train_y = np.array(train['y'])

class Linear_Regress(nn.Module):
    def __init__(self, input_sz, output_sz):
        super(Linear_Regress, self).__init__()
        self.linear = nn.Linear(input_sz, output_sz)
    
    def forward(self, x):
        out = self.linear(x)
        return out

model = Linear_Regress(1,1)

criterion = nn.MSELoss()
lrn_rt = 0.01
optm = torch.optim.SGD(model.parameters(), lr = lrn_rt)

epochs = 100

inputs = Variable(torch.from_numpy(train_x)).double()
outs = Variable(torch.from_numpy(train_y)).double()

for e in range(epochs):
    e += 1
    optm.zero_grad()
    
    outputs = model.forward(inputs)
    loss = criterion(outputs, outs)
    loss.backward()
    optm.step()
    print('epoch {}, loss {}'.format(e,loss.data[0]))

Am trying to implement the above code, as mentioned in the title, I am getting the following error:

Expected object of type Variable[torch.DoubleTensor] but found type Variable[torch.FloatTensor] for argument #1 ‘mat2’

my debugger indicates that the error is originating from the line with:

outputs = model.forward(inputs)

Im new to pytorch, any solutions?
EDIT: Data extracted from ‘train.csv’ are both of float64 d-types