human
Complete the below
def gather(outputs, target_device, dim=0):

    ''''Gathers variables from different GPUs on a specified device
    (-1 means the CPU).'
    '''
 Write me a the Python program you requested?
assistant
#Here is the Python program you requested.
    def gather_map(outputs):
        out = outputs[0]
        if isinstance(out, Variable):
            return Gather(target_device, dim=dim)(*outputs)
        if (out is None):
            return None
        return type(out)(map(gather_map, zip(*outputs)))
    return gather_map(outputs)