





import argparse
import json
import os

import evaluate
import torch
from datasets import load_dataset
from torch.optim import AdamW
from torch.utils.data import DataLoader
from transformers import AutoModelForSequenceClassification, AutoTokenizer, get_linear_schedule_with_warmup, set_seed

from accelerate import Accelerator, DistributedType
from accelerate.utils.deepspeed import DummyOptim, DummyScheduler


_A		:				int									=       16
_A		:				List[Any]									=       32



def     __lowerCAmelCase						(							snake_case	:    Accelerator						,      snake_case	:    int = 16						,      snake_case	:    str = "bert-base-cased" )       ->							Tuple:
   __lowerCamelCase:				int     =	AutoTokenizer.from_pretrained(snake_case__ )
   __lowerCamelCase:				Any     =	load_dataset("""glue"""						,      """mrpc""" )

   def tokenize_function(snake_case	:    Tuple ):
      # max_length=None => use the model max length (it's actually the default)
      __lowerCamelCase:				Optional[int]     =	tokenizer(examples["""sentence1"""]						,      examples["""sentence2"""]						,      truncation=snake_case__						,      max_length=snake_case__ )
      return outputs

   # Apply the method we just defined to all the examples in all the splits of the dataset
   __lowerCamelCase:				Any     =	datasets.map(
       snake_case__						,      batched=snake_case__						,      remove_columns=["""idx""", """sentence1""", """sentence2"""]						,      load_from_cache_file=snake_case__ )

   # We also rename the 'label' column to 'labels' which is the expected name for labels by the models of the
   # transformers library
   __lowerCamelCase:				Optional[Any]     =	tokenized_datasets.rename_column("""label"""						,      """labels""" )

   def collate_fn(snake_case	:    List[str] ):
      # On TPU it's best to pad everything to the same length or training will be very slow.
      if accelerator.distributed_type == DistributedType.TPU:
         return tokenizer.pad(snake_case__						,      padding="""max_length"""						,      max_length=128						,      return_tensors="""pt""" )
      return tokenizer.pad(snake_case__						,      padding="""longest"""						,      return_tensors="""pt""" )

   # Instantiate dataloaders.
   __lowerCamelCase:				int     =	DataLoader(
       tokenized_datasets["""train"""]						,      shuffle=snake_case__						,      collate_fn=snake_case__						,      batch_size=snake_case__ )
   __lowerCamelCase:				Optional[Any]     =	DataLoader(
       tokenized_datasets["""validation"""]						,      shuffle=snake_case__						,      collate_fn=snake_case__						,      batch_size=snake_case__ )

   return train_dataloader, eval_dataloader



