You would have to define this inside your network. A really basic example would be the following:
class CustomModule(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = torch.nn.Linear(3, 1)
        self.linear2 = torch.nn.Linear(3, 1)

    def forward(self, input_dict: dict):
        out1 = self.linear1(input_dict["input_1"].to(self.linear1.weights.device))
        out2 = self.linear2(input_dict["input_2"].to(self.linear2.weights.device))

        return out1 + out2.to(out1.device)


Note: You don’t want to hardcode your devices here, since this would brake if you change your network device.
Also as @JuanFMontesinos mentioned, this would work for simple NNs only (to get this working - which is possible in general - a little bit more effort would be required.