


import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
   import torch

   from transformers import CamembertModel






@require_torch
@require_sentencepiece
@require_tokenizers
class        UpperCAmelCase__			(   unittest.TestCase						):



    """simple docstring"""






    @slow
    def _a   (     self       )    ->			Optional[int]:
         __UpperCamelCase       				=CamembertModel.from_pretrained('camembert-base'       )
         model.to(A_       )

         __UpperCamelCase       				=torch.tensor(
             [[5, 121, 11, 660, 16, 730, 25543, 110, 83, 6]]   ,  device=A_   ,  dtype=torch.long   ,  )  # J'aime le camembert !
         with torch.no_grad():
              __UpperCamelCase       				=model(A_       )['last_hidden_state']
         __UpperCamelCase       				=torch.Size((1, 10, 768)       )
         self.assertEqual(output.shape   ,  A_       )
         # compare the actual values for a slice.
         __UpperCamelCase       				=torch.tensor(
             [[[-0.0254, 0.0235, 0.1027], [0.0606, -0.1811, -0.0418], [-0.1561, -0.1127, 0.2687]]]   ,  device=A_   ,  dtype=torch.float   ,  )
         # camembert = torch.hub.load('pytorch/fairseq', 'camembert.v0')
         # camembert.eval()
         # expected_slice = roberta.model.forward(input_ids)[0][:, :3, :3].detach()

         self.assertTrue(torch.allclose(output[:, :3, :3]   ,  A_   ,  atol=1E-4       )       )









import math

def 		_UpperCAmelCase							(     SCREAMING_SNAKE_CASE__     :   int							):
     __UpperCamelCase       				=math.log(2     ,	10							) * number
     __UpperCamelCase       				=round((log_number - int(SCREAMING_SNAKE_CASE__							))     ,	15							)

     return difference

def 		_UpperCAmelCase							(     SCREAMING_SNAKE_CASE__     :   int = 67_89_10							):
     __UpperCamelCase       				=90
     __UpperCamelCase       				=0

     __UpperCamelCase       				=math.log(1.23     ,	10							)
     __UpperCamelCase       				=math.log(1.24     ,	10							)
     __UpperCamelCase       				=0

     while position < number:
          __UpperCamelCase       				=log_difference(SCREAMING_SNAKE_CASE__							)

          if difference >= upper_limit:
               power_iterator += 93

          elif difference < lower_limit:
               power_iterator += 1_96

          else:
               __UpperCamelCase       				=power_iterator
               power_iterator += 1_96
               position += 1

     return previous_power


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   print(f"""{solution() = }""")





