Case1:
when running the code with “net = nn.DataParallel(net, device_ids=[0])” line enabled i get following response for the print statements:
<class ‘torch.autograd.variable.Variable’>
(3L, 3L, 7L, 7L)
Case 2:
When I ran the code with “net = nn.DataParallel(net, device_ids=[0,1])” line enabled following is a response:
<type ‘NoneType’>
Traceback (most recent call last):
File “test.py”, line 30, in 
print(net.module.x.size())
AttributeError: ‘NoneType’ object has no attribute ‘size’
In summary, the object ‘self.x’ is of type autograd.variable.Variable.
But for Case 2, I get NoneType object in return instead of valid Variable.