
'''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_           =    [(1,)]

def     UpperCamelCase_  (						):
    """simple docstring"""






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

def     UpperCamelCase_  (						):
    """simple docstring"""






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





 @slow
 @require_torch_gpu
 def 							snake_case__		(     self):
     check_slow_torch_cuda()





 @require_torch_gpu
 @slow
 def 							snake_case__		(     self):
     check_slow_torch_cuda()





 @parameterized.expand(lowercase_)
 @slow
 def 							snake_case__		(     self			,							lowercase_=None):
     check_slow()


@slow
@require_torch_gpu
def     UpperCamelCase_  (						):
    """simple docstring"""






    check_slow_torch_cuda()

@require_torch_gpu
@slow
def     UpperCamelCase_  (						):
    """simple docstring"""






    check_slow_torch_cuda()

@slow
@pytest.mark.parametrize("param",		[1]							)
def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE							):
    """simple docstring"""






    check_slow()


@pytest.mark.parametrize("param",		[1]							)
@slow
def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE							):
    """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_           =    {
    "configuration_sam": [
        "SAM_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "SamConfig",
        "SamMaskDecoderConfig",
        "SamPromptEncoderConfig",
        "SamVisionConfig",
    ],
    "processing_sam": ["SamProcessor"],
}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_           =    [
      "SAM_PRETRAINED_MODEL_ARCHIVE_LIST",
      "SamModel",
      "SamPreTrainedModel",
  ]
try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_           =    [
      "TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST",
      "TFSamModel",
      "TFSamPreTrainedModel",
  ]
try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_           =    ["SamImageProcessor"]


if TYPE_CHECKING:
  from .configuration_sam import (
      SAM_PRETRAINED_CONFIG_ARCHIVE_MAP,
      SamConfig,
      SamMaskDecoderConfig,
      SamPromptEncoderConfig,
      SamVisionConfig,
  )
  from .processing_sam import SamProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_sam import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .image_processing_sam import SamImageProcessor

else:
  import sys

  a_           =    _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




