I’m sure there is a better way, but I thought you could try separating them, then pas in a pointer in the forward method.
For example:
import torch

class NeuralNetwork(torch.nn.Module):
  def __init__(self):
    super(NeuralNetwork, self).__init__()
    self.add_module('L1', torch.nn.Sequential(
      torch.nn.Linear(1280, 512, True),
      torch.nn.Tanh(),
      torch.nn.Linear(512, 256, True),
      torch.nn.Tanh(),
      torch.nn.Linear(256, 128, True),
      torch.nn.Tanh(),
      torch.nn.Linear(128, 200, True)
    )
    self.add_module('L2', torch.nn.Sequential(
      torch.nn.Linear(1280, 512, True),
      torch.nn.Tanh(),
      torch.nn.Linear(512, 256, True),
      torch.nn.Tanh(),
      torch.nn.Linear(256, 128, True),
      torch.nn.Tanh(),
      torch.nn.Linear(128, 29, True)
    )
  def forward(self, x, classifier):
    if classifier == 0:
      return self.L1(x)
    elif classifier == 1:
      return self.L2(x)


Then in your training loop, you could just flag in the classifier into the model.(x, classifier).