

'''simple docstring'''





from __future__ import annotations

import unittest
from collections.abc import Iterator

class      _a				:




      """simple docstring"""

      def __init__(      self       :							Any	, UpperCAmelCase       :							int	, UpperCAmelCase       :							Optional[int]  ):
            A_	     =							label
            A_	     =							parent
            A_	     =							None
            A_	     =							None




class      _a				:




      """simple docstring"""

      def __init__(      self       :							str  ):
            A_	     =							None





      def 		__A  (      self       :							List[Any]  ):
            A_	     =							None





      def 		__A  (      self       :							Optional[int]  ):
            return self.root is None





      def 		__A  (      self       :							Dict	, UpperCAmelCase       :							Any  ):
            A_	     =							self._put(self.root	, __UpperCamelCase  )





      def 		__A  (      self       :							Any	, UpperCAmelCase       :							List[str]	, UpperCAmelCase       :							str	, UpperCAmelCase       :							Dict = None  ):
            if node is None:
                  A_	     =							Node(__UpperCamelCase	, __UpperCamelCase  )
            else:
                  if label < node.label:
                        A_	     =							self._put(node.left	, __UpperCamelCase	, __UpperCamelCase  )
                  elif label > node.label:
                        A_	     =							self._put(node.right	, __UpperCamelCase	, __UpperCamelCase  )
                  else:
                        A_	     =							f'''Node with label {label} already exists'''
                        raise Exception(__UpperCamelCase  )

            return node





      def 		__A  (      self       :							List[Any]	, UpperCAmelCase       :							List[Any]  ):
            return self._search(self.root	, __UpperCamelCase  )





      def 		__A  (      self       :							int	, UpperCAmelCase       :							Tuple	, UpperCAmelCase       :							Optional[int]  ):
            if node is None:
                  A_	     =							f'''Node with label {label} does not exist'''
                  raise Exception(__UpperCamelCase  )
            else:
                  if label < node.label:
                        A_	     =							self._search(node.left	, __UpperCamelCase  )
                  elif label > node.label:
                        A_	     =							self._search(node.right	, __UpperCamelCase  )

            return node





      def 		__A  (      self       :							Optional[int]	, UpperCAmelCase       :							str  ):
            A_	     =							self.search(__UpperCamelCase  )
            if node.right and node.left:
                  A_	     =							self._get_lowest_node(node.right  )
                  A_	     =							node.left
                  A_	     =							node.right
                  A_	     =							lowest_node
                  if node.right:
                        A_	     =							lowest_node
                  self._reassign_nodes(__UpperCamelCase	, __UpperCamelCase  )
            elif not node.right and node.left:
                  self._reassign_nodes(__UpperCamelCase	, node.left  )
            elif node.right and not node.left:
                  self._reassign_nodes(__UpperCamelCase	, node.right  )
            else:
                  self._reassign_nodes(__UpperCamelCase	, __UpperCamelCase  )





      def 		__A  (      self       :							List[str]	, UpperCAmelCase       :							Tuple	, UpperCAmelCase       :							List[str]  ):
            if new_children:
                  A_	     =							node.parent

            if node.parent:
                  if node.parent.right == node:
                        A_	     =							new_children
                  else:
                        A_	     =							new_children
            else:
                  A_	     =							new_children





      def 		__A  (      self       :							List[Any]	, UpperCAmelCase       :							List[Any]  ):
            if node.left:
                  A_	     =							self._get_lowest_node(node.left  )
            else:
                  A_	     =							node
                  self._reassign_nodes(__UpperCamelCase	, node.right  )

            return lowest_node





      def 		__A  (      self       :							int	, UpperCAmelCase       :							Dict  ):
            try:
                  self.search(__UpperCamelCase  )
                  return True
            except Exception:
                  return False





      def 		__A  (      self       :							str  ):
            if self.root is None:
                  raise Exception("Binary search tree is empty"  )

            A_	     =							self.root
            while node.right is not None:
                  A_	     =							node.right

            return node.label





      def 		__A  (      self       :							Tuple  ):
            if self.root is None:
                  raise Exception("Binary search tree is empty"  )

            A_	     =							self.root
            while node.left is not None:
                  A_	     =							node.left

            return node.label





      def 		__A  (      self       :							str  ):
            return self._inorder_traversal(self.root  )





      def 		__A  (      self       :							Dict	, UpperCAmelCase       :							Optional[int]  ):
            if node is not None:
                  yield from self._inorder_traversal(node.left  )
                  yield node
                  yield from self._inorder_traversal(node.right  )





      def 		__A  (      self       :							Optional[Any]  ):
            return self._preorder_traversal(self.root  )







      def 		__A  (      self       :							Union[str, Any]	, UpperCAmelCase       :							List[str]  ):
            if node is not None:
                  yield node
                  yield from self._preorder_traversal(node.left  )
                  yield from self._preorder_traversal(node.right  )




