





"""simple docstring"""
import argparse
import logging
import os
import sys
from collections import namedtuple

import torch
from modeling_bertabs import BertAbs, build_predictor
from torch.utils.data import DataLoader, SequentialSampler
from tqdm import tqdm

from transformers import BertTokenizer

from .utils_summarization import (
    CNNDMDataset,
    build_mask,
    compute_token_type_ids,
    encode_for_summarization,
    truncate_or_pad,
)


__UpperCamelCase			:		List[str]		    =   logging.getLogger(__name__)
logging.basicConfig(stream=sys.stdout, level=logging.INFO)


__UpperCamelCase			:		Tuple		    =   namedtuple('''Batch''', ['''document_names''', '''batch_size''', '''src''', '''segs''', '''mask_src''', '''tgt_str'''])

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  List[str]       ):
 lowerCAmelCase  							=      BertTokenizer.from_pretrained('bert-base-uncased'   ,			do_lower_case=_UpperCAmelCase       )
 lowerCAmelCase  							=      BertAbs.from_pretrained('remi/bertabs-finetuned-extractive-abstractive-summarization'       )
 model.to(args.device       )
 model.eval()

 lowerCAmelCase  							=      {
     'BOS': tokenizer.vocab['[unused0]'],
     'EOS': tokenizer.vocab['[unused1]'],
     'PAD': tokenizer.vocab['[PAD]'],
 }

 if args.compute_rouge:
  lowerCAmelCase  							=      []
  lowerCAmelCase  							=      []

  import nltk
  import rouge

  nltk.download('punkt'       )
  lowerCAmelCase  							=      rouge.Rouge(
      metrics=['rouge-n', 'rouge-l']   ,			max_n=2   ,			limit_length=_UpperCAmelCase   ,			length_limit=args.beam_size   ,			length_limit_type='words'   ,			apply_avg=_UpperCAmelCase   ,			apply_best=_UpperCAmelCase   ,			alpha=0.5   ,			weight_factor=1.2   ,			stemming=_UpperCAmelCase   ,			)

 # these (unused) arguments are defined to keep the compatibility
 # with the legacy code and will be deleted in a next iteration.
 lowerCAmelCase  							=      ''
 lowerCAmelCase  							=      ''

 lowerCAmelCase  							=      build_data_iterator(_UpperCAmelCase   ,			_UpperCAmelCase       )
 lowerCAmelCase  							=      build_predictor(_UpperCAmelCase   ,			_UpperCAmelCase   ,			_UpperCAmelCase   ,			_UpperCAmelCase       )

 logger.info('***** Running evaluation *****'       )
 logger.info('  Number examples = %d'   ,			len(data_iterator.dataset       )       )
 logger.info('  Batch size = %d'   ,			args.batch_size       )
 logger.info(''       )
 logger.info('***** Beam Search parameters *****'       )
 logger.info('  Beam size = %d'   ,			args.beam_size       )
 logger.info('  Minimum length = %d'   ,			args.min_length       )
 logger.info('  Maximum length = %d'   ,			args.max_length       )
 logger.info('  Alpha (length penalty) = %.2f'   ,			args.alpha       )
 logger.info('  Trigrams %s be blocked'   ,			('will' if args.block_trigram else 'will NOT')       )

 for batch in tqdm(_UpperCAmelCase       ):
  lowerCAmelCase  							=      predictor.translate_batch(_UpperCAmelCase       )
  lowerCAmelCase  							=      predictor.from_batch(_UpperCAmelCase       )
  lowerCAmelCase  							=      [format_summary(_UpperCAmelCase       ) for t in translations]
  save_summaries(_UpperCAmelCase   ,			args.summaries_output_dir   ,			batch.document_names       )

  if args.compute_rouge:
   reference_summaries += batch.tgt_str
   generated_summaries += summaries

 if args.compute_rouge:
  lowerCAmelCase  							=      rouge_evaluator.get_scores(_UpperCAmelCase   ,			_UpperCAmelCase       )
  lowerCAmelCase  							=      format_rouge_scores(_UpperCAmelCase       )
  save_rouge_scores(_UpperCAmelCase       )
  print(_UpperCAmelCase       )

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  Union[str, Any]   ,			_UpperCAmelCase :  Optional[Any]   ,			_UpperCAmelCase :  Any       ):
 for summary, document_name in zip(_UpperCAmelCase   ,			_UpperCAmelCase       ):
  # Prepare the summary file's name
  if "." in document_name:
   lowerCAmelCase  							=      '.'.join(document_name.split('.'       )[:-1]       )
   lowerCAmelCase  							=      document_name.split('.'       )[-1]
   lowerCAmelCase  							=      bare_document_name + '_summary.' + extension
  else:
   lowerCAmelCase  							=      document_name + '_summary'

  lowerCAmelCase  							=      os.path.join(_UpperCAmelCase   ,			_UpperCAmelCase       )
  with open(_UpperCAmelCase   ,			'w'       ) as output:
   output.write(_UpperCAmelCase       )

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  str       ):
 lowerCAmelCase							,lowerCAmelCase							,lowerCAmelCase  							=      translation
 lowerCAmelCase  							=      (
     raw_summary.replace('[unused0]'   ,			''       )
     .replace('[unused3]'   ,			''       )
     .replace('[PAD]'   ,			''       )
     .replace('[unused1]'   ,			''       )
     .replace(R' +'   ,			' '       )
     .replace(' [unused2] '   ,			'. '       )
     .replace('[unused2]'   ,			''       )
     .strip()
 )

 return summary

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  str       ):
 return """\n
****** ROUGE SCORES ******

** ROUGE 1
F1        >> {:.3f}
Precision >> {:.3f}
Recall    >> {:.3f}

** ROUGE 2
F1        >> {:.3f}
Precision >> {:.3f}
Recall    >> {:.3f}

** ROUGE L
F1        >> {:.3f}
Precision >> {:.3f}
Recall    >> {:.3f}""".format(
     scores['rouge-1']['f']   ,			scores['rouge-1']['p']   ,			scores['rouge-1']['r']   ,			scores['rouge-2']['f']   ,			scores['rouge-2']['p']   ,			scores['rouge-2']['r']   ,			scores['rouge-l']['f']   ,			scores['rouge-l']['p']   ,			scores['rouge-l']['r']   ,			)

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  Dict       ):
 with open('rouge_scores.txt'   ,			'w'       ) as output:
  output.write(_UpperCAmelCase       )

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  List[Any]   ,			_UpperCAmelCase :  List[Any]       ):
 lowerCAmelCase  							=      load_and_cache_examples(_UpperCAmelCase   ,			_UpperCAmelCase       )
 lowerCAmelCase  							=      SequentialSampler(_UpperCAmelCase       )

 def collate_fn(_UpperCAmelCase :  Dict       ):
  return collate(_UpperCAmelCase   ,			_UpperCAmelCase   ,			block_size=512   ,			device=args.device       )

 lowerCAmelCase  							=      DataLoader(
     _UpperCAmelCase   ,			sampler=_UpperCAmelCase   ,			batch_size=args.batch_size   ,			collate_fn=_UpperCAmelCase   ,			)

 return iterator

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  List[Any]   ,			_UpperCAmelCase :  Tuple       ):
 lowerCAmelCase  							=      CNNDMDataset(args.documents_dir       )
 return dataset

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  Dict   ,			_UpperCAmelCase :  str   ,			_UpperCAmelCase :  List[str]   ,			_UpperCAmelCase :  int       ):
 lowerCAmelCase  							=      [x for x in data if not len(x[1]       ) == 0]  # remove empty_files
 lowerCAmelCase  							=      [name for name, _, _ in data]
 lowerCAmelCase  							=      [' '.join(_UpperCAmelCase       ) for _, _, summary_list in data]

 lowerCAmelCase  							=      [encode_for_summarization(_UpperCAmelCase   ,			_UpperCAmelCase   ,			_UpperCAmelCase       ) for _, story, summary in data]
 lowerCAmelCase  							=      torch.tensor(
     [truncate_or_pad(_UpperCAmelCase   ,			_UpperCAmelCase   ,			tokenizer.pad_token_id       ) for story, _ in encoded_text]       )
 lowerCAmelCase  							=      compute_token_type_ids(_UpperCAmelCase   ,			tokenizer.cls_token_id       )
 lowerCAmelCase  							=      build_mask(_UpperCAmelCase   ,			tokenizer.pad_token_id       )

 lowerCAmelCase  							=      Batch(
     document_names=_UpperCAmelCase   ,			batch_size=len(_UpperCAmelCase       )   ,			src=encoded_stories.to(_UpperCAmelCase       )   ,			segs=encoder_token_type_ids.to(_UpperCAmelCase       )   ,			mask_src=encoder_mask.to(_UpperCAmelCase       )   ,			tgt_str=_UpperCAmelCase   ,			)

 return batch

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  List[str]   ,			_UpperCAmelCase :  List[str]       ):
 lowerCAmelCase  							=      summary_tokens.to('cpu'       ).numpy()
 lowerCAmelCase  							=      tokenizer.decode(_UpperCAmelCase       )
 lowerCAmelCase  							=      summary.split('.'       )
 lowerCAmelCase  							=      [s + '.' for s in sentences]
 return sentences