def     __lowerCAmelCase						(							snake_case	:    List[Any]						,      snake_case	:    Union[str, Any] )       ->							List[str]:
   # Initialize accelerator
   __lowerCamelCase:				Optional[int]     =	Accelerator()

   # Sample hyper-parameters for learning rate, batch size, seed and a few other HPs
   __lowerCamelCase:				Tuple     =	config["""lr"""]
   __lowerCamelCase:				List[str]     =	int(config["""num_epochs"""] )
   __lowerCamelCase:				str     =	int(config["""seed"""] )
   __lowerCamelCase:				List[Any]     =	int(config["""batch_size"""] )
   __lowerCamelCase:				Optional[Any]     =	args.model_name_or_path

   set_seed(snake_case__ )
   __lowerCamelCase   ,     __lowerCamelCase:				List[str]     =	get_dataloaders(snake_case__						,      snake_case__						,      snake_case__ )

   # Instantiate the model (we build the model here so that the seed also control new weights initialization)
   __lowerCamelCase:				Optional[Any]     =	AutoModelForSequenceClassification.from_pretrained(snake_case__						,      return_dict=snake_case__ )

   # Instantiate optimizer
   __lowerCamelCase:				List[str]     =	(
       AdamW
       if accelerator.state.deepspeed_plugin is None
       or """optimizer""" not in accelerator.state.deepspeed_plugin.deepspeed_config
       else DummyOptim
   )
   __lowerCamelCase:				str     =	optimizer_cls(params=model.parameters()						,      lr=snake_case__ )

   if accelerator.state.deepspeed_plugin is not None:
      __lowerCamelCase:				Any     =	accelerator.state.deepspeed_plugin.deepspeed_config[
          """gradient_accumulation_steps"""
      ]
   else:
      __lowerCamelCase:				List[Any]     =	1
   __lowerCamelCase:				Tuple     =	(len(snake_case__ ) * num_epochs) // gradient_accumulation_steps

   # Instantiate scheduler
   if (
       accelerator.state.deepspeed_plugin is None
       or "scheduler" not in accelerator.state.deepspeed_plugin.deepspeed_config
   ):
      __lowerCamelCase:				List[str]     =	get_linear_schedule_with_warmup(
          optimizer=snake_case__						,      num_warmup_steps=0						,      num_training_steps=snake_case__						,      )
   else:
      __lowerCamelCase:				Union[str, Any]     =	DummyScheduler(snake_case__						,      total_num_steps=snake_case__						,      warmup_num_steps=0 )

   # Prepare everything
   # There is no specific order to remember, we just need to unpack the objects in the same order we gave them to the
   # prepare method.
   __lowerCamelCase   ,     __lowerCamelCase   ,     __lowerCamelCase   ,     __lowerCamelCase   ,     __lowerCamelCase:				List[Any]     =	accelerator.prepare(
       snake_case__						,      snake_case__						,      snake_case__						,      snake_case__						,      snake_case__ )

   # We need to keep track of how many total steps we have iterated over
   __lowerCamelCase:				List[str]     =	0
   # We also need to keep track of the stating epoch so files are named properly
   __lowerCamelCase:				Tuple     =	0

   # Now we train the model
   __lowerCamelCase:				Tuple     =	evaluate.load("""glue"""						,      """mrpc""" )
   __lowerCamelCase:				Optional[Any]     =	0
   __lowerCamelCase:				List[Any]     =	{}
   for epoch in range(snake_case__						,      snake_case__ ):
      model.train()
      for step, batch in enumerate(snake_case__ ):
         __lowerCamelCase:				List[str]     =	model(**snake_case__ )
         __lowerCamelCase:				Optional[int]     =	outputs.loss
         __lowerCamelCase:				List[str]     =	loss / gradient_accumulation_steps
         accelerator.backward(snake_case__ )
         if step % gradient_accumulation_steps == 0:
            optimizer.step()
            lr_scheduler.step()
            optimizer.zero_grad()

         overall_step += 1

      model.eval()
      __lowerCamelCase:				Union[str, Any]     =	0
      for step, batch in enumerate(snake_case__ ):
         # We could avoid this line since we set the accelerator with `device_placement=True`.
         batch.to(accelerator.device )
         with torch.no_grad():
            __lowerCamelCase:				Any     =	model(**snake_case__ )
         __lowerCamelCase:				Optional[int]     =	outputs.logits.argmax(dim=-1 )
         # It is slightly faster to call this once, than multiple times
         __lowerCamelCase   ,     __lowerCamelCase:				Optional[Any]     =	accelerator.gather(
             (predictions, batch["""labels"""]) )  # If we are in a multiprocess environment, the last batch has duplicates
         if accelerator.use_distributed:
            if step == len(snake_case__ ) - 1:
               __lowerCamelCase:				List[Any]     =	predictions[: len(eval_dataloader.dataset ) - samples_seen]
               __lowerCamelCase:				Tuple     =	references[: len(eval_dataloader.dataset ) - samples_seen]
            else:
               samples_seen += references.shape[0]
         metric.add_batch(
             predictions=snake_case__						,      references=snake_case__						,      )

      __lowerCamelCase:				Optional[Any]     =	metric.compute()
      # Use accelerator.print to print only on the main process.
      accelerator.print(f'epoch {epoch}:'						,      snake_case__ )
      __lowerCamelCase:				int     =	eval_metric["""accuracy"""]

      if best_performance < eval_metric["accuracy"]:
         __lowerCamelCase:				Tuple     =	eval_metric["""accuracy"""]

   if args.performance_lower_bound is not None:
      assert (
          args.performance_lower_bound <= best_performance
      ), f'Best performance metric {best_performance} is lower than the lower bound {args.performance_lower_bound}'

   accelerator.wait_for_everyone()
   if accelerator.is_main_process:
      with open(os.path.join(args.output_dir						,      """all_results.json""" )						,      """w""" ) as f:
         json.dump(snake_case__						,      snake_case__ )



