






'''simple docstring'''
import argparse
from collections import defaultdict

import yaml


UpperCamelCase__			=      'docs/source/en/_toctree.yml'




def 		__SCREAMING_SNAKE_CASE       (	_UpperCamelCase				):


   """simple docstring"""




   lowercase_						:     int							     =  defaultdict(_UpperCamelCase				)
   lowercase_						:     str							     =  []
   lowercase_						:     List[str]							     =  []
   for doc in doc_list:
      if "local" in doc:
         counts[doc["local"]] += 1

      if doc["title"].lower() == "overview":
         overview_doc.append({"local": doc["local"], "title": doc["title"]}				)
      else:
         new_doc_list.append(_UpperCamelCase				)

   lowercase_						:     List[Any]							     =  new_doc_list
   lowercase_						:     Any							     =  [key for key, value in counts.items() if value > 1]

   lowercase_						:     Optional[Any]							     =  []
   for duplicate_key in duplicates:
      lowercase_						:     Dict							     =  list({doc["title"] for doc in doc_list if doc["local"] == duplicate_key}				)
      if len(_UpperCamelCase				) > 1:
         raise ValueError(
             F"""{duplicate_key} is present several times in the documentation table of content at """
             "`docs/source/en/_toctree.yml` with different *Title* values. Choose one of those and remove the "
             "others."				)
      # Only add this once
      new_doc.append({"local": duplicate_key, "title": titles[0]}				)

   # Add none duplicate-keys
   new_doc.extend([doc for doc in doc_list if "local" not in counts or counts[doc["local"]] == 1]				)
   lowercase_						:     str							     =  sorted(_UpperCamelCase    ,		key=lambda _UpperCamelCase				: s["title"].lower()				)

   # "overview" gets special treatment and is always first
   if len(_UpperCamelCase				) > 1:
      raise ValueError("{doc_list} has two \'overview\' docs which is not allowed."				)

   overview_doc.extend(_UpperCamelCase				)

   # Sort
   return overview_doc




def 		__SCREAMING_SNAKE_CASE       (	_UpperCamelCase=False				):


   """simple docstring"""




   with open(_UpperCamelCase    ,		encoding="utf-8"				) as f:
      lowercase_						:     int							     =  yaml.safe_load(f.read()				)

   # Get to the API doc
   lowercase_						:     int							     =  0
   while content[api_idx]["title"] != "API":
      api_idx += 1
   lowercase_						:     Any							     =  content[api_idx]["sections"]

   # Then to the model doc
   lowercase_						:     List[str]							     =  0
   while api_doc[scheduler_idx]["title"] != "Schedulers":
      scheduler_idx += 1

   lowercase_						:     Union[str, Any]							     =  api_doc[scheduler_idx]["sections"]
   lowercase_						:     List[Any]							     =  clean_doc_toc(_UpperCamelCase				)

   lowercase_						:     int							     =  False
   if new_scheduler_doc != scheduler_doc:
      lowercase_						:     Optional[Any]							     =  True
      if overwrite:
         lowercase_						:     List[Any]							     =  new_scheduler_doc

   if diff:
      if overwrite:
         lowercase_						:     str							     =  api_doc
         with open(_UpperCamelCase    ,		"w"    ,		encoding="utf-8"				) as f:
            f.write(yaml.dump(_UpperCamelCase    ,		allow_unicode=_UpperCamelCase				)				)
      else:
         raise ValueError(
             "The model doc part of the table of content is not properly sorted, run `make style` to fix this."				)




