




import inspect
import os
import unittest

import torch

import accelerate
from accelerate import debug_launcher
from accelerate.test_utils import (
    execute_subprocess_async,
    require_cpu,
    require_multi_gpu,
    require_single_gpu,
    test_sync,
)
from accelerate.utils import patch_environment




class     a__ (      unittest.TestCase   ):







     def     lowerCAmelCase_       (			self				)						->					Union[str, Any]:



          '''simple docstring'''



          a											=   inspect.getfile(accelerate.test_utils				)
          a											=   os.path.sep.join(mod_file.split(os.path.sep				)[:-1] + ["scripts", "test_sync.py"]				)







     @require_cpu
     def     lowerCAmelCase_       (			self				)						->					int:



          '''simple docstring'''



          debug_launcher(test_sync.main						,	num_processes=1				)







     @require_cpu
     def     lowerCAmelCase_       (			self				)						->					Optional[Any]:



          '''simple docstring'''



          debug_launcher(test_sync.main				)







     @require_single_gpu
     def     lowerCAmelCase_       (			self				)						->					str:



          '''simple docstring'''



          test_sync.main()







     @require_multi_gpu
     def     lowerCAmelCase_       (			self				)						->					Union[str, Any]:



          '''simple docstring'''



          print(F'''Found {torch.cuda.device_count()} devices.'''				)
          a											=   ["torchrun", F'''--nproc_per_node={torch.cuda.device_count()}''', self.test_file_path]
          with patch_environment(omp_num_threads=1				):
               execute_subprocess_async(A						,	env=os.environ.copy()				)







from dataclasses import dataclass
from typing import List, Optional, Union

import numpy as np
import PIL

from ...utils import BaseOutput, is_invisible_watermark_available, is_torch_available, is_transformers_available




@dataclass
class     a__ (      UpperCamelCase__   ):
     a	:    Union[List[PIL.Image.Image], np.ndarray]


if is_transformers_available() and is_torch_available() and is_invisible_watermark_available():
   from .pipeline_stable_diffusion_xl import StableDiffusionXLPipeline
   from .pipeline_stable_diffusion_xl_imgaimg import StableDiffusionXLImgaImgPipeline