def     __lowerCAmelCase						(							)       ->							Optional[int]:
   __lowerCamelCase:				str     =	argparse.ArgumentParser(description="""Simple example of training script tracking peak GPU memory usage.""" )
   parser.add_argument(
       """--model_name_or_path"""						,      type=snake_case__						,      default="""bert-base-cased"""						,      help="""Path to pretrained model or model identifier from huggingface.co/models."""						,      required=snake_case__						,      )
   parser.add_argument(
       """--output_dir"""						,      type=snake_case__						,      default="""."""						,      help="""Optional save directory where all checkpoint folders will be stored. Default is the current working directory."""						,      )
   parser.add_argument(
       """--performance_lower_bound"""						,      type=snake_case__						,      default=snake_case__						,      help="""Optional lower bound for the performance metric. If set, the training will throw error when the performance metric drops below this value."""						,      )
   parser.add_argument(
       """--num_epochs"""						,      type=snake_case__						,      default=3						,      help="""Number of train epochs."""						,      )
   __lowerCamelCase:				Optional[Any]     =	parser.parse_args()
   __lowerCamelCase:				Union[str, Any]     =	{"""lr""": 2e-5, """num_epochs""": args.num_epochs, """seed""": 42, """batch_size""": 16}
   training_function(snake_case__						,      snake_case__ )


if __name__ == "__main__":
   main()






from __future__ import annotations

import unittest

from transformers import DistilBertConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
   import tensorflow as tf

   from transformers.models.distilbert.modeling_tf_distilbert import (
       TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
       TFDistilBertForMaskedLM,
       TFDistilBertForMultipleChoice,
       TFDistilBertForQuestionAnswering,
       TFDistilBertForSequenceClassification,
       TFDistilBertForTokenClassification,
       TFDistilBertModel,
   )



