


'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__lowercase:		Any    						=  {
    "configuration_swin2sr": ["SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP", "Swin2SRConfig"],
}


try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowercase:		Optional[int]    						=  [
           "SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST",
           "Swin2SRForImageSuperResolution",
           "Swin2SRModel",
           "Swin2SRPreTrainedModel",
       ]


try:
       if not is_vision_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowercase:		Any    						=  ["Swin2SRImageProcessor"]


if TYPE_CHECKING:
       from .configuration_swinasr import SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinaSRConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_swinasr import (
                  SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST,
                  SwinaSRForImageSuperResolution,
                  SwinaSRModel,
                  SwinaSRPreTrainedModel,
              )

       try:
              if not is_vision_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .image_processing_swinasr import SwinaSRImageProcessor


else:
       import sys

       __lowercase:		List[str]    						=  _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




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

__lowerCamelCase								=      [(1,)]







def  _snake_case			(							)  ->  str:






      '''simple docstring'''







      UpperCAmelCase_	:						Optional[Any]					   =		bool(os.getenv("RUN_SLOW"       ,	0     )     )
      if run_slow:
            assert True
      else:
            assert False, "should have been skipped"







def  _snake_case			(							)  ->  Tuple:






      '''simple docstring'''







      UpperCAmelCase_	:						Union[str, 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 	snake_case_			(unittest.TestCase	):




       """simple docstring"""






       @slow
       @require_torch_gpu
       def 			A_ (  self):

             """simple docstring"""





             check_slow_torch_cuda()



       @require_torch_gpu
       @slow
       def 			A_ (  self):

             """simple docstring"""





             check_slow_torch_cuda()



       @parameterized.expand(lowercase)
       @slow
       def 			A_ (  self  ,lowercase=None):

             """simple docstring"""





             check_slow()







@slow
@require_torch_gpu
def  _snake_case			(							)  ->  str:






      '''simple docstring'''







      check_slow_torch_cuda()







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






      '''simple docstring'''







      check_slow_torch_cuda()







@slow
@pytest.mark.parametrize("param"       ,	[1]     )
def  _snake_case			(							__snake_case     )  ->  Optional[Any]:






      '''simple docstring'''







      check_slow()







@pytest.mark.parametrize("param"       ,	[1]     )
@slow
def  _snake_case			(							__snake_case     )  ->  Any:






      '''simple docstring'''







      check_slow()
