Module.cuda() vs nn.DataParallel()

Hi guys,
I’m new one to pytorch and cuda.(BTW, pytorch is quite friendly to new ones :slight_smile: )
And I’m just confused when i’m reading these codes:

`net =  torch.nn.DataParallel(net)`
`net = net.cuda()`

I only know that cuda() and DataParallel() has something to do with GPU and parallel computation etc.
But what’s the difference in those two lines? What have they done respectively?
Also, what happens if the second line is removed?

Thanks in advance!

DataParallel is a line to use multiple GPUs for processing your model.

.cuda() is just putting your model on GPU.

Thanks smth. It helps:)