
"""simple docstring"""





import inspect
import unittest

import numpy as np

from tests.test_modeling_common import floats_tensor
from transformers import DetrConfig, MaskFormerConfig, SwinConfig, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
from transformers.utils import cached_property

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
  import torch

  from transformers import MaskFormerForInstanceSegmentation, MaskFormerModel

  if is_vision_available():
    from transformers import MaskFormerImageProcessor

if is_vision_available():
  from PIL import Image



class __lowerCAmelCase				:




   """simple docstring"""







   def __init__(				self						:					Optional[int]       ,   _snake_case						:					Union[str, Any]       ,   _snake_case						:					Tuple=2       ,   _snake_case						:					Any=True       ,   _snake_case						:					Tuple=False       ,   _snake_case						:					Optional[Any]=10       ,   _snake_case						:					Optional[Any]=3       ,   _snake_case						:					int=32 * 4       ,   _snake_case						:					List[Any]=32 * 6       ,   _snake_case						:					Dict=4       ,   _snake_case						:					Optional[Any]=32       ,   )      -> Any:







        """simple docstring"""
        A_				 =						parent
        A_				 =						batch_size
        A_				 =						is_training
        A_				 =						use_auxiliary_loss
        A_				 =						num_queries
        A_				 =						num_channels
        A_				 =						min_size
        A_				 =						max_size
        A_				 =						num_labels
        A_				 =						mask_feature_size




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







        """simple docstring"""
        A_				 =						floats_tensor([self.batch_size, self.num_channels, self.min_size, self.max_size]	).to(
            snake_case_	)

        A_				 =						torch.ones([self.batch_size, self.min_size, self.max_size]       ,   device=snake_case_	)

        A_				 =						(
            torch.rand([self.batch_size, self.num_labels, self.min_size, self.max_size]       ,   device=snake_case_	) > 0.5
        ).float()
        A_				 =						(torch.rand((self.batch_size, self.num_labels)       ,   device=snake_case_	) > 0.5).long()

        A_				 =						self.get_config()
        return config, pixel_values, pixel_mask, mask_labels, class_labels




   def      lowerCamelCase__     (				self						:					Dict	)      -> Optional[int]:







        """simple docstring"""
        return MaskFormerConfig.from_backbone_and_decoder_configs(
            backbone_config=SwinConfig(
                depths=[1, 1, 1, 1]       ,   )       ,   decoder_config=DetrConfig(
                decoder_ffn_dim=128       ,   num_queries=self.num_queries       ,   decoder_attention_heads=2       ,   d_model=self.mask_feature_size       ,   )       ,   mask_feature_size=self.mask_feature_size       ,   fpn_feature_size=self.mask_feature_size       ,   num_channels=self.num_channels       ,   num_labels=self.num_labels       ,   )




   def      lowerCamelCase__     (				self						:					Union[str, Any]	)      -> Dict:







        """simple docstring"""
        A_ ,    A_ ,    A_ ,    A_ ,    A_				 =						self.prepare_config_and_inputs()
        A_				 =						{"pixel_values": pixel_values, "pixel_mask": pixel_mask}
        return config, inputs_dict




   def      lowerCamelCase__     (				self						:					str       ,   _snake_case						:					Optional[int]       ,   _snake_case						:					Optional[Any]	)      -> int:







        """simple docstring"""
        A_				 =						output.encoder_hidden_states
        A_				 =						output.pixel_decoder_hidden_states
        A_				 =						output.transformer_decoder_hidden_states

        self.parent.assertTrue(len(snake_case_	)       ,   len(config.backbone_config.depths	)	)
        self.parent.assertTrue(len(snake_case_	)       ,   len(config.backbone_config.depths	)	)
        self.parent.assertTrue(len(snake_case_	)       ,   config.decoder_config.decoder_layers	)




   def      lowerCamelCase__     (				self						:					List[str]       ,   _snake_case						:					Tuple       ,   _snake_case						:					Optional[Any]       ,   _snake_case						:					Union[str, Any]       ,   _snake_case						:					Tuple=False	)      -> Optional[Any]:







        """simple docstring"""
        with torch.no_grad():
             A_				 =						MaskFormerModel(config=snake_case_	)
             model.to(snake_case_	)
             model.eval()

             A_				 =						model(pixel_values=snake_case_       ,   pixel_mask=snake_case_	)
             A_				 =						model(snake_case_       ,   output_hidden_states=snake_case_	)
        # the correct shape of output.transformer_decoder_hidden_states ensure the correcteness of the
        # encoder and pixel decoder
        self.parent.assertEqual(
            output.transformer_decoder_last_hidden_state.shape       ,   (self.batch_size, self.num_queries, self.mask_feature_size)       ,   )
        # let's ensure the other two hidden state exists
        self.parent.assertTrue(output.pixel_decoder_last_hidden_state is not None	)
        self.parent.assertTrue(output.encoder_last_hidden_state is not None	)

        if output_hidden_states:
             self.check_output_hidden_state(snake_case_       ,   snake_case_	)






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







        """simple docstring"""
        A_				 =						MaskFormerForInstanceSegmentation(config=snake_case_	)
        model.to(snake_case_	)
        model.eval()

        def comm_check_on_output(_snake_case						:					Tuple	):
             # let's still check that all the required stuff is there
             self.parent.assertTrue(result.transformer_decoder_last_hidden_state is not None	)
             self.parent.assertTrue(result.pixel_decoder_last_hidden_state is not None	)
             self.parent.assertTrue(result.encoder_last_hidden_state is not None	)
             # okay, now we need to check the logits shape
             # due to the encoder compression, masks have a //4 spatial size
             self.parent.assertEqual(
                 result.masks_queries_logits.shape       ,   (self.batch_size, self.num_queries, self.min_size // 4, self.max_size // 4)       ,   )
             # + 1 for null class
             self.parent.assertEqual(
                 result.class_queries_logits.shape       ,   (self.batch_size, self.num_queries, self.num_labels + 1)	)

        with torch.no_grad():
             A_				 =						model(pixel_values=snake_case_       ,   pixel_mask=snake_case_	)
             A_				 =						model(snake_case_	)

             comm_check_on_output(snake_case_	)

             A_				 =						model(
                 pixel_values=snake_case_       ,   pixel_mask=snake_case_       ,   mask_labels=snake_case_       ,   class_labels=snake_case_	)

        comm_check_on_output(snake_case_	)

        self.parent.assertTrue(result.loss is not None	)
        self.parent.assertEqual(result.loss.shape       ,   torch.Size([1]	)	)





@require_torch
class __lowerCAmelCase				(					_a     ,				_a     ,				unittest.TestCase      ):




   """simple docstring"""







   snake_case	      =				(MaskFormerModel, MaskFormerForInstanceSegmentation) if is_torch_available() else ()
   snake_case	      =				(
       {"""feature-extraction""": MaskFormerModel, """image-segmentation""": MaskFormerForInstanceSegmentation}
       if is_torch_available()
       else {}
   )

   snake_case	      =				False
   snake_case	      =				False
   snake_case	      =				False
   snake_case	      =				False




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







        """simple docstring"""
        A_				 =						MaskFormerModelTester(self	)
        A_				 =						ConfigTester(self       ,   config_class=snake_case_       ,   has_text_modality=snake_case_	)




   def      lowerCamelCase__     (				self						:					List[Any]	)      -> Any:







        """simple docstring"""
        self.config_tester.run_common_tests()




   def      lowerCamelCase__     (				self						:					List[str]	)      -> Optional[int]:







        """simple docstring"""
        A_ ,    A_				 =						self.model_tester.prepare_config_and_inputs_for_common()
        self.model_tester.create_and_check_maskformer_model(snake_case_       ,   **snake_case_       ,   output_hidden_states=snake_case_	)




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







        """simple docstring"""
        A_				 =						self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_maskformer_instance_segmentation_head_model(*snake_case_	)




   @unittest.skip(reason="MaskFormer does not use inputs_embeds"	)
   def      lowerCamelCase__     (				self						:					Optional[Any]	)      -> Union[str, Any]:







        """simple docstring"""
        pass




   @unittest.skip(reason="MaskFormer does not have a get_input_embeddings method"	)
   def      lowerCamelCase__     (				self						:					str	)      -> str:







        """simple docstring"""
        pass




   @unittest.skip(reason="MaskFormer is not a generative model"	)
   def      lowerCamelCase__     (				self						:					List[str]	)      -> int:







        """simple docstring"""
        pass




   @unittest.skip(reason="MaskFormer does not use token embeddings"	)
   def      lowerCamelCase__     (				self						:					Optional[int]	)      -> int:







        """simple docstring"""
        pass




   @require_torch_multi_gpu
   @unittest.skip(
       reason="MaskFormer has some layers using `add_module` which doesn\'t work well with `nn.DataParallel`"	)
   def      lowerCamelCase__     (				self						:					Optional[int]	)      -> Dict:







        """simple docstring"""
        pass




   @unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."	)
   def      lowerCamelCase__     (				self						:					int	)      -> Any:







        """simple docstring"""
        pass




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







        """simple docstring"""
        A_ ,    A_				 =						self.model_tester.prepare_config_and_inputs_for_common()

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

             A_				 =						["pixel_values"]
             self.assertListEqual(arg_names[:1]       ,   snake_case_	)




   @slow
   def      lowerCamelCase__     (				self						:					Optional[Any]	)      -> Dict:







        """simple docstring"""
        for model_name in ["facebook/maskformer-swin-small-coco"]:
             A_				 =						MaskFormerModel.from_pretrained(snake_case_	)
             self.assertIsNotNone(snake_case_	)




   def      lowerCamelCase__     (				self						:					Union[str, Any]	)      -> int:







        """simple docstring"""
        A_				 =						(self.model_tester.min_size,) * 2
        A_				 =						{
            "pixel_values": torch.randn((2, 3, *size)       ,   device=snake_case_	),
            "mask_labels": torch.randn((2, 10, *size)       ,   device=snake_case_	),
            "class_labels": torch.zeros(2       ,   10       ,   device=snake_case_	).long(),
        }

        A_				 =						MaskFormerForInstanceSegmentation(MaskFormerConfig()	).to(snake_case_	)
        A_				 =						model(**snake_case_	)
        self.assertTrue(outputs.loss is not None	)




   def      lowerCamelCase__     (				self						:					Any	)      -> Dict:







        """simple docstring"""
        A_ ,    A_				 =						self.model_tester.prepare_config_and_inputs_for_common()
        self.model_tester.create_and_check_maskformer_model(snake_case_       ,   **snake_case_       ,   output_hidden_states=snake_case_	)




   def      lowerCamelCase__     (				self						:					List[str]	)      -> List[str]:







        """simple docstring"""
        A_ ,    A_				 =						self.model_tester.prepare_config_and_inputs_for_common()

        for model_class in self.all_model_classes:
             A_				 =						model_class(snake_case_	).to(snake_case_	)
             A_				 =						model(**snake_case_       ,   output_attentions=snake_case_	)
             self.assertTrue(outputs.attentions is not None	)




   def      lowerCamelCase__     (				self						:					Optional[int]	)      -> str:







        """simple docstring"""
        if not self.model_tester.is_training:
             return
        # only MaskFormerForInstanceSegmentation has the loss
        A_				 =						self.all_model_classes[1]
        A_ ,    A_ ,    A_ ,    A_ ,    A_				 =						self.model_tester.prepare_config_and_inputs()

        A_				 =						model_class(snake_case_	)
        model.to(snake_case_	)
        model.train()

        A_				 =						model(snake_case_       ,   mask_labels=snake_case_       ,   class_labels=snake_case_	).loss
        loss.backward()






   def      lowerCamelCase__     (				self						:					List[str]	)      -> int:







        """simple docstring"""
        # only MaskFormerForInstanceSegmentation has the loss
        A_				 =						self.all_model_classes[1]
        A_ ,    A_ ,    A_ ,    A_ ,    A_				 =						self.model_tester.prepare_config_and_inputs()
        A_				 =						True
        A_				 =						True

        A_				 =						model_class(snake_case_	)
        model.to(snake_case_	)
        model.train()

        A_				 =						model(snake_case_       ,   mask_labels=snake_case_       ,   class_labels=snake_case_	)

        A_				 =						outputs.encoder_hidden_states[0]
        encoder_hidden_states.retain_grad()

        A_				 =						outputs.pixel_decoder_hidden_states[0]
        pixel_decoder_hidden_states.retain_grad()
        # we requires_grad=True in inputs_embeds (line 2152), the original implementation don't
        A_				 =						outputs.transformer_decoder_hidden_states[0]
        transformer_decoder_hidden_states.retain_grad()

        A_				 =						outputs.attentions[0]
        attentions.retain_grad()

        outputs.loss.backward(retain_graph=snake_case_	)

        self.assertIsNotNone(encoder_hidden_states.grad	)
        self.assertIsNotNone(pixel_decoder_hidden_states.grad	)
        self.assertIsNotNone(transformer_decoder_hidden_states.grad	)
        self.assertIsNotNone(attentions.grad	)





UpperCamelCase_					:						Any				= 1e-4
def 							A_     ():

     '''simple docstring'''





     A_				 =						Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"				)
     return image




@require_vision
@slow
class __lowerCAmelCase				(					unittest.TestCase      ):




   """simple docstring"""







   @cached_property
   def      lowerCamelCase__     (				self						:					List[str]	)      -> Optional[Any]:







        """simple docstring"""
        return (
            MaskFormerImageProcessor.from_pretrained("facebook/maskformer-swin-small-coco"	)
            if is_vision_available()
            else None
        )




   def      lowerCamelCase__     (				self						:					Union[str, Any]	)      -> Optional[Any]:







        """simple docstring"""
        A_				 =						MaskFormerModel.from_pretrained("facebook/maskformer-swin-small-coco"	).to(snake_case_	)
        A_				 =						self.default_image_processor
        A_				 =						prepare_img()
        A_				 =						image_processor(snake_case_       ,   return_tensors="pt"	).to(snake_case_	)
        A_				 =						inputs["pixel_values"].shape
        # check size is divisible by 32
        self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0	)
        # check size
        self.assertEqual(snake_case_       ,   (1, 3, 800, 1_088)	)

        with torch.no_grad():
             A_				 =						model(**snake_case_	)

        A_				 =						torch.tensor(
            [[-0.0_4_8_2, 0.9_2_2_8, 0.4_9_5_1], [-0.2_5_4_7, 0.8_0_1_7, 0.8_5_2_7], [-0.0_0_6_9, 0.3_3_8_5, -0.0_0_8_9]]	).to(snake_case_	)
        self.assertTrue(
            torch.allclose(
                outputs.encoder_last_hidden_state[0, 0, :3, :3]       ,   snake_case_       ,   atol=snake_case_	)	)

        A_				 =						torch.tensor(
            [[-0.8_4_2_2, -0.8_4_3_4, -0.9_7_1_8], [-1.0_1_4_4, -0.5_5_6_5, -0.4_1_9_5], [-1.0_0_3_8, -0.4_4_8_4, -0.1_9_6_1]]	).to(snake_case_	)
        self.assertTrue(
            torch.allclose(
                outputs.pixel_decoder_last_hidden_state[0, 0, :3, :3]       ,   snake_case_       ,   atol=snake_case_	)	)

        A_				 =						torch.tensor(
            [[0.2_8_5_2, -0.0_1_5_9, 0.9_7_3_5], [0.6_2_5_4, 0.1_8_5_8, 0.8_5_2_9], [-0.0_6_8_0, -0.4_1_1_6, 1.8_4_1_3]]	).to(snake_case_	)
        self.assertTrue(
            torch.allclose(
                outputs.transformer_decoder_last_hidden_state[0, :3, :3]       ,   snake_case_       ,   atol=snake_case_	)	)




   def      lowerCamelCase__     (				self						:					str	)      -> Optional[int]:







        """simple docstring"""
        A_				 =						(
            MaskFormerForInstanceSegmentation.from_pretrained("facebook/maskformer-swin-small-coco"	)
            .to(snake_case_	)
            .eval()
        )
        A_				 =						self.default_image_processor
        A_				 =						prepare_img()
        A_				 =						image_processor(snake_case_       ,   return_tensors="pt"	).to(snake_case_	)
        A_				 =						inputs["pixel_values"].shape
        # check size is divisible by 32
        self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0	)
        # check size
        self.assertEqual(snake_case_       ,   (1, 3, 800, 1_088)	)

        with torch.no_grad():
             A_				 =						model(**snake_case_	)
        # masks_queries_logits
        A_				 =						outputs.masks_queries_logits
        self.assertEqual(
            masks_queries_logits.shape       ,   (1, model.config.decoder_config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4)       ,   )
        A_				 =						[
            [-1.3_7_3_7_1_2_4, -1.7_7_2_4_9_3_7, -1.9_3_6_4_2_3_3],
            [-1.5_9_7_7_2_8_1, -1.9_8_6_7_9_3_9, -2.1_5_2_3_6_9_5],
            [-1.5_7_9_5_3_9_8, -1.9_2_6_9_8_3_2, -2.0_9_3_9_4_2],
        ]
        A_				 =						torch.tensor(snake_case_	).to(snake_case_	)
        self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]       ,   snake_case_       ,   atol=snake_case_	)	)
        # class_queries_logits
        A_				 =						outputs.class_queries_logits
        self.assertEqual(
            class_queries_logits.shape       ,   (1, model.config.decoder_config.num_queries, model.config.num_labels + 1)	)
        A_				 =						torch.tensor(
            [
                [1.6512e00, -5.2572e00, -3.3519e00],
                [3.6169e-02, -5.9025e00, -2.9313e00],
                [1.0766e-04, -7.7630e00, -5.1263e00],
            ]	).to(snake_case_	)
        self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]       ,   snake_case_       ,   atol=snake_case_	)	)




   def      lowerCamelCase__     (				self						:					List[str]	)      -> List[str]:







        """simple docstring"""
        A_				 =						(
            MaskFormerForInstanceSegmentation.from_pretrained("facebook/maskformer-resnet101-coco-stuff"	)
            .to(snake_case_	)
            .eval()
        )
        A_				 =						self.default_image_processor
        A_				 =						prepare_img()
        A_				 =						image_processor(snake_case_       ,   return_tensors="pt"	).to(snake_case_	)
        A_				 =						inputs["pixel_values"].shape
        # check size is divisible by 32
        self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0	)
        # check size
        self.assertEqual(snake_case_       ,   (1, 3, 800, 1_088)	)

        with torch.no_grad():
             A_				 =						model(**snake_case_	)
        # masks_queries_logits
        A_				 =						outputs.masks_queries_logits
        self.assertEqual(
            masks_queries_logits.shape       ,   (1, model.config.decoder_config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4)       ,   )
        A_				 =						[[-0.9_0_4_6, -2.6_3_6_6, -4.6_0_6_2], [-3.4_1_7_9, -5.7_8_9_0, -8.8_0_5_7], [-4.9_1_7_9, -7.6_5_6_0, -1_0.7_7_1_1]]
        A_				 =						torch.tensor(snake_case_	).to(snake_case_	)
        self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]       ,   snake_case_       ,   atol=snake_case_	)	)
        # class_queries_logits
        A_				 =						outputs.class_queries_logits
        self.assertEqual(
            class_queries_logits.shape       ,   (1, model.config.decoder_config.num_queries, model.config.num_labels + 1)	)
        A_				 =						torch.tensor(
            [[4.7_1_8_8, -3.2_5_8_5, -2.8_8_5_7], [6.6_8_7_1, -2.9_1_8_1, -1.2_4_8_7], [7.2_4_4_9, -2.2_7_6_4, -2.1_8_7_4]]	).to(snake_case_	)
        self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]       ,   snake_case_       ,   atol=snake_case_	)	)






   def      lowerCamelCase__     (				self						:					List[Any]	)      -> Any:







        """simple docstring"""
        A_				 =						(
            MaskFormerForInstanceSegmentation.from_pretrained("facebook/maskformer-swin-small-coco"	)
            .to(snake_case_	)
            .eval()
        )
        A_				 =						self.default_image_processor

        A_				 =						image_processor(
            [np.zeros((3, 800, 1_333)	), np.zeros((3, 800, 1_333)	)]       ,   segmentation_maps=[np.zeros((384, 384)	).astype(np.floataa	), np.zeros((384, 384)	).astype(np.floataa	)]       ,   return_tensors="pt"       ,   )

        A_				 =						inputs["pixel_values"].to(snake_case_	)
        A_				 =						[el.to(snake_case_	) for el in inputs["mask_labels"]]
        A_				 =						[el.to(snake_case_	) for el in inputs["class_labels"]]

        with torch.no_grad():
             A_				 =						model(**snake_case_	)

        self.assertTrue(outputs.loss is not None	)






