Sure it’s possible, though only during the forward pass; meaning that you should declare your encoder and the final Linear separately. Finally during the forward pass, take the ouput of the encoder, reshape with .view, concat with the other tensor with torch.cat (https://pytorch.org/docs/stable/torch.html#torch.cat 109) and pass it to the Linear module.