def NamedCudaScope(gpu_id):
    """Creates a GPU name scope and CUDA device scope. This function is provided
    to reduce `with ...` nesting levels."""
    with GpuNameScope(gpu_id):
        with CudaScope(gpu_id):
            yield
Creates a GPU name scope and CUDA device scope. This function is provided
    to reduce `with ...` nesting levels.
detectron/utils/c2.py