


'''simple docstring'''







from ..utils import DummyObject, requires_backends
class 	UpperCamelCase__					( metaclass=SCREAMING_SNAKE_CASE_	):



     """simple docstring"""






     __magic_name__    			=    ["transformers", "torch", "note_seq"]







     def __init__( self      ,	*snake_case__      ,	**snake_case__   ):

            '''simple docstring'''

            requires_backends(self      ,	['transformers', 'torch', 'note_seq']   )







     @classmethod
     def a	( cls      ,	*snake_case__      ,	**snake_case__   ):

            '''simple docstring'''

            requires_backends(cls      ,	['transformers', 'torch', 'note_seq']   )







     @classmethod
     def a	( cls      ,	*snake_case__      ,	**snake_case__   ):

            '''simple docstring'''

            requires_backends(cls      ,	['transformers', 'torch', 'note_seq']   )





'''simple docstring'''







import unittest

from transformers import AutoTokenizer, is_flax_available
from transformers.testing_utils import require_flax, require_sentencepiece, require_tokenizers, slow


if is_flax_available():
       import jax.numpy as jnp

       from transformers import FlaxXLMRobertaModel
@require_sentencepiece
@require_tokenizers
@require_flax
class 	UpperCamelCase__					( unittest.TestCase	):



     """simple docstring"""






     @slow
     def a	( self   ):

            '''simple docstring'''

            _lowerCAmelCase    :							List[str]   			=       FlaxXLMRobertaModel.from_pretrained('xlm-roberta-base'   )
            _lowerCAmelCase    :							Optional[Any]   			=       AutoTokenizer.from_pretrained('xlm-roberta-base'   )
            _lowerCAmelCase    :							Dict   			=       'The dog is cute and lives in the garden house'
            _lowerCAmelCase    :							List[str]   			=       jnp.array([tokenizer.encode(snake_case__   )]   )

            _lowerCAmelCase    :							Optional[int]   			=       (1, 12, 768)  # batch_size, sequence_length, embedding_vector_dim
            _lowerCAmelCase    :							Tuple   			=       jnp.array(
                [[-0.0101, 0.1218, -0.0803, 0.0801, 0.1327, 0.0776, -0.1215, 0.2383, 0.3338, 0.3106, 0.0300, 0.0252]]   )

            _lowerCAmelCase    :							Union[str, Any]   			=       model(snake_case__   )['last_hidden_state']
            self.assertEqual(output.shape      ,	snake_case__   )
            # compare the actual values for a slice of last dim
            self.assertTrue(jnp.allclose(output[:, :, -1]      ,	snake_case__      ,	atol=1E-3   )   )

