I tested the code on https://pytorch.org/tutorials/beginner/blitz/data_parallel_tutorial.html#sphx-glr-beginner-blitz-data-parallel-tutorial-py 2. It works well.
But when I changed the code
class Model(nn.Module):
# Our model
def __init__(self, input_size, output_size):
    super(Model, self).__init__()
    self.fc = nn.Linear(input_size, output_size)

def forward(self, input):
    output = self.fc(input)
    print("\tIn Model: input size", input.size(),
          "output size", output.size())

    return output

model = Model(input_size, output_size)
to
model = nn.Linear(input_size, output_size)
,the result became to 
image718×154 3.34 KB
 . WHY?