Run two models in parallel on same GPU

Hi,
I have two neural networks. I wish to run them in parallel on the same gpu using same data. How should I go about it?

model1 = Net1().cuda()
model2 = Net2().cuda()

out1 = model1(input)
out2 = model2(input)

How can I get out1 and out2 in parallel? Will running them in parallel be faster than the current sequential operations?

I think this is answered here.

1 Like

Thank you so much!!!