


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


UpperCAmelCase__   	=							logging.get_logger(__name__)







class       lowerCamelCase__   (       lowerCAmelCase   ,							lowerCAmelCase):
     SCREAMING_SNAKE_CASE__      			=			'''maskformer-swin'''

     SCREAMING_SNAKE_CASE__      			=			{
         '''num_attention_heads''': '''num_heads''',
         '''num_hidden_layers''': '''num_layers''',
     }





     def __init__(self		,     UpperCAmelCase=2_2_4		,     UpperCAmelCase=4		,     UpperCAmelCase=3		,     UpperCAmelCase=9_6		,     UpperCAmelCase=[2, 2, 6, 2]		,     UpperCAmelCase=[3, 6, 1_2, 2_4]		,     UpperCAmelCase=7		,     UpperCAmelCase=4.0		,     UpperCAmelCase=True		,     UpperCAmelCase=0.0		,     UpperCAmelCase=0.0		,     UpperCAmelCase=0.1		,     UpperCAmelCase="gelu"		,     UpperCAmelCase=False		,     UpperCAmelCase=0.02		,     UpperCAmelCase=1e-5		,     UpperCAmelCase=None		,     UpperCAmelCase=None		,     **UpperCAmelCase		,     )     ->   Any:
      super().__init__(**UpperCAmelCase       )

      _lowercase							      =image_size
      _lowercase							      =patch_size
      _lowercase							      =num_channels
      _lowercase							      =embed_dim
      _lowercase							      =depths
      _lowercase							      =len(UpperCAmelCase       )
      _lowercase							      =num_heads
      _lowercase							      =window_size
      _lowercase							      =mlp_ratio
      _lowercase							      =qkv_bias
      _lowercase							      =hidden_dropout_prob
      _lowercase							      =attention_probs_dropout_prob
      _lowercase							      =drop_path_rate
      _lowercase							      =hidden_act
      _lowercase							      =use_absolute_embeddings
      _lowercase							      =layer_norm_eps
      _lowercase							      =initializer_range
      # we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
      # this indicates the channel dimension after the last stage of the model
      _lowercase							      =int(embed_dim * 2 ** (len(UpperCAmelCase       ) - 1)       )
      _lowercase							      =['''stem'''] + [f"stage{idx}" for idx in range(1		,     len(UpperCAmelCase       ) + 1       )]
      _lowercase      ,    _lowercase							      =get_aligned_output_features_output_indices(
          out_features=UpperCAmelCase		,     out_indices=UpperCAmelCase		,     stage_names=self.stage_names       )





UpperCAmelCase__   	=							8.31_44_62  # Unit - J mol-1 K-1
def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case     ,						__snake_case						)     ->			float:







 """simple docstring"""


 if moles < 0 or kelvin < 0 or volume < 0:
  raise ValueError('''Invalid inputs. Enter positive value.'''						)
 return moles * kelvin * UNIVERSAL_GAS_CONSTANT / volume
def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case     ,						__snake_case						)     ->			float:







 """simple docstring"""


 if moles < 0 or kelvin < 0 or pressure < 0:
  raise ValueError('''Invalid inputs. Enter positive value.'''						)
 return moles * kelvin * UNIVERSAL_GAS_CONSTANT / pressure


if __name__ == "__main__":
  from doctest import testmod

  testmod()

