


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        a					(			unittest.TestCase   ):





     @slow
     def  SCREAMING_SNAKE_CASE__       (    self					:				Tuple							):
        __lowerCamelCase:				List[str]     =	TFXLMRobertaModel.from_pretrained("""jplu/tf-xlm-roberta-base"""							)

        __lowerCamelCase:				List[str]     =	{
            """input_ids""": tf.convert_to_tensor([[0, 2646, 10269, 83, 99942, 2]]    ,	dtype=tf.intaa							),  # "My dog is cute"
            """attention_mask""": tf.convert_to_tensor([[1, 1, 1, 1, 1, 1]]    ,	dtype=tf.intaa							),
        }

        __lowerCamelCase:				List[Any]     =	model(SCREAMING_SNAKE_CASE_							)["""last_hidden_state"""]
        __lowerCamelCase:				Optional[int]     =	tf.TensorShape((1, 6, 768)							)
        self.assertEqual(output.shape    ,	SCREAMING_SNAKE_CASE_							)
        # compare the actual values for a slice.
        __lowerCamelCase:				int     =	tf.convert_to_tensor(
            [
                [
                    [0.068_1762, 0.1089_4451, 0.0677_2504],
                    [-0.0642_3668, 0.0236_6615, 0.0432_9344],
                    [-0.0605_7295, 0.0997_4135, -0.0007_0584],
                ]
            ]    ,	dtype=tf.floataa    ,	)

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






def     __lowerCAmelCase						(							)       ->							Optional[Any]:
   __lowerCamelCase:				List[str]     =	[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

   __lowerCamelCase:				List[str]     =	6
   __lowerCamelCase:				Optional[int]     =	1
   __lowerCamelCase:				int     =	1901

   __lowerCamelCase:				Tuple     =	0

   while year < 2001:
      day += 7

      if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
         if day > days_per_month[month - 1] and month != 2:
            month += 1
            __lowerCamelCase:				Union[str, Any]     =	day - days_per_month[month - 2]
         elif day > 29 and month == 2:
            month += 1
            __lowerCamelCase:				List[Any]     =	day - 29
      else:
         if day > days_per_month[month - 1]:
            month += 1
            __lowerCamelCase:				Any     =	day - days_per_month[month - 2]

      if month > 12:
         year += 1
         __lowerCamelCase:				Dict     =	1

      if year < 2001 and day == 1:
         sundays += 1
   return sundays


if __name__ == "__main__":
   print(solution())


