

'''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 TFXLMRobertaModel





@require_tf
@require_sentencepiece
@require_tokenizers
class 				_snake_case			(							unittest.TestCase    ):
   @slow
   def      __UpperCamelCase    (			self      :   List[str]				):
     SCREAMING_SNAKE_CASE:Dict       =       TFXLMRobertaModel.from_pretrained("jplu/tf-xlm-roberta-base"				)

     SCREAMING_SNAKE_CASE:Tuple       =       {
         "input_ids": tf.convert_to_tensor([[0, 2_646, 10_269, 83, 99_942, 2]]  ,dtype=tf.intaa				),  # "My dog is cute"
         "attention_mask": tf.convert_to_tensor([[1, 1, 1, 1, 1, 1]]  ,dtype=tf.intaa				),
     }

     SCREAMING_SNAKE_CASE:Tuple       =       model(SCREAMING_SNAKE_CASE__				)["last_hidden_state"]
     SCREAMING_SNAKE_CASE:Optional[Any]       =       tf.TensorShape((1, 6, 768)				)
     self.assertEqual(output.shape  ,SCREAMING_SNAKE_CASE__				)
     # compare the actual values for a slice.
     SCREAMING_SNAKE_CASE:Tuple       =       tf.convert_to_tensor(
         [
             [
                 [0.0_681_762, 0.10_894_451, 0.06_772_504],
                 [-0.06_423_668, 0.02_366_615, 0.04_329_344],
                 [-0.06_057_295, 0.09_974_135, -0.00_070_584],
             ]
         ]  ,dtype=tf.floataa  ,)

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













'''simple docstring'''

def     __magic_name__							(				__UpperCAmelCase				,						__UpperCAmelCase   )    ->       str:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE   				=							(boundary[1] - boundary[0]) / steps
   __SCREAMING_SNAKE_CASE   				=							boundary[0]
   __SCREAMING_SNAKE_CASE   				=							boundary[1]
   __SCREAMING_SNAKE_CASE   				=							make_points(__UpperCAmelCase				,						__UpperCAmelCase				,						__UpperCAmelCase   )
   __SCREAMING_SNAKE_CASE   				=							0.0
   y += (h / 2.0) * f(__UpperCAmelCase   )
   for i in x_i:
      # print(i)
      y += h * f(__UpperCAmelCase   )
   y += (h / 2.0) * f(__UpperCAmelCase   )
   return y

def     __magic_name__							(				__UpperCAmelCase				,						__UpperCAmelCase				,						__UpperCAmelCase   )    ->       Optional[Any]:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE   				=							a + h
   while x < (b - h):
      yield x
      __SCREAMING_SNAKE_CASE   				=							x + h

def     __magic_name__							(				__UpperCAmelCase   )    ->       int:  # enter your function here

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE   				=							(x - 0) * (x - 0)
   return y

def     __magic_name__							(				)    ->       Tuple:

   '''simple docstring'''







   __SCREAMING_SNAKE_CASE   				=							0.0  # Lower bound of integration
   __SCREAMING_SNAKE_CASE   				=							1.0  # Upper bound of integration
   __SCREAMING_SNAKE_CASE   				=							1_0.0  # define number of steps or resolution
   __SCREAMING_SNAKE_CASE   				=							[a, b]  # define boundary of integration
   __SCREAMING_SNAKE_CASE   				=							method_a(__UpperCAmelCase				,						__UpperCAmelCase   )
   print(f"""y = {y}"""   )


if __name__ == "__main__":
    main()





