'Args:
config(TrainConfig): Must contain \'model\' and either one of \'data\' or \'dataflow\'.
ps_device: either \'gpu\' or \'cpu\', where variables are stored.  Setting to \'cpu\' might help when #gpu>=4
gpu_prefetch(bool): whether to prefetch the data to each GPU. Usually improve performance.'

def __init__(self, config, ps_device='gpu', gpu_prefetch=True):

    apply_prefetch_policy(config, gpu_prefetch)
    self._input_source = config.data
    assert (ps_device in ['gpu', 'cpu']), ps_device
    self._ps_device = ps_device
    super(SyncMultiGPUTrainerParameterServer, self).__init__(config)