class        a					:





     def __init__(    self					:				List[Any]    ,	SCREAMING_SNAKE_CASE_					:				str    ,	):
        __lowerCamelCase:				Optional[int]     =	parent
        __lowerCamelCase:				Dict     =	13
        __lowerCamelCase:				List[Any]     =	7
        __lowerCamelCase:				Optional[int]     =	True
        __lowerCamelCase:				str     =	True
        __lowerCamelCase:				Dict     =	False
        __lowerCamelCase:				Union[str, Any]     =	True
        __lowerCamelCase:				Any     =	99
        __lowerCamelCase:				Dict     =	32
        __lowerCamelCase:				str     =	2
        __lowerCamelCase:				Optional[int]     =	4
        __lowerCamelCase:				Optional[Any]     =	37
        __lowerCamelCase:				Union[str, Any]     =	"""gelu"""
        __lowerCamelCase:				List[Any]     =	0.1
        __lowerCamelCase:				Dict     =	0.1
        __lowerCamelCase:				str     =	512
        __lowerCamelCase:				Dict     =	16
        __lowerCamelCase:				List[str]     =	2
        __lowerCamelCase:				Optional[int]     =	0.02
        __lowerCamelCase:				Dict     =	3
        __lowerCamelCase:				Optional[int]     =	4
        __lowerCamelCase:				Tuple     =	None





     def  SCREAMING_SNAKE_CASE__       (    self					:				int							):
        __lowerCamelCase:				int     =	ids_tensor([self.batch_size, self.seq_length]    ,	self.vocab_size							)

        __lowerCamelCase:				Any     =	None
        if self.use_input_mask:
           __lowerCamelCase:				Optional[int]     =	random_attention_mask([self.batch_size, self.seq_length]							)

        __lowerCamelCase:				Optional[Any]     =	None
        __lowerCamelCase:				Optional[Any]     =	None
        __lowerCamelCase:				List[str]     =	None
        if self.use_labels:
           __lowerCamelCase:				Any     =	ids_tensor([self.batch_size]    ,	self.type_sequence_label_size							)
           __lowerCamelCase:				List[Any]     =	ids_tensor([self.batch_size, self.seq_length]    ,	self.num_labels							)
           __lowerCamelCase:				Optional[int]     =	ids_tensor([self.batch_size]    ,	self.num_choices							)

        __lowerCamelCase:				Any     =	DistilBertConfig(
            vocab_size=self.vocab_size    ,	dim=self.hidden_size    ,	n_layers=self.num_hidden_layers    ,	n_heads=self.num_attention_heads    ,	hidden_dim=self.intermediate_size    ,	hidden_act=self.hidden_act    ,	dropout=self.hidden_dropout_prob    ,	attention_dropout=self.attention_probs_dropout_prob    ,	max_position_embeddings=self.max_position_embeddings    ,	initializer_range=self.initializer_range    ,	)

        return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels





     def  SCREAMING_SNAKE_CASE__       (    self					:				Dict    ,	SCREAMING_SNAKE_CASE_					:				Any    ,	SCREAMING_SNAKE_CASE_					:				Tuple    ,	SCREAMING_SNAKE_CASE_					:				List[Any]    ,	SCREAMING_SNAKE_CASE_					:				Any    ,	SCREAMING_SNAKE_CASE_					:				Any    ,	SCREAMING_SNAKE_CASE_					:				List[str]							):
        __lowerCamelCase:				str     =	TFDistilBertModel(config=SCREAMING_SNAKE_CASE_							)
        __lowerCamelCase:				List[Any]     =	{"""input_ids""": input_ids, """attention_mask""": input_mask}

        __lowerCamelCase:				Optional[Any]     =	model(SCREAMING_SNAKE_CASE_							)

        __lowerCamelCase:				int     =	[input_ids, input_mask]

        __lowerCamelCase:				str     =	model(SCREAMING_SNAKE_CASE_							)

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





     def  SCREAMING_SNAKE_CASE__       (    self					:				Optional[int]    ,	SCREAMING_SNAKE_CASE_					:				Union[str, Any]    ,	SCREAMING_SNAKE_CASE_					:				Optional[int]    ,	SCREAMING_SNAKE_CASE_					:				Any    ,	SCREAMING_SNAKE_CASE_					:				str    ,	SCREAMING_SNAKE_CASE_					:				List[Any]    ,	SCREAMING_SNAKE_CASE_					:				Dict							):
        __lowerCamelCase:				Any     =	TFDistilBertForMaskedLM(config=SCREAMING_SNAKE_CASE_							)
        __lowerCamelCase:				Dict     =	{"""input_ids""": input_ids, """attention_mask""": input_mask}
        __lowerCamelCase:				str     =	model(SCREAMING_SNAKE_CASE_							)
        self.parent.assertEqual(result.logits.shape    ,	(self.batch_size, self.seq_length, self.vocab_size)							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				Any    ,	SCREAMING_SNAKE_CASE_					:				Optional[Any]    ,	SCREAMING_SNAKE_CASE_					:				Optional[Any]    ,	SCREAMING_SNAKE_CASE_					:				Dict    ,	SCREAMING_SNAKE_CASE_					:				Tuple    ,	SCREAMING_SNAKE_CASE_					:				Dict    ,	SCREAMING_SNAKE_CASE_					:				Optional[Any]							):
        __lowerCamelCase:				Optional[int]     =	TFDistilBertForQuestionAnswering(config=SCREAMING_SNAKE_CASE_							)
        __lowerCamelCase:				Tuple     =	{
            """input_ids""": input_ids,
            """attention_mask""": input_mask,
        }
        __lowerCamelCase:				Tuple     =	model(SCREAMING_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  SCREAMING_SNAKE_CASE__       (    self					:				Union[str, Any]    ,	SCREAMING_SNAKE_CASE_					:				Union[str, Any]    ,	SCREAMING_SNAKE_CASE_					:				Optional[int]    ,	SCREAMING_SNAKE_CASE_					:				Dict    ,	SCREAMING_SNAKE_CASE_					:				Optional[Any]    ,	SCREAMING_SNAKE_CASE_					:				List[str]    ,	SCREAMING_SNAKE_CASE_					:				Optional[int]							):
        __lowerCamelCase:				Any     =	self.num_labels
        __lowerCamelCase:				Optional[Any]     =	TFDistilBertForSequenceClassification(SCREAMING_SNAKE_CASE_							)
        __lowerCamelCase:				Dict     =	{"""input_ids""": input_ids, """attention_mask""": input_mask}
        __lowerCamelCase:				Optional[int]     =	model(SCREAMING_SNAKE_CASE_							)
        self.parent.assertEqual(result.logits.shape    ,	(self.batch_size, self.num_labels)							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				int    ,	SCREAMING_SNAKE_CASE_					:				List[str]    ,	SCREAMING_SNAKE_CASE_					:				Any    ,	SCREAMING_SNAKE_CASE_					:				Any    ,	SCREAMING_SNAKE_CASE_					:				Dict    ,	SCREAMING_SNAKE_CASE_					:				int    ,	SCREAMING_SNAKE_CASE_					:				Dict							):
        __lowerCamelCase:				Tuple     =	self.num_choices
        __lowerCamelCase:				Optional[int]     =	TFDistilBertForMultipleChoice(SCREAMING_SNAKE_CASE_							)
        __lowerCamelCase:				Optional[Any]     =	tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE_    ,	1							)    ,	(1, self.num_choices, 1)							)
        __lowerCamelCase:				str     =	tf.tile(tf.expand_dims(SCREAMING_SNAKE_CASE_    ,	1							)    ,	(1, self.num_choices, 1)							)
        __lowerCamelCase:				List[Any]     =	{
            """input_ids""": multiple_choice_inputs_ids,
            """attention_mask""": multiple_choice_input_mask,
        }
        __lowerCamelCase:				int     =	model(SCREAMING_SNAKE_CASE_							)
        self.parent.assertEqual(result.logits.shape    ,	(self.batch_size, self.num_choices)							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				Dict    ,	SCREAMING_SNAKE_CASE_					:				Union[str, Any]    ,	SCREAMING_SNAKE_CASE_					:				Optional[Any]    ,	SCREAMING_SNAKE_CASE_					:				Optional[int]    ,	SCREAMING_SNAKE_CASE_					:				List[str]    ,	SCREAMING_SNAKE_CASE_					:				Any    ,	SCREAMING_SNAKE_CASE_					:				Union[str, Any]							):
        __lowerCamelCase:				Union[str, Any]     =	self.num_labels
        __lowerCamelCase:				Optional[int]     =	TFDistilBertForTokenClassification(SCREAMING_SNAKE_CASE_							)
        __lowerCamelCase:				Optional[Any]     =	{"""input_ids""": input_ids, """attention_mask""": input_mask}
        __lowerCamelCase:				str     =	model(SCREAMING_SNAKE_CASE_							)
        self.parent.assertEqual(result.logits.shape    ,	(self.batch_size, self.seq_length, self.num_labels)							)







     def  SCREAMING_SNAKE_CASE__       (    self					:				Tuple							):
        __lowerCamelCase:				Dict     =	self.prepare_config_and_inputs()
        ((__lowerCamelCase)   ,     (__lowerCamelCase)   ,     (__lowerCamelCase)   ,     (__lowerCamelCase)   ,     (__lowerCamelCase)   ,     (__lowerCamelCase)):				Tuple     =	config_and_inputs
        __lowerCamelCase:				Dict     =	{"""input_ids""": input_ids, """attention_mask""": input_mask}
        return config, inputs_dict



