Your code works fine using this dummy training loop:
x = torch.randn(10, 1)
target = torch.randn(10, 1)

for epoch in range(10):
    optimizer.zero_grad()
    output = model(x)
    loss = criterion(output, target)
    loss.backward()
    optimizer.step()
    print('Epoch {}, loss {}'.format(epoch, loss.item()))

Are you sure you haven’t reassigned model to another variable/tensor/etc.?
If you print list(model.parameters()), you’ll see both the weight and bias of your linear layer.
PS: You can add code snippets using three backticks `