def 		__SCREAMING_SNAKE_CASE       (	_UpperCamelCase=False				):


   """simple docstring"""




   with open(_UpperCamelCase    ,		encoding="utf-8"				) as f:
      lowercase_						:     Optional[Any]							     =  yaml.safe_load(f.read()				)

   # Get to the API doc
   lowercase_						:     Dict							     =  0
   while content[api_idx]["title"] != "API":
      api_idx += 1
   lowercase_						:     Optional[int]							     =  content[api_idx]["sections"]

   # Then to the model doc
   lowercase_						:     str							     =  0
   while api_doc[pipeline_idx]["title"] != "Pipelines":
      pipeline_idx += 1

   lowercase_						:     Tuple							     =  False
   lowercase_						:     Tuple							     =  api_doc[pipeline_idx]["sections"]
   lowercase_						:     int							     =  []

   # sort sub pipeline docs
   for pipeline_doc in pipeline_docs:
      if "section" in pipeline_doc:
         lowercase_						:     Optional[int]							     =  pipeline_doc["section"]
         lowercase_						:     List[str]							     =  clean_doc_toc(_UpperCamelCase				)
         if overwrite:
            lowercase_						:     Any							     =  new_sub_pipeline_doc
      new_pipeline_docs.append(_UpperCamelCase				)

   # sort overall pipeline doc
   lowercase_						:     List[Any]							     =  clean_doc_toc(_UpperCamelCase				)

   if new_pipeline_docs != pipeline_docs:
      lowercase_						:     List[Any]							     =  True
      if overwrite:
         lowercase_						:     Any							     =  new_pipeline_docs

   if diff:
      if overwrite:
         lowercase_						:     Union[str, Any]							     =  api_doc
         with open(_UpperCamelCase    ,		"w"    ,		encoding="utf-8"				) as f:
            f.write(yaml.dump(_UpperCamelCase    ,		allow_unicode=_UpperCamelCase				)				)
      else:
         raise ValueError(
             "The model doc part of the table of content is not properly sorted, run `make style` to fix this."				)


if __name__ == "__main__":
 UpperCamelCase__			=      argparse.ArgumentParser()
 parser.add_argument('--fix_and_overwrite', action='store_true', help='Whether to fix inconsistencies.')
 UpperCamelCase__			=      parser.parse_args()

 check_scheduler_doc(args.fix_and_overwrite)
 check_pipeline_doc(args.fix_and_overwrite)





import copy
import unittest

from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, 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, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
				import torch

				from transformers import (
				    MODEL_FOR_MULTIPLE_CHOICE_MAPPING,
				    MODEL_FOR_QUESTION_ANSWERING_MAPPING,
				    MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
				    MODEL_FOR_TOKEN_CLASSIFICATION_MAPPING,
				    LayoutLMvaConfig,
				    LayoutLMvaForQuestionAnswering,
				    LayoutLMvaForSequenceClassification,
				    LayoutLMvaForTokenClassification,
				    LayoutLMvaModel,
				)
				from transformers.models.layoutlmva.modeling_layoutlmva import LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST

if is_vision_available():
				from PIL import Image

				from transformers import LayoutLMvaImageProcessor