class      _a				( unittest.TestCase							):




      """simple docstring"""

      @staticmethod
      def 		__A  (      ):
            A_	     =							BinarySearchTree()
            t.put(8  )
            t.put(3  )
            t.put(6  )
            t.put(1  )
            t.put(10  )
            t.put(14  )
            t.put(13  )
            t.put(4  )
            t.put(7  )
            t.put(5  )

            return t





      def 		__A  (      self       :							Tuple  ):
            A_	     =							BinarySearchTree()
            assert t.is_empty()

            t.put(8  )
            assert t.root is not None
            assert t.root.parent is None
            assert t.root.label == 8

            t.put(10  )
            assert t.root.right is not None
            assert t.root.right.parent == t.root
            assert t.root.right.label == 10

            t.put(3  )
            assert t.root.left is not None
            assert t.root.left.parent == t.root
            assert t.root.left.label == 3

            t.put(6  )
            assert t.root.left.right is not None
            assert t.root.left.right.parent == t.root.left
            assert t.root.left.right.label == 6

            t.put(1  )
            assert t.root.left.left is not None
            assert t.root.left.left.parent == t.root.left
            assert t.root.left.left.label == 1

            with self.assertRaises(__UpperCamelCase  ):  # noqa: B017
                  t.put(1  )





      def 		__A  (      self       :							Optional[int]  ):
            A_	     =							self._get_binary_search_tree()

            A_	     =							t.search(6  )
            assert node.label == 6

            A_	     =							t.search(13  )
            assert node.label == 13

            with self.assertRaises(__UpperCamelCase  ):  # noqa: B017
                  t.search(2  )





      def 		__A  (      self       :							Tuple  ):
            A_	     =							self._get_binary_search_tree()

            t.remove(13  )
            assert t.root is not None
            assert t.root.right is not None
            assert t.root.right.right is not None
            assert t.root.right.right.right is None
            assert t.root.right.right.left is None

            t.remove(7  )
            assert t.root.left is not None
            assert t.root.left.right is not None
            assert t.root.left.right.left is not None
            assert t.root.left.right.right is None
            assert t.root.left.right.left.label == 4

            t.remove(6  )
            assert t.root.left.left is not None
            assert t.root.left.right.right is not None
            assert t.root.left.left.label == 1
            assert t.root.left.right.label == 4
            assert t.root.left.right.right.label == 5
            assert t.root.left.right.left is None
            assert t.root.left.left.parent == t.root.left
            assert t.root.left.right.parent == t.root.left

            t.remove(3  )
            assert t.root is not None
            assert t.root.left.label == 4
            assert t.root.left.right.label == 5
            assert t.root.left.left.label == 1
            assert t.root.left.parent == t.root
            assert t.root.left.left.parent == t.root.left
            assert t.root.left.right.parent == t.root.left

            t.remove(4  )
            assert t.root.left is not None
            assert t.root.left.left is not None
            assert t.root.left.label == 5
            assert t.root.left.right is None
            assert t.root.left.left.label == 1
            assert t.root.left.parent == t.root
            assert t.root.left.left.parent == t.root.left





      def 		__A  (      self       :							List[Any]  ):
            A_	     =							self._get_binary_search_tree()

            t.remove(3  )
            assert t.root is not None
            assert t.root.left is not None
            assert t.root.left.left is not None
            assert t.root.left.right is not None
            assert t.root.left.right.left is not None
            assert t.root.left.right.right is not None
            assert t.root.left.label == 4
            assert t.root.left.right.label == 6
            assert t.root.left.left.label == 1
            assert t.root.left.right.right.label == 7
            assert t.root.left.right.left.label == 5
            assert t.root.left.parent == t.root
            assert t.root.left.right.parent == t.root.left
            assert t.root.left.left.parent == t.root.left
            assert t.root.left.right.left.parent == t.root.left.right





      def 		__A  (      self       :							Union[str, Any]  ):
            A_	     =							self._get_binary_search_tree()
            t.empty()
            assert t.root is None





      def 		__A  (      self       :							Any  ):
            A_	     =							self._get_binary_search_tree()
            assert not t.is_empty()

            t.empty()
            assert t.is_empty()





      def 		__A  (      self       :							Optional[Any]  ):
            A_	     =							self._get_binary_search_tree()

            assert t.exists(6  )
            assert not t.exists(-1  )





      def 		__A  (      self       :							Optional[Any]  ):
            A_	     =							self._get_binary_search_tree()

            assert t.get_max_label() == 14

            t.empty()
            with self.assertRaises(__UpperCamelCase  ):  # noqa: B017
                  t.get_max_label()





      def 		__A  (      self       :							Optional[Any]  ):
            A_	     =							self._get_binary_search_tree()

            assert t.get_min_label() == 1

            t.empty()
            with self.assertRaises(__UpperCamelCase  ):  # noqa: B017
                  t.get_min_label()





      def 		__A  (      self       :							Tuple  ):
            A_	     =							self._get_binary_search_tree()

            A_	     =							[i.label for i in t.inorder_traversal()]
            assert inorder_traversal_nodes == [1, 3, 4, 5, 6, 7, 8, 10, 13, 14]







      def 		__A  (      self       :							Dict  ):
            A_	     =							self._get_binary_search_tree()

            A_	     =							[i.label for i in t.preorder_traversal()]
            assert preorder_traversal_nodes == [8, 3, 1, 6, 4, 5, 7, 10, 14, 13]