@require_tf
class        a					(			_UpperCAmelCase     ,_UpperCAmelCase     ,unittest.TestCase   ):
     UpperCAmelCase__ :  Any						      =	(
         (
             TFDistilBertModel,
             TFDistilBertForMaskedLM,
             TFDistilBertForQuestionAnswering,
             TFDistilBertForSequenceClassification,
             TFDistilBertForTokenClassification,
             TFDistilBertForMultipleChoice,
         )
         if is_tf_available()
         else None
     )
     UpperCAmelCase__ :  Dict						      =	(
         {
             "feature-extraction": TFDistilBertModel,
             "fill-mask": TFDistilBertForMaskedLM,
             "question-answering": TFDistilBertForQuestionAnswering,
             "text-classification": TFDistilBertForSequenceClassification,
             "token-classification": TFDistilBertForTokenClassification,
             "zero-shot": TFDistilBertForSequenceClassification,
         }
         if is_tf_available()
         else {}
     )
     UpperCAmelCase__ :  Optional[Any]						      =	False
     UpperCAmelCase__ :  Tuple						      =	False





     def  SCREAMING_SNAKE_CASE__       (    self					:				Optional[int]							):
        __lowerCamelCase:				List[str]     =	TFDistilBertModelTester(self							)
        __lowerCamelCase:				Union[str, Any]     =	ConfigTester(self    ,	config_class=SCREAMING_SNAKE_CASE_    ,	dim=37							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				Optional[int]							):
        self.config_tester.run_common_tests()





     def  SCREAMING_SNAKE_CASE__       (    self					:				Union[str, Any]							):
        __lowerCamelCase:				Dict     =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_distilbert_model(*SCREAMING_SNAKE_CASE_							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				int							):
        __lowerCamelCase:				List[Any]     =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_distilbert_for_masked_lm(*SCREAMING_SNAKE_CASE_							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				List[Any]							):
        __lowerCamelCase:				Tuple     =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_distilbert_for_question_answering(*SCREAMING_SNAKE_CASE_							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				List[str]							):
        __lowerCamelCase:				List[Any]     =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_distilbert_for_sequence_classification(*SCREAMING_SNAKE_CASE_							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				Optional[Any]							):
        __lowerCamelCase:				List[Any]     =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_distilbert_for_multiple_choice(*SCREAMING_SNAKE_CASE_							)





     def  SCREAMING_SNAKE_CASE__       (    self					:				str							):
        __lowerCamelCase:				int     =	self.model_tester.prepare_config_and_inputs()
        self.model_tester.create_and_check_distilbert_for_token_classification(*SCREAMING_SNAKE_CASE_							)







     @slow
     def  SCREAMING_SNAKE_CASE__       (    self					:				int							):
        for model_name in list(TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]							):
           __lowerCamelCase:				List[str]     =	TFDistilBertModel.from_pretrained(SCREAMING_SNAKE_CASE_							)
           self.assertIsNotNone(SCREAMING_SNAKE_CASE_							)



@require_tf
class        a					(			unittest.TestCase   ):





     @slow
     def  SCREAMING_SNAKE_CASE__       (    self					:				List[Any]							):
        __lowerCamelCase:				int     =	TFDistilBertModel.from_pretrained("""distilbert-base-uncased"""							)
        __lowerCamelCase:				Optional[Any]     =	tf.constant([[0, 1, 2, 3, 4, 5]]							)
        __lowerCamelCase:				Any     =	model(SCREAMING_SNAKE_CASE_							)[0]

        __lowerCamelCase:				Union[str, Any]     =	[1, 6, 768]
        self.assertEqual(output.shape    ,	SCREAMING_SNAKE_CASE_							)

        __lowerCamelCase:				List[Any]     =	tf.constant(
            [
                [
                    [0.1926_1885, -0.1373_2955, 0.411_9799],
                    [0.2215_0156, -0.0742_2661, 0.3903_7204],
                    [0.2275_6018, -0.089_6414, 0.370_1467],
                ]
            ]							)
        tf.debugging.assert_near(output[:, :3, :3]    ,	SCREAMING_SNAKE_CASE_    ,	atol=1E-4							)


