def change_gpu(val):
    """
    Args:
        val: an integer, the index of the GPU or -1 to disable GPU.

    Returns:
        a context where ``CUDA_VISIBLE_DEVICES=val``.
    """
    val = str(val)
    if val == '-1':
        val = ''
    return change_env('CUDA_VISIBLE_DEVICES', val)

    Args:
        val: an integer, the index of the GPU or -1 to disable GPU.

    Returns:
        a context where ``CUDA_VISIBLE_DEVICES=val``.
    
tensorpack/utils/gpu.py