def 			__snake_case	(   ):



      """simple docstring"""

      A_	     =							BinarySearchTree()
      t.put(8						)
      t.put(3						)
      t.put(6						)
      t.put(1						)
      t.put(10						)
      t.put(14						)
      t.put(13						)
      t.put(4						)
      t.put(7						)
      t.put(5						)

      print(
          "\n            8\n           / \\\n          3   10\n         / \\    \\\n        1   6    14\n           / \\   /\n          4   7 13\n           \\\n            5\n        "						)

      print("Label 6 exists:"							,t.exists(6						)						)
      print("Label 13 exists:"							,t.exists(13						)						)
      print("Label -1 exists:"							,t.exists(-1						)						)
      print("Label 12 exists:"							,t.exists(12						)						)

      # Prints all the elements of the list in inorder traversal
      A_	     =							[i.label for i in t.inorder_traversal()]
      print("Inorder traversal:"							,lowercase_						)

      # Prints all the elements of the list in preorder traversal
      A_	     =							[i.label for i in t.preorder_traversal()]
      print("Preorder traversal:"							,lowercase_						)

      print("Max. label:"							,t.get_max_label()						)
      print("Min. label:"							,t.get_min_label()						)

      # Delete elements
      print("\nDeleting elements 13, 10, 8, 3, 6, 14"						)
      print(
          "\n          4\n         / \\\n        1   7\n             \\\n              5\n        "						)
      t.remove(13						)
      t.remove(10						)
      t.remove(8						)
      t.remove(3						)
      t.remove(6						)
      t.remove(14						)

      # Prints all the elements of the list in inorder traversal after delete
      A_	     =							[i.label for i in t.inorder_traversal()]
      print("Inorder traversal after delete:"							,lowercase_						)

      # Prints all the elements of the list in preorder traversal after delete
      A_	     =							[i.label for i in t.preorder_traversal()]
      print("Preorder traversal after delete:"							,lowercase_						)

      print("Max. label:"							,t.get_max_label()						)
      print("Min. label:"							,t.get_min_label()						)


if __name__ == "__main__":
      binary_search_tree_example()


import copy
import inspect
import unittest

import numpy as np
from huggingface_hub import hf_hub_download

from transformers import VivitConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor


if is_torch_available():
      import torch
      from torch import nn

      from transformers import MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING, VivitForVideoClassification, VivitModel
      from transformers.models.vivit.modeling_vivit import VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
      from transformers import VivitImageProcessor