def 						_SCREAMING_SNAKE_CASE       ():
 lowerCAmelCase  							=      argparse.ArgumentParser()
 parser.add_argument(
     '--documents_dir'   ,			default=_UpperCAmelCase   ,			type=_UpperCAmelCase   ,			required=_UpperCAmelCase   ,			help='The folder where the documents to summarize are located.'   ,			)
 parser.add_argument(
     '--summaries_output_dir'   ,			default=_UpperCAmelCase   ,			type=_UpperCAmelCase   ,			required=_UpperCAmelCase   ,			help='The folder in wich the summaries should be written. Defaults to the folder where the documents are'   ,			)
 parser.add_argument(
     '--compute_rouge'   ,			default=_UpperCAmelCase   ,			type=_UpperCAmelCase   ,			required=_UpperCAmelCase   ,			help='Compute the ROUGE metrics during evaluation. Only available for the CNN/DailyMail dataset.'   ,			)
 # EVALUATION options
 parser.add_argument(
     '--no_cuda'   ,			default=_UpperCAmelCase   ,			type=_UpperCAmelCase   ,			help='Whether to force the execution on CPU.'   ,			)
 parser.add_argument(
     '--batch_size'   ,			default=4   ,			type=_UpperCAmelCase   ,			help='Batch size per GPU/CPU for training.'   ,			)
 # BEAM SEARCH arguments
 parser.add_argument(
     '--min_length'   ,			default=50   ,			type=_UpperCAmelCase   ,			help='Minimum number of tokens for the summaries.'   ,			)
 parser.add_argument(
     '--max_length'   ,			default=200   ,			type=_UpperCAmelCase   ,			help='Maixmum number of tokens for the summaries.'   ,			)
 parser.add_argument(
     '--beam_size'   ,			default=5   ,			type=_UpperCAmelCase   ,			help='The number of beams to start with for each example.'   ,			)
 parser.add_argument(
     '--alpha'   ,			default=0.95   ,			type=_UpperCAmelCase   ,			help='The value of alpha for the length penalty in the beam search.'   ,			)
 parser.add_argument(
     '--block_trigram'   ,			default=_UpperCAmelCase   ,			type=_UpperCAmelCase   ,			help='Whether to block the existence of repeating trigrams in the text generated by beam search.'   ,			)
 lowerCAmelCase  							=      parser.parse_args()

 # Select device (distibuted not available)
 lowerCAmelCase  							=      torch.device('cuda' if torch.cuda.is_available() and not args.no_cuda else 'cpu'       )

 # Check the existence of directories
 if not args.summaries_output_dir:
  lowerCAmelCase  							=      args.documents_dir

 if not documents_dir_is_valid(args.documents_dir       ):
  raise FileNotFoundError(
      'We could not find the directory you specified for the documents to summarize, or it was empty. Please'
      ' specify a valid path.'       )
 os.makedirs(args.summaries_output_dir   ,			exist_ok=_UpperCAmelCase       )

 evaluate(_UpperCAmelCase       )

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  List[Any]       ):
 if not os.path.exists(_UpperCAmelCase       ):
  return False

 lowerCAmelCase  							=      os.listdir(_UpperCAmelCase       )
 if len(_UpperCAmelCase       ) == 0:
  return False

 return True


