My wild guess is that you actually wanted sth like this:
hinge = nn.Linear(3, 2)
branches = [
    nn.Linear(3, 1),
    nn.Linear(3, 1)
]

hinge_logits = hinge(x)
hinge_dist = torch.distributions.categorical.Categorical(logits=hinge_logits)
hinge_probs = hinge_dist.probs()

# weighted average of branch outputs
x = sum([p * branch(x) for branch in zip(hinge_probs, branches)])

# ...

I didn’t test it so there are surely issue with batch dimensions. You’d probably need to add some squeezes and unsqueezes here and there.
In general take a look at Probability distributions - torch.distributions — PyTorch 1.9.0 documentation