





'''simple docstring'''

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase__		:     Union[str, Any]			=							logging.get_logger(__name__)

lowercase__		:     int			=							{
    'naver-clova-ix/donut-base': 'https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json',
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}
class 							__lowerCAmelCase	(       __magic_name__					):






       """simple docstring"""
       _snake_case      :	Optional[Any]									=       'donut-swin'

       _snake_case      :	Union[str, Any]									=       {
           'num_attention_heads': 'num_heads',
           'num_hidden_layers': 'num_layers',
       }





       def __init__(				self  :						Optional[Any]			,					lowerCAmelCase__  :						Any=224			,					lowerCAmelCase__  :						Union[str, Any]=4			,					lowerCAmelCase__  :						List[Any]=3			,					lowerCAmelCase__  :						Union[str, Any]=96			,					lowerCAmelCase__  :						Optional[int]=[2, 2, 6, 2]			,					lowerCAmelCase__  :						int=[3, 6, 12, 24]			,					lowerCAmelCase__  :						Dict=7			,					lowerCAmelCase__  :						Dict=4.0			,					lowerCAmelCase__  :						Optional[Any]=True			,					lowerCAmelCase__  :						Tuple=0.0			,					lowerCAmelCase__  :						str=0.0			,					lowerCAmelCase__  :						List[str]=0.1			,					lowerCAmelCase__  :						List[str]="gelu"			,					lowerCAmelCase__  :						Dict=False			,					lowerCAmelCase__  :						Union[str, Any]=0.02			,					lowerCAmelCase__  :						Union[str, Any]=1e-5			,					**lowerCAmelCase__  :						List[Any]			,					)       ->	Dict:

            '''simple docstring'''




            super().__init__(**lowerCAmelCase__	)

            _UpperCamelCase							       =			image_size
            _UpperCamelCase							       =			patch_size
            _UpperCamelCase							       =			num_channels
            _UpperCamelCase							       =			embed_dim
            _UpperCamelCase							       =			depths
            _UpperCamelCase							       =			len(lowerCAmelCase__	)
            _UpperCamelCase							       =			num_heads
            _UpperCamelCase							       =			window_size
            _UpperCamelCase							       =			mlp_ratio
            _UpperCamelCase							       =			qkv_bias
            _UpperCamelCase							       =			hidden_dropout_prob
            _UpperCamelCase							       =			attention_probs_dropout_prob
            _UpperCamelCase							       =			drop_path_rate
            _UpperCamelCase							       =			hidden_act
            _UpperCamelCase							       =			use_absolute_embeddings
            _UpperCamelCase							       =			layer_norm_eps
            _UpperCamelCase							       =			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
            _UpperCamelCase							       =			int(embed_dim * 2 ** (len(lowerCAmelCase__	) - 1)	)





'''simple docstring'''
from math import log

from scipy.constants import Boltzmann, physical_constants

lowercase__											=3_00  # TEMPERATURE (unit = K)






def      UpperCamelCase_				(      A__  ,      A__  ,      A__  ,      ):

	if donor_conc <= 0:
		raise ValueError("""Donor concentration should be positive"""						)
	elif acceptor_conc <= 0:
		raise ValueError("""Acceptor concentration should be positive"""						)
	elif intrinsic_conc <= 0:
		raise ValueError("""Intrinsic concentration should be positive"""						)
	elif donor_conc <= intrinsic_conc:
		raise ValueError(
		    """Donor concentration should be greater than intrinsic concentration"""						)
	elif acceptor_conc <= intrinsic_conc:
		raise ValueError(
		    """Acceptor concentration should be greater than intrinsic concentration"""						)
	else:
		return (
		    Boltzmann
		    * T
		    * log((donor_conc * acceptor_conc) / intrinsic_conc**2						)
		    / physical_constants["electron volt"][0]
		)


if __name__ == "__main__":
		import doctest

		doctest.testmod()