class     lowerCAmelCase__     :


		'''simple docstring'''






		def __init__(       self     :     Union[str, Any]     ,  snake_case__     :     int     ,  snake_case__     :     List[str]=2     ,  snake_case__     :     List[str]=3     ,  snake_case__     :     Tuple=4     ,  snake_case__     :     Optional[Any]=2     ,  snake_case__     :     int=7     ,  snake_case__     :     Optional[Any]=True     ,  snake_case__     :     Union[str, Any]=True     ,  snake_case__     :     Tuple=True     ,  snake_case__     :     int=True     ,  snake_case__     :     Optional[Any]=9_9     ,  snake_case__     :     Optional[Any]=3_6     ,  snake_case__     :     Tuple=3     ,  snake_case__     :     int=4     ,  snake_case__     :     Tuple=3_7     ,  snake_case__     :     Union[str, Any]="gelu"     ,  snake_case__     :     Any=0.1     ,  snake_case__     :     Optional[int]=0.1     ,  snake_case__     :     Dict=5_1_2     ,  snake_case__     :     Optional[int]=1_6     ,  snake_case__     :     Dict=2     ,  snake_case__     :     Dict=0.02     ,  snake_case__     :     List[Any]=6     ,  snake_case__     :     int=6     ,  snake_case__     :     Tuple=3     ,  snake_case__     :     List[Any]=4     ,  snake_case__     :     List[str]=None     ,  snake_case__     :     Optional[Any]=1_0_0_0     ,  )      ->	Optional[int]:
				_lowerCamelCase				   =  parent
				_lowerCamelCase				   =  batch_size
				_lowerCamelCase				   =  num_channels
				_lowerCamelCase				   =  image_size
				_lowerCamelCase				   =  patch_size
				_lowerCamelCase				   =  text_seq_length
				_lowerCamelCase				   =  is_training
				_lowerCamelCase				   =  use_input_mask
				_lowerCamelCase				   =  use_token_type_ids
				_lowerCamelCase				   =  use_labels
				_lowerCamelCase				   =  vocab_size
				_lowerCamelCase				   =  hidden_size
				_lowerCamelCase				   =  num_hidden_layers
				_lowerCamelCase				   =  num_attention_heads
				_lowerCamelCase				   =  intermediate_size
				_lowerCamelCase				   =  hidden_act
				_lowerCamelCase				   =  hidden_dropout_prob
				_lowerCamelCase				   =  attention_probs_dropout_prob
				_lowerCamelCase				   =  max_position_embeddings
				_lowerCamelCase				   =  type_vocab_size
				_lowerCamelCase				   =  type_sequence_label_size
				_lowerCamelCase				   =  initializer_range
				_lowerCamelCase				   =  coordinate_size
				_lowerCamelCase				   =  shape_size
				_lowerCamelCase				   =  num_labels
				_lowerCamelCase				   =  num_choices
				_lowerCamelCase				   =  scope
				_lowerCamelCase				   =  range_bbox

				# LayoutLMv3's sequence length equals the number of text tokens + number of patches + 1 (we add 1 for the CLS token)
				_lowerCamelCase				   =  text_seq_length
				_lowerCamelCase				   =  (image_size // patch_size) ** 2 + 1
				_lowerCamelCase				   =  self.text_seq_length + self.image_seq_length
		def   _snake_case       (       self     :     int		)      ->	Any:
				_lowerCamelCase				   =  ids_tensor([self.batch_size, self.text_seq_length]     ,  self.vocab_size		)

				_lowerCamelCase				   =  ids_tensor([self.batch_size, self.text_seq_length, 4]     ,  self.range_bbox		)
				# Ensure that bbox is legal
				for i in range(bbox.shape[0]		):
						for j in range(bbox.shape[1]		):
								if bbox[i, j, 3] < bbox[i, j, 1]:
										_lowerCamelCase				   =  bbox[i, j, 3]
										_lowerCamelCase				   =  bbox[i, j, 1]
										_lowerCamelCase				   =  t
								if bbox[i, j, 2] < bbox[i, j, 0]:
										_lowerCamelCase				   =  bbox[i, j, 2]
										_lowerCamelCase				   =  bbox[i, j, 0]
										_lowerCamelCase				   =  t

				_lowerCamelCase				   =  floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]		)

				_lowerCamelCase				   =  None
				if self.use_input_mask:
						_lowerCamelCase				   =  random_attention_mask([self.batch_size, self.text_seq_length]		)

				_lowerCamelCase				   =  None
				if self.use_token_type_ids:
						_lowerCamelCase				   =  ids_tensor([self.batch_size, self.text_seq_length]     ,  self.type_vocab_size		)

				_lowerCamelCase				   =  None
				_lowerCamelCase				   =  None
				if self.use_labels:
						_lowerCamelCase				   =  ids_tensor([self.batch_size]     ,  self.type_sequence_label_size		)
						_lowerCamelCase				   =  ids_tensor([self.batch_size, self.text_seq_length]     ,  self.num_labels		)

				_lowerCamelCase				   =  LayoutLMvaConfig(
				    vocab_size=self.vocab_size     ,  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     ,  max_position_embeddings=self.max_position_embeddings     ,  type_vocab_size=self.type_vocab_size     ,  initializer_range=self.initializer_range     ,  coordinate_size=self.coordinate_size     ,  shape_size=self.shape_size     ,  input_size=self.image_size     ,  patch_size=self.patch_size     ,  )

				return config, input_ids, bbox, pixel_values, token_type_ids, input_mask, sequence_labels, token_labels
		def   _snake_case       (       self     :     Optional[int]     ,  snake_case__     :     Optional[Any]     ,  snake_case__     :     Any     ,  snake_case__     :     str     ,  snake_case__     :     Tuple     ,  snake_case__     :     Dict     ,  snake_case__     :     Optional[int]     ,  snake_case__     :     int     ,  snake_case__     :     Optional[Any]		)      ->	Any:
				_lowerCamelCase				   =  LayoutLMvaModel(config=snake_case__		)
				model.to(snake_case__		)
				model.eval()

				# text + image
				_lowerCamelCase				   =  model(snake_case__     ,  pixel_values=snake_case__		)
				_lowerCamelCase				   =  model(
				    snake_case__     ,  bbox=snake_case__     ,  pixel_values=snake_case__     ,  attention_mask=snake_case__     ,  token_type_ids=snake_case__		)
				_lowerCamelCase				   =  model(snake_case__     ,  bbox=snake_case__     ,  pixel_values=snake_case__     ,  token_type_ids=snake_case__		)
				_lowerCamelCase				   =  model(snake_case__     ,  bbox=snake_case__     ,  pixel_values=snake_case__		)

				self.parent.assertEqual(result.last_hidden_state.shape     ,  (self.batch_size, self.seq_length, self.hidden_size)		)

				# text only
				_lowerCamelCase				   =  model(snake_case__		)
				self.parent.assertEqual(
				    result.last_hidden_state.shape     ,  (self.batch_size, self.text_seq_length, self.hidden_size)		)

				# image only
				_lowerCamelCase				   =  model(pixel_values=snake_case__		)
				self.parent.assertEqual(
				    result.last_hidden_state.shape     ,  (self.batch_size, self.image_seq_length, self.hidden_size)		)
		def   _snake_case       (       self     :     Any     ,  snake_case__     :     Tuple     ,  snake_case__     :     Union[str, Any]     ,  snake_case__     :     Optional[int]     ,  snake_case__     :     List[Any]     ,  snake_case__     :     Any     ,  snake_case__     :     str     ,  snake_case__     :     str     ,  snake_case__     :     int		)      ->	List[Any]:
				_lowerCamelCase				   =  self.num_labels
				_lowerCamelCase				   =  LayoutLMvaForSequenceClassification(snake_case__		)
				model.to(snake_case__		)
				model.eval()
				_lowerCamelCase				   =  model(
				    snake_case__     ,  bbox=snake_case__     ,  pixel_values=snake_case__     ,  attention_mask=snake_case__     ,  token_type_ids=snake_case__     ,  labels=snake_case__     ,  )
				self.parent.assertEqual(result.logits.shape     ,  (self.batch_size, self.num_labels)		)
		def   _snake_case       (       self     :     Dict     ,  snake_case__     :     Tuple     ,  snake_case__     :     Optional[Any]     ,  snake_case__     :     str     ,  snake_case__     :     str     ,  snake_case__     :     Any     ,  snake_case__     :     List[str]     ,  snake_case__     :     Tuple     ,  snake_case__     :     Dict		)      ->	Optional[Any]:
				_lowerCamelCase				   =  self.num_labels
				_lowerCamelCase				   =  LayoutLMvaForTokenClassification(config=snake_case__		)
				model.to(snake_case__		)
				model.eval()
				_lowerCamelCase				   =  model(
				    snake_case__     ,  bbox=snake_case__     ,  pixel_values=snake_case__     ,  attention_mask=snake_case__     ,  token_type_ids=snake_case__     ,  labels=snake_case__     ,  )
				self.parent.assertEqual(result.logits.shape     ,  (self.batch_size, self.text_seq_length, self.num_labels)		)
		def   _snake_case       (       self     :     str     ,  snake_case__     :     int     ,  snake_case__     :     Optional[int]     ,  snake_case__     :     str     ,  snake_case__     :     List[str]     ,  snake_case__     :     List[Any]     ,  snake_case__     :     List[Any]     ,  snake_case__     :     int     ,  snake_case__     :     Any		)      ->	Dict:
				_lowerCamelCase				   =  LayoutLMvaForQuestionAnswering(config=snake_case__		)
				model.to(snake_case__		)
				model.eval()
				_lowerCamelCase				   =  model(
				    snake_case__     ,  bbox=snake_case__     ,  pixel_values=snake_case__     ,  attention_mask=snake_case__     ,  token_type_ids=snake_case__     ,  start_positions=snake_case__     ,  end_positions=snake_case__     ,  )
				self.parent.assertEqual(result.start_logits.shape     ,  (self.batch_size, self.seq_length)		)
				self.parent.assertEqual(result.end_logits.shape     ,  (self.batch_size, self.seq_length)		)



		def   _snake_case       (       self     :     str		)      ->	List[str]:
				_lowerCamelCase				   =  self.prepare_config_and_inputs()
				(
				    (
				    _lowerCamelCase
				)   ,							(
				    _lowerCamelCase
				)   ,							(
				    _lowerCamelCase
				)   ,							(
				    _lowerCamelCase
				)   ,							(
				    _lowerCamelCase
				)   ,							(
				    _lowerCamelCase
				)   ,							(
				    _lowerCamelCase
				)   ,							(
				    _lowerCamelCase
				)   ,							
				)				   =  config_and_inputs
				_lowerCamelCase				   =  {
				    'input_ids': input_ids,
				    'bbox': bbox,
				    'pixel_values': pixel_values,
				    'token_type_ids': token_type_ids,
				    'attention_mask': input_mask,
				}
				return config, inputs_dict





