






'''simple docstring'''





import collections
import inspect
import unittest
from typing import Dict, List, Tuple

from transformers import MaskFormerSwinConfig
from transformers.testing_utils import require_torch, require_torch_multi_gpu, torch_device
from transformers.utils import is_torch_available

from ...test_backbone_common import BackboneTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
 import torch
 from torch import nn

 from transformers import MaskFormerSwinBackbone
 from transformers.models.maskformer import MaskFormerSwinModel
class 				lowercase       :


    '''simple docstring'''

    def __init__(					self     :     Any				,     __lowerCamelCase     :     List[Any]				,     __lowerCamelCase     :     List[Any]=13				,     __lowerCamelCase     :     Any=32				,     __lowerCamelCase     :     str=2				,     __lowerCamelCase     :     List[Any]=3				,     __lowerCamelCase     :     Optional[int]=16				,     __lowerCamelCase     :     str=[1, 2, 1]				,     __lowerCamelCase     :     Any=[2, 2, 4]				,     __lowerCamelCase     :     Optional[Any]=2				,     __lowerCamelCase     :     Any=2.0				,     __lowerCamelCase     :     Dict=True				,     __lowerCamelCase     :     Optional[Any]=0.0				,     __lowerCamelCase     :     str=0.0				,     __lowerCamelCase     :     str=0.1				,     __lowerCamelCase     :     int="gelu"				,     __lowerCamelCase     :     Union[str, Any]=False				,     __lowerCamelCase     :     int=True				,     __lowerCamelCase     :     List[Any]=0.0_2				,     __lowerCamelCase     :     Any=1E-5				,     __lowerCamelCase     :     str=True				,     __lowerCamelCase     :     Tuple=None				,     __lowerCamelCase     :     List[Any]=True				,     __lowerCamelCase     :     int=10				,     __lowerCamelCase     :     Optional[int]=8				,     __lowerCamelCase     :     str=["stage1", "stage2", "stage3"]				,     __lowerCamelCase     :     List[str]=[1, 2, 3]				,     )							->							str:

     '''simple docstring'''




     lowerCamelCase__  =     parent
     lowerCamelCase__  =     batch_size
     lowerCamelCase__  =     image_size
     lowerCamelCase__  =     patch_size
     lowerCamelCase__  =     num_channels
     lowerCamelCase__  =     embed_dim
     lowerCamelCase__  =     depths
     lowerCamelCase__  =     num_heads
     lowerCamelCase__  =     window_size
     lowerCamelCase__  =     mlp_ratio
     lowerCamelCase__  =     qkv_bias
     lowerCamelCase__  =     hidden_dropout_prob
     lowerCamelCase__  =     attention_probs_dropout_prob
     lowerCamelCase__  =     drop_path_rate
     lowerCamelCase__  =     hidden_act
     lowerCamelCase__  =     use_absolute_embeddings
     lowerCamelCase__  =     patch_norm
     lowerCamelCase__  =     layer_norm_eps
     lowerCamelCase__  =     initializer_range
     lowerCamelCase__  =     is_training
     lowerCamelCase__  =     scope
     lowerCamelCase__  =     use_labels
     lowerCamelCase__  =     type_sequence_label_size
     lowerCamelCase__  =     encoder_stride
     lowerCamelCase__  =     out_features
     lowerCamelCase__  =     out_indices

    def    a__				(					self     :     Any     )							->							Tuple:

     '''simple docstring'''




     lowerCamelCase__  =     floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]     )

     lowerCamelCase__  =     None
     if self.use_labels:
      lowerCamelCase__  =     ids_tensor([self.batch_size]				,     self.type_sequence_label_size     )

     lowerCamelCase__  =     self.get_config()

     return config, pixel_values, labels

    def    a__				(					self     :     Optional[Any]     )							->							List[str]:

     '''simple docstring'''




     return MaskFormerSwinConfig(
         image_size=self.image_size				,     patch_size=self.patch_size				,     num_channels=self.num_channels				,     embed_dim=self.embed_dim				,     depths=self.depths				,     num_heads=self.num_heads				,     window_size=self.window_size				,     mlp_ratio=self.mlp_ratio				,     qkv_bias=self.qkv_bias				,     hidden_dropout_prob=self.hidden_dropout_prob				,     attention_probs_dropout_prob=self.attention_probs_dropout_prob				,     drop_path_rate=self.drop_path_rate				,     hidden_act=self.hidden_act				,     use_absolute_embeddings=self.use_absolute_embeddings				,     path_norm=self.patch_norm				,     layer_norm_eps=self.layer_norm_eps				,     initializer_range=self.initializer_range				,     encoder_stride=self.encoder_stride				,     out_features=self.out_features				,     out_indices=self.out_indices				,     )

    def    a__				(					self     :     Optional[int]				,     __lowerCamelCase     :     Optional[Any]				,     __lowerCamelCase     :     List[str]				,     __lowerCamelCase     :     int     )							->							Tuple:

     '''simple docstring'''




     lowerCamelCase__  =     MaskFormerSwinModel(config=__lowerCamelCase     )
     model.to(__lowerCamelCase     )
     model.eval()
     lowerCamelCase__  =     model(__lowerCamelCase     )

     lowerCamelCase__  =     ((config.image_size // config.patch_size) ** 2) // (4 ** (len(config.depths     ) - 1))
     lowerCamelCase__  =     int(config.embed_dim * 2 ** (len(config.depths     ) - 1)     )

     self.parent.assertEqual(result.last_hidden_state.shape				,     (self.batch_size, expected_seq_len, expected_dim)     )

    def    a__				(					self     :     int				,     __lowerCamelCase     :     int				,     __lowerCamelCase     :     Optional[int]				,     __lowerCamelCase     :     Optional[int]     )							->							Any:

     '''simple docstring'''




     lowerCamelCase__  =     MaskFormerSwinBackbone(config=__lowerCamelCase     )
     model.to(__lowerCamelCase     )
     model.eval()
     lowerCamelCase__  =     model(__lowerCamelCase     )

     # verify feature maps
     self.parent.assertEqual(len(result.feature_maps     )				,     len(config.out_features     )     )
     self.parent.assertListEqual(list(result.feature_maps[0].shape     )				,     [13, 16, 16, 16]     )

     # verify channels
     self.parent.assertEqual(len(model.channels     )				,     len(config.out_features     )     )
     self.parent.assertListEqual(model.channels				,     [16, 32, 64]     )

     # verify ValueError
     with self.parent.assertRaises(__lowerCamelCase     ):
      lowerCamelCase__  =     ["stem"]
      lowerCamelCase__  =     MaskFormerSwinBackbone(config=__lowerCamelCase     )




    def    a__				(					self     :     Dict     )							->							int:

     '''simple docstring'''




     lowerCamelCase__  =     self.prepare_config_and_inputs()
     lowerCamelCase__  ,	lowerCamelCase__  ,	lowerCamelCase__  =     config_and_inputs
     lowerCamelCase__  =     {"pixel_values": pixel_values}
     return config, inputs_dict
@require_torch
class 				lowercase       (							_lowerCamelCase ,       _lowerCamelCase ,       unittest.TestCase      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							(
        (
            MaskFormerSwinModel,
            MaskFormerSwinBackbone,
        )
        if is_torch_available()
        else ()
    )
    lowerCAmelCase__      				=							{"feature-extraction": MaskFormerSwinModel} if is_torch_available() else {}
    lowerCAmelCase__      				=							False
    lowerCAmelCase__      				=							False
    lowerCAmelCase__      				=							False
    lowerCAmelCase__      				=							False
    lowerCAmelCase__      				=							False

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

     '''simple docstring'''




     lowerCamelCase__  =     MaskFormerSwinModelTester(self     )
     lowerCamelCase__  =     ConfigTester(self				,     config_class=__lowerCamelCase				,     embed_dim=37     )

    @require_torch_multi_gpu
    @unittest.skip(
        reason=(
            "`MaskFormerSwinModel` outputs `hidden_states_spatial_dimensions` which doesn't work well with"
            " `nn.DataParallel`"
        )     )
    def    a__				(					self     :     List[str]     )							->							Tuple:

     '''simple docstring'''




     pass

    def    a__				(					self     :     Tuple     )							->							Optional[Any]:

     '''simple docstring'''




     self.create_and_test_config_common_properties()
     self.config_tester.create_and_test_config_to_json_string()
     self.config_tester.create_and_test_config_to_json_file()
     self.config_tester.create_and_test_config_from_and_save_pretrained()
     self.config_tester.create_and_test_config_with_num_labels()
     self.config_tester.check_config_can_be_init_without_params()
     self.config_tester.check_config_arguments_init()

    def    a__				(					self     :     Dict     )							->							int:

     '''simple docstring'''




     return

    def    a__				(					self     :     Tuple     )							->							List[str]:

     '''simple docstring'''




     lowerCamelCase__  =     self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_model(*__lowerCamelCase     )

    def    a__				(					self     :     Any     )							->							Optional[int]:

     '''simple docstring'''




     lowerCamelCase__  =     self.model_tester.prepare_config_and_inputs()
     self.model_tester.create_and_check_backbone(*__lowerCamelCase     )

    @unittest.skip("Swin does not use inputs_embeds"     )
    def    a__				(					self     :     List[Any]     )							->							List[str]:

     '''simple docstring'''




     pass

    @unittest.skip("Swin does not support feedforward chunking"     )
    def    a__				(					self     :     int     )							->							Dict:

     '''simple docstring'''




     pass

    def    a__				(					self     :     Any     )							->							Optional[int]:

     '''simple docstring'''




     lowerCamelCase__  ,	lowerCamelCase__  =     self.model_tester.prepare_config_and_inputs_for_common()

     for model_class in self.all_model_classes:
      lowerCamelCase__  =     model_class(__lowerCamelCase     )
      self.assertIsInstance(model.get_input_embeddings()				,     (nn.Module)     )
      lowerCamelCase__  =     model.get_output_embeddings()
      self.assertTrue(x is None or isinstance(__lowerCamelCase				,     nn.Linear     )     )

    def    a__				(					self     :     Optional[int]     )							->							int:

     '''simple docstring'''




     lowerCamelCase__  ,	lowerCamelCase__  =     self.model_tester.prepare_config_and_inputs_for_common()

     for model_class in self.all_model_classes:
      lowerCamelCase__  =     model_class(__lowerCamelCase     )
      lowerCamelCase__  =     inspect.signature(model.forward     )
      # signature.parameters is an OrderedDict => so arg_names order is deterministic
      lowerCamelCase__  =     [*signature.parameters.keys()]

      lowerCamelCase__  =     ["pixel_values"]
      self.assertListEqual(arg_names[:1]				,     __lowerCamelCase     )

    @unittest.skip(reason="MaskFormerSwin is only used as backbone and doesn't support output_attentions"     )
    def    a__				(					self     :     Dict     )							->							Optional[int]:

     '''simple docstring'''




     pass

    @unittest.skip(reason="MaskFormerSwin is only used as an internal backbone"     )
    def    a__				(					self     :     str     )							->							Tuple:

     '''simple docstring'''




     pass

    def    a__				(					self     :     List[Any]				,     __lowerCamelCase     :     Optional[int]				,     __lowerCamelCase     :     str				,     __lowerCamelCase     :     Optional[int]				,     __lowerCamelCase     :     Optional[int]     )							->							int:

     '''simple docstring'''




     lowerCamelCase__  =     model_class(__lowerCamelCase     )
     model.to(__lowerCamelCase     )
     model.eval()

     with torch.no_grad():
      lowerCamelCase__  =     model(**self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase     )     )

     lowerCamelCase__  =     outputs.hidden_states

     lowerCamelCase__  =     getattr(
         self.model_tester				,     "expected_num_hidden_layers"				,     len(self.model_tester.depths     ) + 1     )
     self.assertEqual(len(__lowerCamelCase     )				,     __lowerCamelCase     )

     # Swin has a different seq_length
     lowerCamelCase__  =     (
         config.patch_size
         if isinstance(config.patch_size				,     collections.abc.Iterable     )
         else (config.patch_size, config.patch_size)
     )

     lowerCamelCase__  =     (image_size[1] // patch_size[1]) * (image_size[0] // patch_size[0])

     self.assertListEqual(
         list(hidden_states[0].shape[-2:]     )				,     [num_patches, self.model_tester.embed_dim]				,     )

    def    a__				(					self     :     Any     )							->							Any:

     '''simple docstring'''




     lowerCamelCase__  ,	lowerCamelCase__  =     self.model_tester.prepare_config_and_inputs_for_common()

     lowerCamelCase__  =     (
         self.model_tester.image_size
         if isinstance(self.model_tester.image_size				,     collections.abc.Iterable     )
         else (self.model_tester.image_size, self.model_tester.image_size)
     )

     for model_class in self.all_model_classes:
      lowerCamelCase__  =     True
      self.check_hidden_states_output(__lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase     )

      # check that output_hidden_states also work using config
      del inputs_dict["output_hidden_states"]
      lowerCamelCase__  =     True

      self.check_hidden_states_output(__lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase     )

    def    a__				(					self     :     str     )							->							int:

     '''simple docstring'''




     lowerCamelCase__  ,	lowerCamelCase__  =     self.model_tester.prepare_config_and_inputs_for_common()
     lowerCamelCase__  =     3

     lowerCamelCase__  =     (
         self.model_tester.image_size
         if isinstance(self.model_tester.image_size				,     collections.abc.Iterable     )
         else (self.model_tester.image_size, self.model_tester.image_size)
     )
     lowerCamelCase__  =     (
         config.patch_size
         if isinstance(config.patch_size				,     collections.abc.Iterable     )
         else (config.patch_size, config.patch_size)
     )

     lowerCamelCase__  =     image_size[0] + patch_size[0] - (image_size[0] % patch_size[0])
     lowerCamelCase__  =     image_size[1] + patch_size[1] - (image_size[1] % patch_size[1])

     for model_class in self.all_model_classes:
      lowerCamelCase__  =     True
      self.check_hidden_states_output(__lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase				,     (padded_height, padded_width)     )

      # check that output_hidden_states also work using config
      del inputs_dict["output_hidden_states"]
      lowerCamelCase__  =     True
      self.check_hidden_states_output(__lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase				,     (padded_height, padded_width)     )

    @unittest.skip(reason="MaskFormerSwin doesn't have pretrained checkpoints"     )
    def    a__				(					self     :     Tuple     )							->							Any:

     '''simple docstring'''




     pass

    @unittest.skip(reason="This will be fixed once MaskFormerSwin is replaced by native Swin"     )
    def    a__				(					self     :     Optional[Any]     )							->							Any:

     '''simple docstring'''




     pass

    @unittest.skip(reason="This will be fixed once MaskFormerSwin is replaced by native Swin"     )
    def    a__				(					self     :     Any     )							->							Tuple:

     '''simple docstring'''




     pass




    def    a__				(					self     :     str     )							->							Dict:

     '''simple docstring'''




     lowerCamelCase__  ,	lowerCamelCase__  =     self.model_tester.prepare_config_and_inputs_for_common()

     def set_nan_tensor_to_zero(__lowerCamelCase     :     Optional[int]     ):
      lowerCamelCase__  =     0
      return t

     def check_equivalence(__lowerCamelCase     :     List[str]				,     __lowerCamelCase     :     Tuple				,     __lowerCamelCase     :     Dict				,     __lowerCamelCase     :     Tuple={}     ):
      with torch.no_grad():
       lowerCamelCase__  =     model(**__lowerCamelCase				,     return_dict=__lowerCamelCase				,     **__lowerCamelCase     )
       lowerCamelCase__  =     model(**__lowerCamelCase				,     return_dict=__lowerCamelCase				,     **__lowerCamelCase     ).to_tuple()

       def recursive_check(__lowerCamelCase     :     List[str]				,     __lowerCamelCase     :     int     ):
        if isinstance(__lowerCamelCase				,     (List, Tuple)     ):
         for tuple_iterable_value, dict_iterable_value in zip(__lowerCamelCase				,     __lowerCamelCase     ):
          recursive_check(__lowerCamelCase				,     __lowerCamelCase     )
        elif isinstance(__lowerCamelCase				,     __lowerCamelCase     ):
         for tuple_iterable_value, dict_iterable_value in zip(
             tuple_object.values()				,     dict_object.values()     ):
          recursive_check(__lowerCamelCase				,     __lowerCamelCase     )
        elif tuple_object is None:
         return
        else:
         self.assertTrue(
             torch.allclose(
                 set_nan_tensor_to_zero(__lowerCamelCase     )				,     set_nan_tensor_to_zero(__lowerCamelCase     )				,     atol=1E-5     )				,     msg=(
                 "Tuple and dict output are not equal. Difference:"
                 f''' {torch.max(torch.abs(tuple_object - dict_object     )     )}. Tuple has `nan`:'''
                 f''' {torch.isnan(__lowerCamelCase     ).any()} and `inf`: {torch.isinf(__lowerCamelCase     )}. Dict has'''
                 f''' `nan`: {torch.isnan(__lowerCamelCase     ).any()} and `inf`: {torch.isinf(__lowerCamelCase     )}.'''
             )				,     )

       recursive_check(__lowerCamelCase				,     __lowerCamelCase     )

     for model_class in self.all_model_classes:
      lowerCamelCase__  =     model_class(__lowerCamelCase     )
      model.to(__lowerCamelCase     )
      model.eval()

      lowerCamelCase__  =     self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase     )
      lowerCamelCase__  =     self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase     )
      check_equivalence(__lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase     )

      lowerCamelCase__  =     self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase				,     return_labels=__lowerCamelCase     )
      lowerCamelCase__  =     self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase				,     return_labels=__lowerCamelCase     )
      check_equivalence(__lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase     )

      lowerCamelCase__  =     self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase     )
      lowerCamelCase__  =     self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase     )
      check_equivalence(__lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase				,     {"output_hidden_states": True}     )

      lowerCamelCase__  =     self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase				,     return_labels=__lowerCamelCase     )
      lowerCamelCase__  =     self._prepare_for_class(__lowerCamelCase				,     __lowerCamelCase				,     return_labels=__lowerCamelCase     )
      check_equivalence(__lowerCamelCase				,     __lowerCamelCase				,     __lowerCamelCase				,     {"output_hidden_states": True}     )
