1.
I dont understand why the flattening looks wrong to you. In contrast to the feature tensor shown in my initial post the tensor post flattening looks as it should (from my point of view). I want the input to be of shape torch.Size([35040, 30]) rather torch.Size([3, 8760, 30]). I.e. sample of 4 cars with 30 features and 8760 records each of which 3 cars are for training and 1 for validation purposes. The training should focus on the records independent of the car because the targets for a new car should be estimated based on the inputs of all cars. I hope this makes sense and therefore the flattend inputs should be correct.
>>> features
tensor([[ 1.0000e+00, -6.5955e+01,  1.4160e+01,  ...,  2.0000e+00,
          0.0000e+00,  2.0000e+00],
        [ 2.0000e+00, -6.4064e+01,  1.4160e+01,  ...,  2.0000e+00,
          0.0000e+00,  2.0000e+00],
        [ 3.0000e+00, -6.1796e+01,  1.6460e+01,  ...,  2.0000e+00,
          0.0000e+00,  2.0000e+00],
        ...,
        [ 8.7580e+03,  3.6286e+01,  2.6821e+04,  ...,  2.7200e+02,
          1.6400e+02,  2.8600e+02],
        [ 8.7590e+03,  4.0603e+01,  2.6394e+04,  ...,  2.7200e+02,
          1.6400e+02,  2.8600e+02],
        [ 8.7600e+03,  3.9810e+01,  2.6441e+04,  ...,  2.7200e+02,
          1.6400e+02,  2.8600e+02]], dtype=torch.float64)

>>> features.shape
torch.Size([35040, 30])

2.
In addition I changed the model in the following way because I could not figure out what was wrong. First I thought that the numberOfFeatures (30) value wasnt enough because it should be numberOfFeatures * batchsize but that didnt work either so I chose the easiest route that didnt cause any “mat1 and mat2 shapes cannot be multiplied” errors.
        self.l0 = nn.Linear(numberOfFeatures, 30)
        self.l1 = nn.Linear(30, 30)
        self.l2 = nn.Linear(30, 30)
        self.l3 = nn.Linear(numberOfFeatures, 1)

I havent figured it out yet, I will look into this later today.
Currently the model does not cause any errors, there is still at least one thing wrong. The first two training iterations of the first epoch look “fine” but the third does not. Both feature and target tensors are neither empty nor nan
Epoch 0: train loss: -1894.735568661991
Epoch 0: train loss: -4.14948531980407e+19
Epoch 0: train loss: nan

Is this behaviour related to the structure of the model and the design of the forward function?
~~
Thank you very much for helping me out!