your code has screwed up formatting.
You can look at our examples (dcgan or imagenet) for correct usage of DataParallel.

  
      
      GitHub
  
  
    

pytorch/examples 735

A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc. - pytorch/examples