@require_torch
class 				lowercase       (							unittest.TestCase ,       _lowerCamelCase      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							(MaskFormerSwinBackbone,) if is_torch_available() else ()
    lowerCAmelCase__      				=							MaskFormerSwinConfig

    def    a__				(					self     :     Optional[int]     )							->							Tuple:

     '''simple docstring'''




     lowerCamelCase__  =     MaskFormerSwinModelTester(self     )




    def    a__				(					self     :     Optional[Any]     )							->							Optional[Any]:

     '''simple docstring'''




     lowerCamelCase__  ,	lowerCamelCase__  =     self.model_tester.prepare_config_and_inputs_for_common()
     lowerCamelCase__  =     inputs_dict["pixel_values"].shape[0]

     for backbone_class in self.all_model_classes:
      lowerCamelCase__  =     backbone_class(__lowerCamelCase     )
      backbone.to(__lowerCamelCase     )
      backbone.eval()

      lowerCamelCase__  =     backbone(**__lowerCamelCase     )

      # Test default outputs and verify feature maps
      self.assertIsInstance(outputs.feature_maps				,     __lowerCamelCase     )
      self.assertTrue(len(outputs.feature_maps     ) == len(backbone.channels     )     )
      for feature_map, n_channels in zip(outputs.feature_maps				,     backbone.channels     ):
       self.assertTrue(feature_map.shape[:2]				,     (batch_size, n_channels)     )
      self.assertIsNone(outputs.hidden_states     )
      self.assertIsNone(outputs.attentions     )

      # Test output_hidden_states=True
      lowerCamelCase__  =     backbone(**__lowerCamelCase				,     output_hidden_states=__lowerCamelCase     )
      self.assertIsNotNone(outputs.hidden_states     )
      self.assertTrue(len(outputs.hidden_states     )				,     len(backbone.stage_names     )     )
      # We skip the stem layer
      for hidden_states, n_channels in zip(outputs.hidden_states[1:]				,     backbone.channels     ):
       for hidden_state in hidden_states:
        # Hidden states are in the format (batch_size, (height * width), n_channels)
        lowerCamelCase__  ,	lowerCamelCase__  ,	lowerCamelCase__  =     hidden_state.shape
        self.assertTrue((h_batch_size, h_n_channels)				,     (batch_size, n_channels)     )

            # Test output_attentions=True
      if self.has_attentions:
       lowerCamelCase__  =     backbone(**__lowerCamelCase				,     output_attentions=__lowerCamelCase     )
       self.assertIsNotNone(outputs.attentions     )









'''simple docstring'''





from typing import TYPE_CHECKING

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


__A							:							Union[str, Any]  							=		{
    """configuration_layoutlmv2""": ["""LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LayoutLMv2Config"""],
    """processing_layoutlmv2""": ["""LayoutLMv2Processor"""],
    """tokenization_layoutlmv2""": ["""LayoutLMv2Tokenizer"""],
}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __A							:							Optional[Any]  							=		["""LayoutLMv2TokenizerFast"""]

try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __A							:							List[Any]  							=		["""LayoutLMv2FeatureExtractor"""]
 __A							:							List[Any]  							=		["""LayoutLMv2ImageProcessor"""]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __A							:							Any  							=		[
     """LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """LayoutLMv2ForQuestionAnswering""",
     """LayoutLMv2ForSequenceClassification""",
     """LayoutLMv2ForTokenClassification""",
     """LayoutLMv2Layer""",
     """LayoutLMv2Model""",
     """LayoutLMv2PreTrainedModel""",
 ]

if TYPE_CHECKING:
 from .configuration_layoutlmva import LAYOUTLMV2_PRETRAINED_CONFIG_ARCHIVE_MAP, LayoutLMvaConfig
 from .processing_layoutlmva import LayoutLMvaProcessor
 from .tokenization_layoutlmva import LayoutLMvaTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_layoutlmva_fast import LayoutLMvaTokenizerFast

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .feature_extraction_layoutlmva import LayoutLMvaFeatureExtractor, LayoutLMvaImageProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_layoutlmva import (
      LAYOUTLMV2_PRETRAINED_MODEL_ARCHIVE_LIST,
      LayoutLMvaForQuestionAnswering,
      LayoutLMvaForSequenceClassification,
      LayoutLMvaForTokenClassification,
      LayoutLMvaLayer,
      LayoutLMvaModel,
      LayoutLMvaPreTrainedModel,
  )
else:
 import sys

 __A							:							Tuple  							=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

