Hi,
Can you please specify which version of PyTorch you are using?
I can’t reproduce the issue with PyTorch 1.9. I am having the matrix mismatch error, as expected.
class testModel(nn.Module):

    def __init__(self) -> None:
        super().__init__()

        self.fc1 = nn.Linear(10, 10)
        self.fc2 = nn.Linear(5, 1)

    def forward(self, x):
        x = self.fc1(x)
        x = self.fc2(x)
        return x

inp = torch.ones((1, 10)).to('cuda:0')
model = testModel().to('cuda:0')
out = model(inp)

And, the error, as it should be.
Traceback (most recent call last):
  File "/home/la-belva/.config/JetBrains/PyCharmCE2021.2/scratches/scratch_15.py", line 20, in <module>
    out = model(inp)
  File "/home/la-belva/anaconda3/envs/latest/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/la-belva/.config/JetBrains/PyCharmCE2021.2/scratches/scratch_15.py", line 15, in forward
    x = self.fc2(x)
  File "/home/la-belva/anaconda3/envs/latest/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/la-belva/anaconda3/envs/latest/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 94, in forward
    return F.linear(input, self.weight, self.bias)
  File "/home/la-belva/anaconda3/envs/latest/lib/python3.8/site-packages/torch/nn/functional.py", line 1753, in linear
    return torch._C._nn.linear(input, weight, bias)
RuntimeError: mat1 dim 1 must match mat2 dim 0

Process finished with exit code 1