





'''simple docstring'''

from __future__ import annotations

import unittest

from transformers import is_tf_available
from transformers.testing_utils import require_sentencepiece, require_tf, require_tokenizers, slow


if is_tf_available():
  import numpy as np
  import tensorflow as tf

  from transformers import TFCamembertModel






@require_tf
@require_sentencepiece
@require_tokenizers
class        UpperCAmelCase     (	unittest.TestCase    ):
 @slow
 def 					UpperCAmelCase_							(    self				:List[Any]							)->							List[str]:
     A__    =      TFCamembertModel.from_pretrained("jplu/tf-camembert-base"							)

     A__    =      tf.convert_to_tensor(
         [[5, 1_21, 11, 6_60, 16, 7_30, 2_55_43, 1_10, 83, 6]]						,	dtype=tf.intaa						,	)  # J'aime le camembert !"

     A__    =      model(lowercase_							)["last_hidden_state"]
     A__    =      tf.TensorShape((1, 10, 7_68)							)
     self.assertEqual(output.shape						,	lowercase_							)
     # compare the actual values for a slice.
     A__    =      tf.convert_to_tensor(
         [[[-0.0_2_5_4, 0.0_2_3_5, 0.1_0_2_7], [0.0_6_0_6, -0.1_8_1_1, -0.0_4_1_8], [-0.1_5_6_1, -0.1_1_2_7, 0.2_6_8_7]]]						,	dtype=tf.floataa						,	)
     # camembert = torch.hub.load('pytorch/fairseq', 'camembert.v0')
     # camembert.eval()
     # expected_slice = roberta.model.forward(input_ids)[0][:, :3, :3].detach()

     self.assertTrue(np.allclose(output[:, :3, :3].numpy()						,	expected_slice.numpy()						,	atol=1E-4							)							)










'''simple docstring'''

import qiskit





def 						UpperCamelCase    (							_lowerCamelCase : int						,	_lowerCamelCase : int	):
    A__    =      qiskit.Aer.get_backend("aer_simulator"	)

    # Create a Quantum Circuit acting on the q register
    A__    =      qiskit.QuantumCircuit(_lowerCamelCase						,	_lowerCamelCase	)

    # Map the quantum measurement to the classical bits
    circuit.measure([0]						,	[0]	)

    # Execute the circuit on the simulator
    A__    =      qiskit.execute(_lowerCamelCase						,	_lowerCamelCase						,	shots=10_00	)

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


if __name__ == "__main__":
  print(f"""Total count for various states are: {single_qubit_measure(1, 1)}""")