class      _a				:




      """simple docstring"""

      def __init__(      self       :							List[str]	, UpperCAmelCase       :							Optional[Any]	, UpperCAmelCase       :							List[str]=2	, UpperCAmelCase       :							str=True	, UpperCAmelCase       :							Optional[Any]=True	, UpperCAmelCase       :							Optional[int]=10	, UpperCAmelCase       :							List[Any]=10	, UpperCAmelCase       :							Optional[Any]=8	, UpperCAmelCase       :							Dict=[2, 4, 4]	, UpperCAmelCase       :							Dict=3	, UpperCAmelCase       :							Optional[int]=768	, UpperCAmelCase       :							Union[str, Any]=5	, UpperCAmelCase       :							List[str]=4	, UpperCAmelCase       :							Union[str, Any]=37	, UpperCAmelCase       :							Dict="gelu_fast"	, UpperCAmelCase       :							int=0.0	, UpperCAmelCase       :							Dict=0.0	, UpperCAmelCase       :							List[Any]=0.02	, UpperCAmelCase       :							Any=1E-06	, UpperCAmelCase       :							str=True	, UpperCAmelCase       :							str=None	, ):
            A_	     =							parent
            A_	     =							batch_size
            A_	     =							is_training
            A_	     =							use_labels
            A_	     =							num_labels
            A_	     =							image_size
            A_	     =							num_frames
            A_	     =							tubelet_size
            A_	     =							num_channels
            A_	     =							hidden_size
            A_	     =							num_hidden_layers
            A_	     =							num_attention_heads
            A_	     =							intermediate_size
            A_	     =							hidden_act
            A_	     =							hidden_dropout_prob
            A_	     =							attention_probs_dropout_prob
            A_	     =							initializer_range
            A_	     =							layer_norm_eps
            A_	     =							qkv_bias
            A_	     =							scope

            A_	     =							(
                (self.image_size // self.tubelet_size[2])
                * (self.image_size // self.tubelet_size[1])
                * (self.num_frames // self.tubelet_size[0])
            ) + 1  # CLS token





      def 		__A  (      self       :							List[Any]  ):
            A_	     =							floats_tensor(
                [self.batch_size, self.num_frames, self.num_channels, self.image_size, self.image_size]  )

            A_	     =							None
            if self.use_labels:
                  A_	     =							ids_tensor([self.batch_size]	, self.num_labels  )

            A_	     =							self.get_config()

            return config, pixel_values, labels





      def 		__A  (      self       :							Optional[int]  ):
            A_	     =							VivitConfig(
                num_frames=self.num_frames	, image_size=self.image_size	, tubelet_size=self.tubelet_size	, num_channels=self.num_channels	, hidden_size=self.hidden_size	, num_hidden_layers=self.num_hidden_layers	, num_attention_heads=self.num_attention_heads	, intermediate_size=self.intermediate_size	, hidden_act=self.hidden_act	, hidden_dropout_prob=self.hidden_dropout_prob	, attention_probs_dropout_prob=self.attention_probs_dropout_prob	, initializer_range=self.initializer_range	, layer_norm_eps=self.layer_norm_eps	, qkv_bias=self.qkv_bias	, )
            A_	     =							self.num_labels
            return config





      def 		__A  (      self       :							Any	, UpperCAmelCase       :							Any	, UpperCAmelCase       :							Any	, UpperCAmelCase       :							Optional[int]  ):
            A_	     =							VivitModel(config=UpperCAmelCase  )
            model.to(UpperCAmelCase  )
            model.eval()
            A_	     =							model(UpperCAmelCase  )
            self.parent.assertEqual(result.last_hidden_state.shape	, (self.batch_size, self.seq_length, self.hidden_size)  )





      def 		__A  (      self       :							Any	, UpperCAmelCase       :							Dict	, UpperCAmelCase       :							str	, UpperCAmelCase       :							List[Any]  ):
            A_	     =							VivitForVideoClassification(UpperCAmelCase  )
            model.to(UpperCAmelCase  )
            model.eval()

            A_	     =							model(UpperCAmelCase  )

            # verify the logits shape
            A_	     =							torch.Size((self.batch_size, self.num_labels)  )
            self.parent.assertEqual(result.logits.shape	, UpperCAmelCase  )







      def 		__A  (      self       :							Optional[int]  ):
            A_	     =							self.prepare_config_and_inputs()
            A_     ,    A_     ,    A_	     =							config_and_inputs
            A_	     =							{"pixel_values": pixel_values}
            return config, inputs_dict




@require_torch
class      _a				( snake_case_    ,							unittest.TestCase							):




      """simple docstring"""

      _lowerCamelCase					: List[Any]					=					(VivitModel, VivitForVideoClassification) if is_torch_available() else ()

      _lowerCamelCase					: Union[str, Any]					=					False
      _lowerCamelCase					: List[Any]					=					False
      _lowerCamelCase					: Any					=					False
      _lowerCamelCase					: int					=					False





      def 		__A  (      self       :							Any  ):
            A_	     =							VivitModelTester(self  )
            A_	     =							ConfigTester(self	, config_class=UpperCAmelCase	, has_text_modality=UpperCAmelCase	, hidden_size=37  )





      def 		__A  (      self       :							Union[str, Any]	, UpperCAmelCase       :							Optional[Any]	, UpperCAmelCase       :							Dict	, UpperCAmelCase       :							Tuple=False  ):
            A_	     =							copy.deepcopy(UpperCAmelCase  )

            if return_labels:
                  if model_class in get_values(UpperCAmelCase  ):
                        A_	     =							torch.zeros(
                            self.model_tester.batch_size	, dtype=torch.long	, device=UpperCAmelCase  )

            return inputs_dict





      def 		__A  (      self       :							int  ):
            self.config_tester.run_common_tests()





      @unittest.skip(reason="Vivit does not use inputs_embeds"  )
      def 		__A  (      self       :							Any  ):
            pass





      def 		__A  (      self       :							Optional[Any]  ):
            A_     ,    A_	     =							self.model_tester.prepare_config_and_inputs_for_common()

            for model_class in self.all_model_classes:
                  A_	     =							model_class(UpperCAmelCase  )
                  self.assertIsInstance(model.get_input_embeddings()	, (nn.Module)  )
                  A_	     =							model.get_output_embeddings()
                  self.assertTrue(x is None or isinstance(UpperCAmelCase	, nn.Linear  )  )





      def 		__A  (      self       :							Any  ):
            A_     ,    A_	     =							self.model_tester.prepare_config_and_inputs_for_common()

            for model_class in self.all_model_classes:
                  A_	     =							model_class(UpperCAmelCase  )
                  A_	     =							inspect.signature(model.forward  )
                  # signature.parameters is an OrderedDict => so arg_names order is deterministic
                  A_	     =							[*signature.parameters.keys()]

                  A_	     =							["pixel_values", "head_mask"]
                  self.assertListEqual(arg_names[:2]	, UpperCAmelCase  )





      def 		__A  (      self       :							Optional[Any]  ):
            A_	     =							self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_model(*UpperCAmelCase  )





      def 		__A  (      self       :							Optional[int]  ):
            A_	     =							self.model_tester.prepare_config_and_inputs()
            self.model_tester.create_and_check_for_video_classification(*UpperCAmelCase  )





      @slow
      def 		__A  (      self       :							Optional[int]  ):
            for model_name in VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                  A_	     =							VivitModel.from_pretrained(UpperCAmelCase  )
                  self.assertIsNotNone(UpperCAmelCase  )





      def 		__A  (      self       :							List[str]  ):
            A_     ,    A_	     =							self.model_tester.prepare_config_and_inputs_for_common()
            A_	     =							True

            for model_class in self.all_model_classes:
                  A_	     =							self.model_tester.seq_length

                  A_	     =							True
                  A_	     =							False
                  A_	     =							True
                  A_	     =							model_class(UpperCAmelCase  )
                  model.to(UpperCAmelCase  )
                  model.eval()
                  with torch.no_grad():
                        A_	     =							model(**self._prepare_for_class(UpperCAmelCase	, UpperCAmelCase  )  )
                  A_	     =							outputs.attentions
                  self.assertEqual(len(UpperCAmelCase  )	, self.model_tester.num_hidden_layers  )

                  # check that output_attentions also work using config
                  del inputs_dict["output_attentions"]
                  A_	     =							True
                  A_	     =							model_class(UpperCAmelCase  )
                  model.to(UpperCAmelCase  )
                  model.eval()
                  with torch.no_grad():
                        A_	     =							model(**self._prepare_for_class(UpperCAmelCase	, UpperCAmelCase  )  )
                  A_	     =							outputs.attentions
                  self.assertEqual(len(UpperCAmelCase  )	, self.model_tester.num_hidden_layers  )

                  self.assertListEqual(
                      list(attentions[0].shape[-3:]  )	, [self.model_tester.num_attention_heads, seq_len, seq_len]	, )
                  A_	     =							len(UpperCAmelCase  )

                  # Check attention is always last and order is fine
                  A_	     =							True
                  A_	     =							True
                  A_	     =							model_class(UpperCAmelCase  )
                  model.to(UpperCAmelCase  )
                  model.eval()
                  with torch.no_grad():
                        A_	     =							model(**self._prepare_for_class(UpperCAmelCase	, UpperCAmelCase  )  )

                  self.assertEqual(out_len + 1	, len(UpperCAmelCase  )  )

                  A_	     =							outputs.attentions

                  self.assertEqual(len(UpperCAmelCase  )	, self.model_tester.num_hidden_layers  )

                  self.assertListEqual(
                      list(self_attentions[0].shape[-3:]  )	, [self.model_tester.num_attention_heads, seq_len, seq_len]	, )





      def 		__A  (      self       :							Any  ):
            def check_hidden_states_output(UpperCAmelCase       :							str	, UpperCAmelCase       :							str	, UpperCAmelCase       :							List[Any]  ):
                  A_	     =							model_class(UpperCAmelCase  )
                  model.to(UpperCAmelCase  )
                  model.eval()

                  with torch.no_grad():
                        A_	     =							model(**self._prepare_for_class(UpperCAmelCase	, UpperCAmelCase  )  )

                  A_	     =							outputs.hidden_states
                  A_	     =							self.model_tester.num_hidden_layers + 1
                  self.assertEqual(len(UpperCAmelCase  )	, UpperCAmelCase  )

                  A_	     =							self.model_tester.seq_length

                  self.assertListEqual(
                      list(hidden_states[0].shape[-2:]  )	, [seq_length, self.model_tester.hidden_size]	, )

            A_     ,    A_	     =							self.model_tester.prepare_config_and_inputs_for_common()

            for model_class in self.all_model_classes:
                  A_	     =							True
                  check_hidden_states_output(UpperCAmelCase	, UpperCAmelCase	, UpperCAmelCase  )

                  # check that output_hidden_states also work using config
                  del inputs_dict["output_hidden_states"]
                  A_	     =							True

                  check_hidden_states_output(UpperCAmelCase	, UpperCAmelCase	, UpperCAmelCase  )







      @unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."  )
      def 		__A  (      self       :							Dict  ):
            pass




def 			__snake_case	(   ):



      """simple docstring"""

      A_	     =							hf_hub_download(
          repo_id="hf-internal-testing/spaghetti-video"							,filename="eating_spaghetti_32_frames.npy"							,repo_type="dataset"						)
      A_	     =							np.load(__UpperCamelCase						)
      return list(__UpperCamelCase						)



@require_torch
@require_vision
class      _a				( unittest.TestCase							):




      """simple docstring"""

      @cached_property
      def 		__A  (      self       :							int  ):
            return VivitImageProcessor() if is_vision_available() else None







      @slow
      def 		__A  (      self       :							Union[str, Any]  ):
            A_	     =							VivitForVideoClassification.from_pretrained("google/vivit-b-16x2-kinetics400"  ).to(UpperCAmelCase  )

            A_	     =							self.default_image_processor
            A_	     =							prepare_video()
            A_	     =							image_processor(UpperCAmelCase	, return_tensors="pt"  ).to(UpperCAmelCase  )

            # forward pass
            with torch.no_grad():
                  A_	     =							model(**UpperCAmelCase  )

            # verify the logits
            A_	     =							torch.Size((1, 400)  )
            self.assertEqual(outputs.logits.shape	, UpperCAmelCase  )

            # taken from original model
            A_	     =							torch.tensor([-1.0_543, 2.0_764, -0.2_104, 0.4_439, -0.9_658]  ).to(UpperCAmelCase  )

            self.assertTrue(torch.allclose(outputs.logits[0, :5]	, UpperCAmelCase	, atol=1E-4  )  )