





"""simple docstring"""




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 					_UpperCAmelCase    (  unittest.TestCase						):



      '''simple docstring'''

      def    lowerCamelCase_     (	self    ):

        """simple docstring"""

        A_    :			Optional[Any]									=    inspect.getfile(accelerate.test_utils    )
        A_    :			int									=    os.path.sep.join(mod_file.split(os.path.sep    )[:-1] + ['scripts', 'test_sync.py']    )

      @require_cpu
      def    lowerCamelCase_     (	self    ):

        """simple docstring"""

        debug_launcher(test_sync.main   , num_processes=1    )

      @require_cpu
      def    lowerCamelCase_     (	self    ):

        """simple docstring"""

        debug_launcher(test_sync.main    )

      @require_single_gpu
      def    lowerCamelCase_     (	self    ):

        """simple docstring"""

        test_sync.main()

      @require_multi_gpu
      def    lowerCamelCase_     (	self    ):

        """simple docstring"""

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




'''simple docstring'''







import warnings

from ...utils import logging
from .image_processing_maskformer import MaskFormerImageProcessor


SCREAMING_SNAKE_CASE__     : Dict				=   logging.get_logger(__name__)




class 				__lowerCAmelCase(							lowerCAmelCase__      ):






			def __init__(   self  :							List[Any]      ,       *SCREAMING_SNAKE_CASE  :							int      ,       **SCREAMING_SNAKE_CASE  :							Optional[int]	):




					"""simple docstring"""







					warnings.warn(
					    'The class MaskFormerFeatureExtractor is deprecated and will be removed in version 5 of Transformers.'
					    ' Please use MaskFormerImageProcessor instead.'      ,       SCREAMING_SNAKE_CASE      ,       )
					super().__init__(*SCREAMING_SNAKE_CASE      ,       **SCREAMING_SNAKE_CASE	)