@require_torch
class     lowerCAmelCase__     (				SCREAMING_SNAKE_CASE_     ,SCREAMING_SNAKE_CASE_     ,unittest.TestCase			):


		'''simple docstring'''






		lowerCAmelCase_     =   False
		lowerCAmelCase_     =   False
		lowerCAmelCase_     =   False

		lowerCAmelCase_     =   (
		    (
		        LayoutLMvaModel,
		        LayoutLMvaForSequenceClassification,
		        LayoutLMvaForTokenClassification,
		        LayoutLMvaForQuestionAnswering,
		    )
		    if is_torch_available()
		    else ()
		)
		lowerCAmelCase_     =   (
		    {'document-question-answering': LayoutLMvaForQuestionAnswering, 'feature-extraction': LayoutLMvaModel}
		    if is_torch_available()
		    else {}
		)
		def   _snake_case       (       self     :     Union[str, Any]     ,  snake_case__     :     Tuple     ,  snake_case__     :     Optional[Any]     ,  snake_case__     :     int     ,  snake_case__     :     Tuple     ,  snake_case__     :     Union[str, Any]		)      ->	str:
				# `DocumentQuestionAnsweringPipeline` is expected to work with this model, but it combines the text and visual
				# embedding along the sequence dimension (dim 1), which causes an error during post-processing as `p_mask` has
				# the sequence dimension of the text embedding only.
				# (see the line `embedding_output = torch.cat([embedding_output, visual_embeddings], dim=1)`)
				return True
		def   _snake_case       (       self     :     str		)      ->	Any:
				_lowerCamelCase				   =  LayoutLMvaModelTester(self		)
				_lowerCamelCase				   =  ConfigTester(self     ,  config_class=snake_case__     ,  hidden_size=3_7		)
		def   _snake_case       (       self     :     List[str]     ,  snake_case__     :     str     ,  snake_case__     :     List[Any]     ,  snake_case__     :     Dict=False		)      ->	str:
				_lowerCamelCase				   =  copy.deepcopy(snake_case__		)
				if model_class in get_values(snake_case__		):
						_lowerCamelCase				   =  {
						    k: v.unsqueeze(1		).expand(-1     ,  self.model_tester.num_choices     ,  -1		).contiguous()
						    if isinstance(snake_case__     ,  torch.Tensor		) and v.ndim > 1
						    else v
						    for k, v in inputs_dict.items()
						}
				if return_labels:
						if model_class in get_values(snake_case__		):
								_lowerCamelCase				   =  torch.ones(self.model_tester.batch_size     ,  dtype=torch.long     ,  device=snake_case__		)
						elif model_class in get_values(snake_case__		):
								_lowerCamelCase				   =  torch.zeros(
								    self.model_tester.batch_size     ,  dtype=torch.long     ,  device=snake_case__		)
								_lowerCamelCase				   =  torch.zeros(
								    self.model_tester.batch_size     ,  dtype=torch.long     ,  device=snake_case__		)
						elif model_class in [
						    *get_values(snake_case__		),
						]:
								_lowerCamelCase				   =  torch.zeros(
								    self.model_tester.batch_size     ,  dtype=torch.long     ,  device=snake_case__		)
						elif model_class in [
						    *get_values(snake_case__		),
						]:
								_lowerCamelCase				   =  torch.zeros(
								    (self.model_tester.batch_size, self.model_tester.text_seq_length)     ,  dtype=torch.long     ,  device=snake_case__     ,  )

				return inputs_dict
		def   _snake_case       (       self     :     Any		)      ->	List[str]:
				self.config_tester.run_common_tests()
		def   _snake_case       (       self     :     int		)      ->	Optional[int]:
				_lowerCamelCase				   =  self.model_tester.prepare_config_and_inputs()
				self.model_tester.create_and_check_model(*snake_case__		)
		def   _snake_case       (       self     :     int		)      ->	Any:
				_lowerCamelCase				   =  self.model_tester.prepare_config_and_inputs()
				for type in ["absolute", "relative_key", "relative_key_query"]:
						_lowerCamelCase				   =  type
						self.model_tester.create_and_check_model(*snake_case__		)
		def   _snake_case       (       self     :     int		)      ->	Any:
				_lowerCamelCase				   =  self.model_tester.prepare_config_and_inputs()
				self.model_tester.create_and_check_for_sequence_classification(*snake_case__		)
		def   _snake_case       (       self     :     Any		)      ->	Any:
				_lowerCamelCase				   =  self.model_tester.prepare_config_and_inputs()
				self.model_tester.create_and_check_for_token_classification(*snake_case__		)
		def   _snake_case       (       self     :     int		)      ->	List[Any]:
				_lowerCamelCase				   =  self.model_tester.prepare_config_and_inputs()
				self.model_tester.create_and_check_for_question_answering(*snake_case__		)



		@slow
		def   _snake_case       (       self     :     Optional[int]		)      ->	List[Any]:
				for model_name in LAYOUTLMV3_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
						_lowerCamelCase				   =  LayoutLMvaModel.from_pretrained(snake_case__		)
						self.assertIsNotNone(snake_case__		)



