



'''simple docstring'''






import os
import unittest

import pytest
from parameterized import parameterized

from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device


# skipping in unittest tests

A_							:				List[Any]						=			[(1,)]




def 					snake_case_      (  )->	Tuple:





       '''simple docstring'''


       _UpperCAmelCase						:		str      =				bool(os.getenv("""RUN_SLOW""" ,     0	)	)
       if run_slow:
              assert True
       else:
              assert False, "should have been skipped"




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





       '''simple docstring'''


       _UpperCAmelCase						:		List[Any]      =				bool(os.getenv("""RUN_SLOW""" ,     0	)	)
       if run_slow and torch_device == "cuda":
              assert True
       else:
              assert False, "should have been skipped"



@require_torch
class 							lowercase (						unittest.TestCase       ):


 """simple docstring"""


 @slow
 @require_torch_gpu
 def _snake_case				(							self							)	->     Optional[int]:
        check_slow_torch_cuda()







 @require_torch_gpu
 @slow
 def _snake_case				(							self							)	->     int:
        check_slow_torch_cuda()







 @parameterized.expand(a_							)
 @slow
 def _snake_case				(							self						,a_=None							)	->     int:
        check_slow()







@slow
@require_torch_gpu
def 					snake_case_      (  )->	Union[str, Any]:





       '''simple docstring'''


       check_slow_torch_cuda()




@require_torch_gpu
@slow
def 					snake_case_      (  )->	Tuple:





       '''simple docstring'''


       check_slow_torch_cuda()




@slow
@pytest.mark.parametrize("""param""" ,     [1]	)
def 					snake_case_      (  lowerCAmelCase_	)->	int:





       '''simple docstring'''


       check_slow()




@pytest.mark.parametrize("""param""" ,     [1]	)
@slow
def 					snake_case_      (  lowerCAmelCase_	)->	str:





       '''simple docstring'''


       check_slow()








'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


A_							:				Union[str, Any]						=			{
    """configuration_segformer""": ["""SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SegformerConfig""", """SegformerOnnxConfig"""]
}

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_							:				Tuple						=			["""SegformerFeatureExtractor"""]
   A_							:				Tuple						=			["""SegformerImageProcessor"""]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_							:				Dict						=			[
       """SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """SegformerDecodeHead""",
       """SegformerForImageClassification""",
       """SegformerForSemanticSegmentation""",
       """SegformerLayer""",
       """SegformerModel""",
       """SegformerPreTrainedModel""",
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   A_							:				List[str]						=			[
       """TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """TFSegformerDecodeHead""",
       """TFSegformerForImageClassification""",
       """TFSegformerForSemanticSegmentation""",
       """TFSegformerModel""",
       """TFSegformerPreTrainedModel""",
   ]


if TYPE_CHECKING:
   from .configuration_segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig, SegformerOnnxConfig

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .feature_extraction_segformer import SegformerFeatureExtractor
      from .image_processing_segformer import SegformerImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_segformer import (
          SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
          SegformerDecodeHead,
          SegformerForImageClassification,
          SegformerForSemanticSegmentation,
          SegformerLayer,
          SegformerModel,
          SegformerPreTrainedModel,
      )
   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_segformer import (
          TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFSegformerDecodeHead,
          TFSegformerForImageClassification,
          TFSegformerForSemanticSegmentation,
          TFSegformerModel,
          TFSegformerPreTrainedModel,
      )

else:
   import sys

   A_							:				Optional[Any]						=			_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



