





import functools
import operator

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


_UpperCamelCase							=			logging.get_logger(__name__)

_UpperCamelCase							=			{
    'asapp/sew-d-tiny-100k': 'https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json',
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}




class 					_lowerCamelCase			(     _a     ):



      """simple docstring"""






      UpperCAmelCase_    :   List[Any]      ="sew-d"







      def __init__(			self					,    UpperCAmelCase=32					,    UpperCAmelCase=768					,    UpperCAmelCase=12					,    UpperCAmelCase=12					,    UpperCAmelCase=3072					,    UpperCAmelCase=2					,    UpperCAmelCase=512					,    UpperCAmelCase=256					,    UpperCAmelCase=True					,    UpperCAmelCase=True					,    UpperCAmelCase=("p2c", "c2p")					,    UpperCAmelCase="layer_norm"					,    UpperCAmelCase="gelu_python"					,    UpperCAmelCase=0.1					,    UpperCAmelCase=0.1					,    UpperCAmelCase=0.1					,    UpperCAmelCase=0.0					,    UpperCAmelCase=0.1					,    UpperCAmelCase=0.02					,    UpperCAmelCase=1E-7					,    UpperCAmelCase=1E-5					,    UpperCAmelCase="group"					,    UpperCAmelCase="gelu"					,    UpperCAmelCase=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)					,    UpperCAmelCase=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)					,    UpperCAmelCase=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)					,    UpperCAmelCase=False					,    UpperCAmelCase=128					,    UpperCAmelCase=16					,    UpperCAmelCase=True					,    UpperCAmelCase=0.05					,    UpperCAmelCase=10					,    UpperCAmelCase=2					,    UpperCAmelCase=0.0					,    UpperCAmelCase=10					,    UpperCAmelCase=0					,    UpperCAmelCase="mean"					,    UpperCAmelCase=False					,    UpperCAmelCase=False					,    UpperCAmelCase=256					,    UpperCAmelCase=0					,    UpperCAmelCase=1					,    UpperCAmelCase=2					,    **UpperCAmelCase					,    )							-> Dict:






        '''simple docstring'''






        super().__init__(**lowerCAmelCase_					,    pad_token_id=lowerCAmelCase_					,    bos_token_id=lowerCAmelCase_					,    eos_token_id=lowerCAmelCase_ )
        __snake_case :					Any          =							hidden_size
        __snake_case :					Union[str, Any]          =							feat_extract_norm
        __snake_case :					Tuple          =							feat_extract_activation
        __snake_case :					str          =							list(lowerCAmelCase_ )
        __snake_case :					List[Any]          =							list(lowerCAmelCase_ )
        __snake_case :					List[str]          =							list(lowerCAmelCase_ )
        __snake_case :					Dict          =							conv_bias
        __snake_case :					Union[str, Any]          =							num_conv_pos_embeddings
        __snake_case :					List[Any]          =							num_conv_pos_embedding_groups
        __snake_case :					List[Any]          =							len(self.conv_dim )
        __snake_case :					Union[str, Any]          =							num_hidden_layers
        __snake_case :					List[Any]          =							intermediate_size
        __snake_case :					Any          =							squeeze_factor
        __snake_case :					Union[str, Any]          =							max_position_embeddings
        __snake_case :					Any          =							position_buckets
        __snake_case :					Union[str, Any]          =							share_att_key
        __snake_case :					List[str]          =							relative_attention
        __snake_case :					List[str]          =							norm_rel_ebd
        __snake_case :					str          =							list(lowerCAmelCase_ )
        __snake_case :					Union[str, Any]          =							hidden_act
        __snake_case :					Optional[Any]          =							num_attention_heads
        __snake_case :					Optional[int]          =							hidden_dropout
        __snake_case :					int          =							attention_dropout
        __snake_case :					Any          =							activation_dropout
        __snake_case :					List[str]          =							feat_proj_dropout
        __snake_case :					List[Any]          =							final_dropout
        __snake_case :					List[str]          =							layer_norm_eps
        __snake_case :					Dict          =							feature_layer_norm_eps
        __snake_case :					Optional[Any]          =							initializer_range
        __snake_case :					Optional[int]          =							vocab_size

        if (
            (len(self.conv_stride ) != self.num_feat_extract_layers)
            or (len(self.conv_kernel ) != self.num_feat_extract_layers)
            or (len(self.conv_dim ) != self.num_feat_extract_layers)
        ):
          raise ValueError(
              "Configuration for convolutional layers is incorrect."
              "It is required that `len(config.conv_dim)` == `len(config.conv_stride)` == `len(config.conv_kernel)`,"
              F"""but is `len(config.conv_dim) = {len(self.conv_dim )}`, `len(config.conv_stride)"""
              F"""= {len(self.conv_stride )}`, `len(config.conv_kernel) = {len(self.conv_kernel )}`.""" )

        # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
        __snake_case :					Union[str, Any]          =							apply_spec_augment
        __snake_case :					Tuple          =							mask_time_prob
        __snake_case :					Optional[Any]          =							mask_time_length
        __snake_case :					Dict          =							mask_time_min_masks
        __snake_case :					Optional[int]          =							mask_feature_prob
        __snake_case :					Any          =							mask_feature_length
        __snake_case :					List[Any]          =							mask_feature_min_masks

        # ctc loss
        __snake_case :					Optional[Any]          =							ctc_loss_reduction
        __snake_case :					Union[str, Any]          =							ctc_zero_infinity

        # sequence classification
        __snake_case :					int          =							use_weighted_layer_sum
        __snake_case :					List[Any]          =							classifier_proj_size







      @property
      def     UpperCAmelCase		(			self )							-> List[str]:






        '''simple docstring'''






        return functools.reduce(operator.mul					,    self.conv_stride					,    1 )







'''simple docstring'''


import qiskit
def 						snake_case_       (UpperCamelCase			:    int					,		UpperCamelCase			:    int ):





							'''simple docstring'''


							_a      	=							qiskit.Aer.get_backend('''aer_simulator''' )

							_a      	=							qiskit.QuantumCircuit(4					,		2 )
							# encode inputs in qubits 0 and 1
							if bita == 1:
														qc_ha.x(0 )
							if bita == 1:
														qc_ha.x(1 )
							qc_ha.barrier()

							# use cnots to write XOR of the inputs on qubit2
							qc_ha.cx(0					,		2 )
							qc_ha.cx(1					,		2 )

							# use ccx / toffoli gate to write AND of the inputs on qubit3
							qc_ha.ccx(0					,		1					,		3 )
							qc_ha.barrier()

							# extract outputs
							qc_ha.measure(2					,		0 )  # extract XOR value
							qc_ha.measure(3					,		1 )  # extract AND value

							# Execute the circuit on the qasm simulator
							_a      	=							qiskit.execute(UpperCamelCase					,		UpperCamelCase					,		shots=1000 )

							# Return the histogram data of the results of the experiment
							return job.result().get_counts(UpperCamelCase )


if __name__ == "__main__":
				_snake_case : Tuple  				=						half_adder(1, 1)
				print(F'''Half Adder Output Qubit Counts: {counts}''')