def 	lowerCamelCase					(	)   ->    List[Any]:
		_lowerCamelCase				   =  Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'							)
		return image





@require_torch
class     lowerCAmelCase__     (				unittest.TestCase			):


		'''simple docstring'''






		@cached_property
		def   _snake_case       (       self     :     int		)      ->	Any:
				return LayoutLMvaImageProcessor(apply_ocr=snake_case__		) if is_vision_available() else None



		@slow
		def   _snake_case       (       self     :     List[str]		)      ->	Tuple:
				_lowerCamelCase				   =  LayoutLMvaModel.from_pretrained('microsoft/layoutlmv3-base'		).to(snake_case__		)

				_lowerCamelCase				   =  self.default_image_processor
				_lowerCamelCase				   =  prepare_img()
				_lowerCamelCase				   =  image_processor(images=snake_case__     ,  return_tensors='pt'		).pixel_values.to(snake_case__		)

				_lowerCamelCase				   =  torch.tensor([[1, 2]]		)
				_lowerCamelCase				   =  torch.tensor([[1, 2, 3, 4], [5, 6, 7, 8]]		).unsqueeze(0		)

				# forward pass
				_lowerCamelCase				   =  model(
				    input_ids=input_ids.to(snake_case__		)     ,  bbox=bbox.to(snake_case__		)     ,  pixel_values=pixel_values.to(snake_case__		)     ,  )

				# verify the logits
				_lowerCamelCase				   =  torch.Size((1, 1_9_9, 7_6_8)		)
				self.assertEqual(outputs.last_hidden_state.shape     ,  snake_case__		)

				_lowerCamelCase				   =  torch.tensor(
				    [[-0.0529, 0.3618, 0.1632], [-0.1587, -0.1667, -0.0400], [-0.1557, -0.1671, -0.0505]]		).to(snake_case__		)

				self.assertTrue(torch.allclose(outputs.last_hidden_state[0, :3, :3]     ,  snake_case__     ,  atol=1e-4		)		)