class_docstr: Data parallelism
  
  Hide the difference of single/multiple GPUs to the user.
  Inputs and outputs are both list of NDArrays in different contexts.
  In the forward pass, the module is replicated on each device,
  and each replica handles a portion of the input. During the backwards
  pass, gradients from each replica are summed into the original module.
  
  Parameters
  ----------
  module : object
      Network to be parallelized.
  ctx_list : list
      A list of contexts
  sync : bool
      enable synchronization (default: False).
  
  
  Inputs:
      - **inputs**: list of input (NDArrays)
  
  Outputs:
      - **outputs**: list of output (NDArrays)
  
  Example::
      >>> ctx = [mx.gpu(0), mx.gpu(1)]
      >>> net = DataParallelModel(model, ctx_list=ctx)
      >>> y = net(x)
class_docstr_tok: ["Data","parallelism","Hide","the","difference","of","single\/multiple","GPUs","to","the","user",".","Inputs","and","outputs","are","both","list","of","NDArrays","in","different","contexts",".","In","the","forward","pass",",","the","module","is","replicated","on","each","device",",","and","each","replica","handles","a","portion","of","the","input",".","During","the","backwards","pass",",","gradients","from","each","replica","are","summed","into","the","original","module",".","Parameters","--","--","--","--","--","module",":","object","Network","to","be","parallelized",".","ctx_list",":","list","A","list","of","contexts","sync",":","bool","enable","synchronization","(","default",":","False",")",".","Inputs",":","-","*","*","inputs","*","*",":","list","of","input","(","NDArrays",")","Outputs",":","-","*","*","outputs","*","*",":","list","of","output","(","NDArrays",")","Example",":",":",">",">",">","ctx","=","[","mx.gpu","(","0",")",",","mx.gpu","(","1",")","]",">",">",">","net","=","DataParallelModel","(","model",",","ctx_list=ctx",")",">",">",">","y","=","net","(","x",")"]
code: def __init__(self, module, ctx_list=None, sync=False):
      module.collect_params().reset_ctx(ctx=ctx_list)
      self.ctx_list = ctx_list
      self.module = module
      self.sync = sync
  
imports: import threading
  from mxnet import autograd
  from mxnet.gluon.utils import split_and_load
  from mxnet.ndarray import NDArray
label_desc: Use image node_id 1 to create a new DataParallelModel object from inherited base classes: object with example: obj = DataParallelModel(module, ctx_list, sync)