if __name__ == "__main__":
       main()












"""simple docstring"""
from __future__ import annotations

import unittest

from transformers import MPNetConfig, 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.mpnet.modeling_tf_mpnet import (
           TFMPNetForMaskedLM,
           TFMPNetForMultipleChoice,
           TFMPNetForQuestionAnswering,
           TFMPNetForSequenceClassification,
           TFMPNetForTokenClassification,
           TFMPNetModel,
       )







class 	a				:



 def __init__(			self							,    _snake_case							,    _snake_case=13							,    _snake_case=7							,    _snake_case=True							,    _snake_case=True							,    _snake_case=False							,    _snake_case=True							,    _snake_case=99							,    _snake_case=64							,    _snake_case=2							,    _snake_case=4							,    _snake_case=64							,    _snake_case="gelu"							,    _snake_case=0.1							,    _snake_case=0.1							,    _snake_case=5_12							,    _snake_case=16							,    _snake_case=2							,    _snake_case=0.02							,    _snake_case=3							,    _snake_case=4							,    _snake_case=None							,    ):







  """simple docstring"""






  lowerCAmelCase  							=      parent
  lowerCAmelCase  							=      batch_size
  lowerCAmelCase  							=      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  							=      num_labels
  lowerCAmelCase  							=      num_choices
  lowerCAmelCase  							=      scope



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      ids_tensor([self.batch_size, self.seq_length]							,    self.vocab_size			)

  lowerCAmelCase  							=      None
  if self.use_input_mask:
   lowerCAmelCase  							=      random_attention_mask([self.batch_size, self.seq_length]			)

  lowerCAmelCase  							=      None
  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.seq_length]							,    self.num_labels			)
   lowerCAmelCase  							=      ids_tensor([self.batch_size]							,    self.num_choices			)

  lowerCAmelCase  							=      MPNetConfig(
      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							,    initializer_range=self.initializer_range							,    )
  return config, input_ids, input_mask, sequence_labels, token_labels, choice_labels



 def 					UpperCamelCase__   (			self							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case			):







  """simple docstring"""






  lowerCAmelCase  							=      TFMPNetModel(config=_snake_case			)
  lowerCAmelCase  							=      {'input_ids': input_ids, 'attention_mask': input_mask}
  lowerCAmelCase  							=      model(_snake_case			)
  lowerCAmelCase  							=      [input_ids, input_mask]
  lowerCAmelCase  							=      model(_snake_case			)
  self.parent.assertEqual(result.last_hidden_state.shape							,    (self.batch_size, self.seq_length, self.hidden_size)			)



 def 					UpperCamelCase__   (			self							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case			):







  """simple docstring"""






  lowerCAmelCase  							=      TFMPNetForMaskedLM(config=_snake_case			)
  lowerCAmelCase  							=      {'input_ids': input_ids, 'attention_mask': input_mask}
  lowerCAmelCase  							=      model(_snake_case			)
  self.parent.assertEqual(result.logits.shape							,    (self.batch_size, self.seq_length, self.vocab_size)			)



 def 					UpperCamelCase__   (			self							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case			):







  """simple docstring"""






  lowerCAmelCase  							=      TFMPNetForQuestionAnswering(config=_snake_case			)
  lowerCAmelCase  							=      {
      'input_ids': input_ids,
      'attention_mask': input_mask,
  }
  lowerCAmelCase  							=      model(_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 					UpperCamelCase__   (			self							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case			):







  """simple docstring"""






  lowerCAmelCase  							=      self.num_labels
  lowerCAmelCase  							=      TFMPNetForSequenceClassification(_snake_case			)
  lowerCAmelCase  							=      {'input_ids': input_ids, 'attention_mask': input_mask}
  lowerCAmelCase  							=      model(_snake_case			)
  self.parent.assertEqual(result.logits.shape							,    (self.batch_size, self.num_labels)			)



 def 					UpperCamelCase__   (			self							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case			):







  """simple docstring"""






  lowerCAmelCase  							=      self.num_choices
  lowerCAmelCase  							=      TFMPNetForMultipleChoice(_snake_case			)
  lowerCAmelCase  							=      tf.tile(tf.expand_dims(_snake_case							,    1			)							,    (1, self.num_choices, 1)			)
  lowerCAmelCase  							=      tf.tile(tf.expand_dims(_snake_case							,    1			)							,    (1, self.num_choices, 1)			)
  lowerCAmelCase  							=      {
      'input_ids': multiple_choice_inputs_ids,
      'attention_mask': multiple_choice_input_mask,
  }
  lowerCAmelCase  							=      model(_snake_case			)
  self.parent.assertEqual(result.logits.shape							,    (self.batch_size, self.num_choices)			)



 def 					UpperCamelCase__   (			self							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case							,    _snake_case			):







  """simple docstring"""






  lowerCAmelCase  							=      self.num_labels
  lowerCAmelCase  							=      TFMPNetForTokenClassification(_snake_case			)
  lowerCAmelCase  							=      {'input_ids': input_ids, 'attention_mask': input_mask}
  lowerCAmelCase  							=      model(_snake_case			)
  self.parent.assertEqual(result.logits.shape							,    (self.batch_size, self.seq_length, self.num_labels)			)



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      self.prepare_config_and_inputs()
  ((lowerCAmelCase)							,(lowerCAmelCase)							,(lowerCAmelCase)							,(lowerCAmelCase)							,(lowerCAmelCase)							,(lowerCAmelCase))  							=      config_and_inputs
  lowerCAmelCase  							=      {'input_ids': input_ids, 'attention_mask': input_mask}
  return config, inputs_dict







@require_tf
class 	a				(					a__					,      a__					,      unittest.TestCase   ):
 snake_case__    	=    (
     (
         TFMPNetForMaskedLM,
         TFMPNetForMultipleChoice,
         TFMPNetForQuestionAnswering,
         TFMPNetForSequenceClassification,
         TFMPNetForTokenClassification,
         TFMPNetModel,
     )
     if is_tf_available()
     else ()
 )
 snake_case__    	=    (
     {
         '''feature-extraction''': TFMPNetModel,
         '''fill-mask''': TFMPNetForMaskedLM,
         '''question-answering''': TFMPNetForQuestionAnswering,
         '''text-classification''': TFMPNetForSequenceClassification,
         '''token-classification''': TFMPNetForTokenClassification,
         '''zero-shot''': TFMPNetForSequenceClassification,
     }
     if is_tf_available()
     else {}
 )
 snake_case__    	=    False
 snake_case__    	=    False



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      TFMPNetModelTester(self			)
  lowerCAmelCase  							=      ConfigTester(self							,    config_class=_snake_case							,    hidden_size=37			)



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  self.config_tester.run_common_tests()



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_mpnet_model(*_snake_case			)



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_mpnet_for_masked_lm(*_snake_case			)



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_mpnet_for_question_answering(*_snake_case			)



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_mpnet_for_sequence_classification(*_snake_case			)



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_mpnet_for_multiple_choice(*_snake_case			)



 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_mpnet_for_token_classification(*_snake_case			)



 @slow
 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  for model_name in ["microsoft/mpnet-base"]:
   lowerCAmelCase  							=      TFMPNetModel.from_pretrained(_snake_case			)
   self.assertIsNotNone(_snake_case			)







@require_tf
class 	a				(					unittest.TestCase   ):



 @slow
 def 					UpperCamelCase__   (			self			):







  """simple docstring"""






  lowerCAmelCase  							=      TFMPNetModel.from_pretrained('microsoft/mpnet-base'			)
  lowerCAmelCase  							=      tf.constant([[0, 1, 2, 3, 4, 5]]			)
  lowerCAmelCase  							=      model(_snake_case			)[0]

  lowerCAmelCase  							=      [1, 6, 7_68]
  self.assertEqual(output.shape							,    _snake_case			)

  lowerCAmelCase  							=      tf.constant(
      [
          [
              [-0.1_067_172, 0.08_216_473, 0.0_024_543],
              [-0.03_465_879, 0.8_354_118, -0.03_252_288],
              [-0.06_569_476, -0.12_424_111, -0.0_494_436],
          ]
      ]			)
  tf.debugging.assert_near(output[:, :3, :3]							,    _snake_case							,    atol=1E-4			)