"""simple docstring"""





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


UpperCamelCase_					:						Optional[int]				= logging.get_logger(__name__)

UpperCamelCase_					:						Dict				= {
    '''microsoft/focalnet-tiny''': '''https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json''',
}



class __lowerCAmelCase				(					_lowercase     ,				_lowercase      ):




			"""simple docstring"""







			snake_case	      =				"focalnet"




			def __init__(				self						:					Any       ,   _snake_case						:					Optional[int]=224       ,   _snake_case						:					List[str]=4       ,   _snake_case						:					Any=3       ,   _snake_case						:					List[Any]=96       ,   _snake_case						:					Union[str, Any]=False       ,   _snake_case						:					Optional[Any]=[192, 384, 768, 768]       ,   _snake_case						:					List[str]=[2, 2, 6, 2]       ,   _snake_case						:					Any=[2, 2, 2, 2]       ,   _snake_case						:					List[Any]=[3, 3, 3, 3]       ,   _snake_case						:					Optional[Any]="gelu"       ,   _snake_case						:					Dict=4.0       ,   _snake_case						:					List[Any]=0.0       ,   _snake_case						:					List[str]=0.1       ,   _snake_case						:					Optional[Any]=False       ,   _snake_case						:					Any=1e-4       ,   _snake_case						:					str=False       ,   _snake_case						:					Optional[int]=False       ,   _snake_case						:					Tuple=False       ,   _snake_case						:					Any=0.0_2       ,   _snake_case						:					List[Any]=1e-5       ,   _snake_case						:					Union[str, Any]=32       ,   _snake_case						:					Tuple=None       ,   _snake_case						:					Any=None       ,   **_snake_case						:					Tuple       ,   )      -> str:







								"""simple docstring"""
								super().__init__(**_snake_case	)

								A_				 =						image_size
								A_				 =						patch_size
								A_				 =						num_channels
								A_				 =						embed_dim
								A_				 =						use_conv_embed
								A_				 =						hidden_sizes
								A_				 =						depths
								A_				 =						focal_levels
								A_				 =						focal_windows
								A_				 =						hidden_act
								A_				 =						mlp_ratio
								A_				 =						hidden_dropout_prob
								A_				 =						drop_path_rate
								A_				 =						use_layerscale
								A_				 =						layerscale_value
								A_				 =						use_post_layernorm
								A_				 =						use_post_layernorm_in_modulation
								A_				 =						normalize_modulator
								A_				 =						initializer_range
								A_				 =						layer_norm_eps
								A_				 =						encoder_stride
								A_				 =						["stem"] + [F'stage{idx}' for idx in range(1       ,   len(self.depths	) + 1	)]
								A_ ,    A_				 =						get_aligned_output_features_output_indices(
								    out_features=_snake_case       ,   out_indices=_snake_case       ,   stage_names=self.stage_names	)




