Abo_Lamia:

o1 is categorical which contains 4 values, while o2-o8 are numerical


For this mixed use case, you could use two different model output layers, where the first one would have 4 output units and return logits for all 4 classes, while the second output layer would have 7 output units for the regression task.
For the first use case, you should calculate the loss using nn.CrossEntropyLoss, while for the second you could use nn.MSELoss, and finally sum these losses together before calling backward().
The general use case of a “mixed prediction” would also work with a single layer, where you would have to index the specific locations, but I’m not sure how well this approach would work, but you might just try it out.