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


lowercase__	:Optional[Any]										=					logging.get_logger(__name__)

lowercase__	:Optional[int]										=					{
    "EleutherAI/gpt-neox-20b": "https://huggingface.co/EleutherAI/gpt-neox-20b/resolve/main/config.json",
    # See all GPTNeoX models at https://huggingface.co/models?filter=gpt_neox
}







class        lowercase	(      __a	):
							lowercase_ : Dict       ='''gpt_neox'''




							def __init__(       self     ,A__=5_0_4_3_2     ,A__=6_1_4_4     ,A__=4_4     ,A__=6_4     ,A__=2_4_5_7_6     ,A__="gelu"     ,A__=0.25     ,A__=1_0_0_0_0     ,A__=0.0     ,A__=0.0     ,A__=0.1     ,A__=2_0_4_8     ,A__=0.02     ,A__=1E-5     ,A__=True     ,A__=0     ,A__=2     ,A__=False     ,A__=True     ,A__=None     ,**A__     ,):
												super().__init__(bos_token_id=A__     ,eos_token_id=A__     ,**A__)
												lowercase					=		vocab_size
												lowercase					=		max_position_embeddings
												lowercase					=		hidden_size
												lowercase					=		num_hidden_layers
												lowercase					=		num_attention_heads
												lowercase					=		intermediate_size
												lowercase					=		hidden_act
												lowercase					=		rotary_pct
												lowercase					=		rotary_emb_base
												lowercase					=		attention_dropout
												lowercase					=		hidden_dropout
												lowercase					=		classifier_dropout
												lowercase					=		initializer_range
												lowercase					=		layer_norm_eps
												lowercase					=		use_cache
												lowercase					=		tie_word_embeddings
												lowercase					=		use_parallel_residual
												lowercase					=		rope_scaling
												self._rope_scaling_validation()

												if self.hidden_size % self.num_attention_heads != 0:
																	raise ValueError(
																	    '''The hidden size is not divisble by the number of attention heads! Make sure to update them!''')





							def 				A__   (       self):
												if self.rope_scaling is None:
																	return

												if not isinstance(self.rope_scaling     ,A__) or len(self.rope_scaling) != 2:
																	raise ValueError(
																	    '''`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, '''
																	    f'got {self.rope_scaling}')
												lowercase					=		self.rope_scaling.get('''type'''     ,A__)
												lowercase					=		self.rope_scaling.get('''factor'''     ,A__)
												if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
																	raise ValueError(
																	    f'`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}')
												if rope_scaling_factor is None or not isinstance(A__     ,A__) or rope_scaling_factor <= 1.0:
																	raise ValueError(f'`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}')





def  UpperCamelCase					(							lowerCAmelCase__				,    lowerCAmelCase__	):
					'''simple docstring'''
					return int((input_a, input_a).count(0	) == 0	)



def  UpperCamelCase					(							):
					'''simple docstring'''
					assert and_gate(0				,    0	) == 0
					assert and_gate(0				,    1	) == 0
					assert and_gate(1				,    0	) == 0
					assert and_gate(1				,    1	) == 1


if __name__ == "__main__":
							test_and_gate()
							print(and_gate(1, 0))
							print(and_gate(0, 0))
							print(and_gate(0, 1))
							print(and_gate(1, 1))




