def multi_gpu(model, gpus=None, cpu_merge=True, cpu_relocation=False):
    """Takes as input the model, and returns a model
    based on the number of GPUs available on the machine
    or alternatively the 'gpus' user input.

    NOTE: this needs to be used before model.compile() in the
    model inputted to Scan in the form:

    from talos.utils.gpu_utils import multi_gpu
    model = multi_gpu(model)

    """
    from keras.utils import multi_gpu_model
    return multi_gpu_model(model, gpus=gpus, cpu_merge=cpu_merge,
        cpu_relocation=cpu_relocation)
