


'''simple docstring'''



import unittest

from parameterized import parameterized

from transformers import OpenLlamaConfig, is_torch_available, set_seed
from transformers.testing_utils import require_torch, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
      import torch

      from transformers import OpenLlamaForCausalLM, OpenLlamaForSequenceClassification, OpenLlamaModel



class 			a       :


     """simple docstring"""






     def __init__(       self  :	Optional[int]							,				snake_case  :	Tuple							,				snake_case  :	str=13							,				snake_case  :	Tuple=7							,				snake_case  :	Dict=True							,				snake_case  :	List[str]=True							,				snake_case  :	int=False							,				snake_case  :	Dict=True							,				snake_case  :	str=99							,				snake_case  :	List[str]=32							,				snake_case  :	List[str]=5							,				snake_case  :	List[str]=4							,				snake_case  :	List[Any]=37							,				snake_case  :	int="gelu"							,				snake_case  :	Union[str, Any]=0.1							,				snake_case  :	Union[str, Any]=0.1							,				snake_case  :	List[Any]=512							,				snake_case  :	Union[str, Any]=16							,				snake_case  :	Dict=2							,				snake_case  :	Optional[int]=0.02							,				snake_case  :	Any=3							,				snake_case  :	List[Any]=4							,				snake_case  :	Optional[int]=None							,				)		->							int:
          __UpperCAmelCase			:				Dict													=    parent
          __UpperCAmelCase			:				int													=    batch_size
          __UpperCAmelCase			:				int													=    seq_length
          __UpperCAmelCase			:				Optional[int]													=    is_training
          __UpperCAmelCase			:				Dict													=    use_input_mask
          __UpperCAmelCase			:				List[Any]													=    use_token_type_ids
          __UpperCAmelCase			:				str													=    use_labels
          __UpperCAmelCase			:				Optional[int]													=    vocab_size
          __UpperCAmelCase			:				Optional[int]													=    hidden_size
          __UpperCAmelCase			:				Dict													=    num_hidden_layers
          __UpperCAmelCase			:				List[str]													=    num_attention_heads
          __UpperCAmelCase			:				List[str]													=    intermediate_size
          __UpperCAmelCase			:				int													=    hidden_act
          __UpperCAmelCase			:				Dict													=    hidden_dropout_prob
          __UpperCAmelCase			:				str													=    attention_probs_dropout_prob
          __UpperCAmelCase			:				int													=    max_position_embeddings
          __UpperCAmelCase			:				Dict													=    type_vocab_size
          __UpperCAmelCase			:				List[Any]													=    type_sequence_label_size
          __UpperCAmelCase			:				int													=    initializer_range
          __UpperCAmelCase			:				Dict													=    num_labels
          __UpperCAmelCase			:				Tuple													=    num_choices
          __UpperCAmelCase			:				List[Any]													=    scope

     def 				lowerCamelCase__				(       self  :	str    )		->							int:
          __UpperCAmelCase			:				Tuple													=    ids_tensor([self.batch_size, self.seq_length]							,				self.vocab_size    )

          __UpperCAmelCase			:				Union[str, Any]													=    None
          if self.use_input_mask:
               __UpperCAmelCase			:				str													=    random_attention_mask([self.batch_size, self.seq_length]    )

          __UpperCAmelCase			:				Optional[int]													=    None
          if self.use_token_type_ids:
               __UpperCAmelCase			:				str													=    ids_tensor([self.batch_size, self.seq_length]							,				self.type_vocab_size    )

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

          __UpperCAmelCase			:				List[str]													=    self.get_config()

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

     def 				lowerCamelCase__				(       self  :	Optional[int]    )		->							Union[str, Any]:
          return OpenLlamaConfig(
              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							,				is_decoder=snake_case							,				initializer_range=self.initializer_range							,				use_stable_embedding=snake_case							,				)

     def 				lowerCamelCase__				(       self  :	Tuple							,				snake_case  :	Optional[Any]							,				snake_case  :	str							,				snake_case  :	Union[str, Any]							,				snake_case  :	Any							,				snake_case  :	int							,				snake_case  :	Optional[Any]							,				snake_case  :	Tuple    )		->							int:
          __UpperCAmelCase			:				Optional[int]													=    OpenLlamaModel(config=snake_case    )
          model.to(snake_case    )
          model.eval()
          __UpperCAmelCase			:				Any													=    model(snake_case							,				attention_mask=snake_case    )
          __UpperCAmelCase			:				Dict													=    model(snake_case    )
          self.parent.assertEqual(result.last_hidden_state.shape							,				(self.batch_size, self.seq_length, self.hidden_size)    )

     def 				lowerCamelCase__				(       self  :	Optional[Any]							,				snake_case  :	Dict							,				snake_case  :	List[Any]							,				snake_case  :	Optional[int]							,				snake_case  :	Dict							,				snake_case  :	List[Any]							,				snake_case  :	Optional[Any]							,				snake_case  :	List[str]							,				snake_case  :	Optional[Any]							,				snake_case  :	Dict							,				)		->							Any:
          __UpperCAmelCase			:				List[str]													=    True
          __UpperCAmelCase			:				List[str]													=    OpenLlamaModel(snake_case    )
          model.to(snake_case    )
          model.eval()
          __UpperCAmelCase			:				Optional[Any]													=    model(
              snake_case							,				attention_mask=snake_case							,				encoder_hidden_states=snake_case							,				encoder_attention_mask=snake_case							,				)
          __UpperCAmelCase			:				Tuple													=    model(
              snake_case							,				attention_mask=snake_case							,				encoder_hidden_states=snake_case							,				)
          __UpperCAmelCase			:				Optional[Any]													=    model(snake_case							,				attention_mask=snake_case    )
          self.parent.assertEqual(result.last_hidden_state.shape							,				(self.batch_size, self.seq_length, self.hidden_size)    )

     def 				lowerCamelCase__				(       self  :	Optional[int]							,				snake_case  :	Optional[int]							,				snake_case  :	List[Any]							,				snake_case  :	Any							,				snake_case  :	Union[str, Any]							,				snake_case  :	Tuple							,				snake_case  :	Optional[Any]							,				snake_case  :	int							,				snake_case  :	str							,				snake_case  :	str							,				)		->							Tuple:
          __UpperCAmelCase			:				str													=    OpenLlamaForCausalLM(config=snake_case    )
          model.to(snake_case    )
          model.eval()
          __UpperCAmelCase			:				Optional[Any]													=    model(snake_case							,				attention_mask=snake_case							,				labels=snake_case    )
          self.parent.assertEqual(result.logits.shape							,				(self.batch_size, self.seq_length, self.vocab_size)    )

     def 				lowerCamelCase__				(       self  :	Optional[Any]							,				snake_case  :	List[str]							,				snake_case  :	int							,				snake_case  :	List[Any]							,				snake_case  :	Tuple							,				snake_case  :	Union[str, Any]							,				snake_case  :	List[Any]							,				snake_case  :	Any							,				snake_case  :	str							,				snake_case  :	Optional[int]							,				)		->							Optional[Any]:
          __UpperCAmelCase			:				int													=    True
          __UpperCAmelCase			:				Any													=    True
          __UpperCAmelCase			:				Union[str, Any]													=    OpenLlamaForCausalLM(config=snake_case    )
          model.to(snake_case    )
          model.eval()

          # first forward pass
          __UpperCAmelCase			:				str													=    model(
              snake_case							,				attention_mask=snake_case							,				encoder_hidden_states=snake_case							,				encoder_attention_mask=snake_case							,				use_cache=snake_case							,				)
          __UpperCAmelCase			:				Optional[int]													=    outputs.past_key_values

          # create hypothetical multiple next token and extent to next_input_ids
          __UpperCAmelCase			:				Dict													=    ids_tensor((self.batch_size, 3)							,				config.vocab_size    )
          __UpperCAmelCase			:				Optional[int]													=    ids_tensor((self.batch_size, 3)							,				vocab_size=2    )

          # append to next input_ids and
          __UpperCAmelCase			:				str													=    torch.cat([input_ids, next_tokens]							,				dim=-1    )
          __UpperCAmelCase			:				List[str]													=    torch.cat([input_mask, next_mask]							,				dim=-1    )

          __UpperCAmelCase			:				int													=    model(
              snake_case							,				attention_mask=snake_case							,				encoder_hidden_states=snake_case							,				encoder_attention_mask=snake_case							,				output_hidden_states=snake_case							,				)['''hidden_states'''][0]
          __UpperCAmelCase			:				Any													=    model(
              snake_case							,				attention_mask=snake_case							,				encoder_hidden_states=snake_case							,				encoder_attention_mask=snake_case							,				past_key_values=snake_case							,				output_hidden_states=snake_case							,				)['''hidden_states'''][0]

          # select random slice
          __UpperCAmelCase			:				Any													=    ids_tensor((1,)							,				output_from_past.shape[-1]    ).item()
          __UpperCAmelCase			:				Dict													=    output_from_no_past[:, -3:, random_slice_idx].detach()
          __UpperCAmelCase			:				Union[str, Any]													=    output_from_past[:, :, random_slice_idx].detach()

          self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1]    )

          # test that outputs are equal for slice
          self.parent.assertTrue(torch.allclose(snake_case							,				snake_case							,				atol=1E-3    )    )






     def 				lowerCamelCase__				(       self  :	int    )		->							Optional[int]:
          __UpperCAmelCase			:				List[Any]													=    self.prepare_config_and_inputs()
          (
              (
              __UpperCAmelCase
          )							,     (
              __UpperCAmelCase
          )							,     (
              __UpperCAmelCase
          )							,     (
              __UpperCAmelCase
          )							,     (
              __UpperCAmelCase
          )							,     (
              __UpperCAmelCase
          )							,     (
              __UpperCAmelCase
          )							,     
          )			:				Union[str, Any]													=    config_and_inputs
          __UpperCAmelCase			:				Union[str, Any]													=    {'''input_ids''': input_ids, '''attention_mask''': input_mask}
          return config, inputs_dict



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


     """simple docstring"""






     SCREAMING_SNAKE_CASE :				Dict							     =     (
         (OpenLlamaModel, OpenLlamaForCausalLM, OpenLlamaForSequenceClassification) if is_torch_available() else ()
     )
     SCREAMING_SNAKE_CASE :				List[Any]							     =     (OpenLlamaForCausalLM,) if is_torch_available() else ()
     SCREAMING_SNAKE_CASE :				Dict							     =     (
         {
             "feature-extraction": OpenLlamaModel,
             "text-classification": OpenLlamaForSequenceClassification,
             "text-generation": OpenLlamaForCausalLM,
             "zero-shot": OpenLlamaForSequenceClassification,
         }
         if is_torch_available()
         else {}
     )
     SCREAMING_SNAKE_CASE :				Tuple							     =     False
     SCREAMING_SNAKE_CASE :				Optional[Any]							     =     False

     def 				lowerCamelCase__				(       self  :	Dict    )		->							Optional[int]:
          __UpperCAmelCase			:				Tuple													=    OpenLlamaModelTester(self    )
          __UpperCAmelCase			:				str													=    ConfigTester(self							,				config_class=snake_case							,				hidden_size=37    )

     def 				lowerCamelCase__				(       self  :	Dict    )		->							Tuple:
          self.config_tester.run_common_tests()

     def 				lowerCamelCase__				(       self  :	List[Any]    )		->							Dict:
          __UpperCAmelCase			:				List[str]													=    self.model_tester.prepare_config_and_inputs()
          self.model_tester.create_and_check_model(*snake_case    )

     def 				lowerCamelCase__				(       self  :	Union[str, Any]    )		->							Any:
          __UpperCAmelCase			:				int													=    self.model_tester.prepare_config_and_inputs()
          for type in ["absolute", "relative_key", "relative_key_query"]:
               __UpperCAmelCase			:				Tuple													=    type
               self.model_tester.create_and_check_model(*snake_case    )

     def 				lowerCamelCase__				(       self  :	Tuple    )		->							str:
          __UpperCAmelCase							,     __UpperCAmelCase			:				int													=    self.model_tester.prepare_config_and_inputs_for_common()
          __UpperCAmelCase			:				List[str]													=    3
          __UpperCAmelCase			:				Optional[Any]													=    input_dict['''input_ids''']
          __UpperCAmelCase			:				int													=    input_ids.ne(1    ).to(snake_case    )
          __UpperCAmelCase			:				Optional[int]													=    ids_tensor([self.model_tester.batch_size]							,				self.model_tester.type_sequence_label_size    )
          __UpperCAmelCase			:				Optional[int]													=    OpenLlamaForSequenceClassification(snake_case    )
          model.to(snake_case    )
          model.eval()
          __UpperCAmelCase			:				Optional[int]													=    model(snake_case							,				attention_mask=snake_case							,				labels=snake_case    )
          self.assertEqual(result.logits.shape							,				(self.model_tester.batch_size, self.model_tester.num_labels)    )

     def 				lowerCamelCase__				(       self  :	Dict    )		->							Optional[Any]:
          __UpperCAmelCase							,     __UpperCAmelCase			:				Union[str, Any]													=    self.model_tester.prepare_config_and_inputs_for_common()
          __UpperCAmelCase			:				Tuple													=    3
          __UpperCAmelCase			:				Union[str, Any]													=    '''single_label_classification'''
          __UpperCAmelCase			:				Optional[Any]													=    input_dict['''input_ids''']
          __UpperCAmelCase			:				Union[str, Any]													=    input_ids.ne(1    ).to(snake_case    )
          __UpperCAmelCase			:				Optional[Any]													=    ids_tensor([self.model_tester.batch_size]							,				self.model_tester.type_sequence_label_size    )
          __UpperCAmelCase			:				Optional[int]													=    OpenLlamaForSequenceClassification(snake_case    )
          model.to(snake_case    )
          model.eval()
          __UpperCAmelCase			:				Dict													=    model(snake_case							,				attention_mask=snake_case							,				labels=snake_case    )
          self.assertEqual(result.logits.shape							,				(self.model_tester.batch_size, self.model_tester.num_labels)    )

     def 				lowerCamelCase__				(       self  :	Any    )		->							int:
          __UpperCAmelCase							,     __UpperCAmelCase			:				Any													=    self.model_tester.prepare_config_and_inputs_for_common()
          __UpperCAmelCase			:				Any													=    3
          __UpperCAmelCase			:				str													=    '''multi_label_classification'''
          __UpperCAmelCase			:				str													=    input_dict['''input_ids''']
          __UpperCAmelCase			:				Optional[Any]													=    input_ids.ne(1    ).to(snake_case    )
          __UpperCAmelCase			:				List[str]													=    ids_tensor(
              [self.model_tester.batch_size, config.num_labels]							,				self.model_tester.type_sequence_label_size    ).to(torch.float    )
          __UpperCAmelCase			:				List[Any]													=    OpenLlamaForSequenceClassification(snake_case    )
          model.to(snake_case    )
          model.eval()
          __UpperCAmelCase			:				int													=    model(snake_case							,				attention_mask=snake_case							,				labels=snake_case    )
          self.assertEqual(result.logits.shape							,				(self.model_tester.batch_size, self.model_tester.num_labels)    )

     @unittest.skip('''Open-Llama buffers include complex numbers, which breaks this test'''    )
     def 				lowerCamelCase__				(       self  :	Union[str, Any]    )		->							Union[str, Any]:
          pass






     @parameterized.expand([('''linear''',), ('''dynamic''',)]    )
     def 				lowerCamelCase__				(       self  :	Any							,				snake_case  :	Any    )		->							List[str]:
          __UpperCAmelCase							,     __UpperCAmelCase			:				Optional[Any]													=    self.model_tester.prepare_config_and_inputs_for_common()
          __UpperCAmelCase			:				List[str]													=    ids_tensor([1, 10]							,				config.vocab_size    )
          __UpperCAmelCase			:				Any													=    ids_tensor([1, int(config.max_position_embeddings * 1.5    )]							,				config.vocab_size    )

          set_seed(42    )  # Fixed seed at init time so the two models get the same random weights
          __UpperCAmelCase			:				List[str]													=    OpenLlamaModel(snake_case    )
          original_model.to(snake_case    )
          original_model.eval()
          __UpperCAmelCase			:				List[str]													=    original_model(snake_case    ).last_hidden_state
          __UpperCAmelCase			:				str													=    original_model(snake_case    ).last_hidden_state

          set_seed(42    )  # Fixed seed at init time so the two models get the same random weights
          __UpperCAmelCase			:				Dict													=    {'''type''': scaling_type, '''factor''': 10.0}
          __UpperCAmelCase			:				List[Any]													=    OpenLlamaModel(snake_case    )
          scaled_model.to(snake_case    )
          scaled_model.eval()
          __UpperCAmelCase			:				List[str]													=    scaled_model(snake_case    ).last_hidden_state
          __UpperCAmelCase			:				Optional[Any]													=    scaled_model(snake_case    ).last_hidden_state

          # Dynamic scaling does not change the RoPE embeddings until it receives an input longer than the original
          # maximum sequence length, so the outputs for the short input should match.
          if scaling_type == "dynamic":
               self.assertTrue(torch.allclose(snake_case							,				snake_case							,				atol=1E-5    )    )
          else:
               self.assertFalse(torch.allclose(snake_case							,				snake_case							,				atol=1E-5    )    )

          # The output should be different for long inputs
          self.assertFalse(torch.allclose(snake_case							,				snake_case							,				atol=1E-5    )    )



'''simple docstring'''



import unittest
from pathlib import Path
from tempfile import TemporaryDirectory

from transformers import AutoConfig, TFAutoModel, is_tensorflow_text_available, is_tf_available
from transformers.models.bert.tokenization_bert import BertTokenizer
from transformers.testing_utils import require_tensorflow_text, require_tf, slow


if is_tf_available():
      import tensorflow as tf

if is_tensorflow_text_available():
      from transformers.models.bert import TFBertTokenizer


__UpperCAmelCase    :Optional[int]				       =     ["bert-base-uncased", "bert-base-cased"]
__UpperCAmelCase    :str				       =     "hf-internal-testing/tiny-bert-tf-only"

if is_tf_available():



      class 			a       (	tf.keras.Model ):


           """simple docstring"""






           def __init__(       self  :	List[str]							,				snake_case  :	List[str]    )		->							str:
                super().__init__()
                __UpperCAmelCase			:				List[str]													=    tokenizer
                __UpperCAmelCase			:				List[Any]													=    AutoConfig.from_pretrained(snake_case    )
                __UpperCAmelCase			:				int													=    TFAutoModel.from_config(snake_case    )






           def 				lowerCamelCase__				(       self  :	List[Any]							,				snake_case  :	Optional[int]    )		->							Optional[Any]:
                __UpperCAmelCase			:				List[Any]													=    self.tokenizer(snake_case    )
                __UpperCAmelCase			:				Optional[Any]													=    self.bert(**snake_case    )
                return out["pooler_output"]



@require_tf
@require_tensorflow_text
class 			a       (	unittest.TestCase ):


     """simple docstring"""






     def 				lowerCamelCase__				(       self  :	Optional[int]    )		->							List[str]:
          super().setUp()

          __UpperCAmelCase			:				Tuple													=    [
              BertTokenizer.from_pretrained(snake_case    ) for checkpoint in (TOKENIZER_CHECKPOINTS * 2)
          ]  # repeat for when fast_bert_tokenizer=false
          __UpperCAmelCase			:				Any													=    [TFBertTokenizer.from_pretrained(snake_case    ) for checkpoint in TOKENIZER_CHECKPOINTS] + [
              TFBertTokenizer.from_pretrained(snake_case							,				use_fast_bert_tokenizer=snake_case    )
              for checkpoint in TOKENIZER_CHECKPOINTS
          ]
          assert len(self.tokenizers    ) == len(self.tf_tokenizers    )

          __UpperCAmelCase			:				Optional[int]													=    [
              '''This is a straightforward English test sentence.''',
              '''This one has some weird characters\rto\nsee\r\nif  those\u00E9break things.''',
              '''Now we\'re going to add some Chinese: 一 二 三 一二三''',
              '''And some much more rare Chinese: 齉 堃 齉堃''',
              '''Je vais aussi écrire en français pour tester les accents''',
              '''Classical Irish also has some unusual characters, so in they go: Gaelaċ, ꝼ''',
          ]
          __UpperCAmelCase			:				Optional[int]													=    list(zip(self.test_sentences							,				self.test_sentences[::-1]    )    )

     def 				lowerCamelCase__				(       self  :	Optional[int]    )		->							Optional[Any]:
          for tokenizer, tf_tokenizer in zip(self.tokenizers							,				self.tf_tokenizers    ):
               for test_inputs in (self.test_sentences, self.paired_sentences):
                    __UpperCAmelCase			:				Any													=    tokenizer(snake_case							,				return_tensors='''tf'''							,				padding='''longest'''    )
                    __UpperCAmelCase			:				Optional[int]													=    tf_tokenizer(snake_case    )

                    for key in python_outputs.keys():
                         self.assertTrue(tf.reduce_all(python_outputs[key].shape == tf_outputs[key].shape    )    )
                         self.assertTrue(tf.reduce_all(tf.cast(python_outputs[key]							,				tf.intaa    ) == tf_outputs[key]    )    )

     @slow
     def 				lowerCamelCase__				(       self  :	List[Any]    )		->							str:
          for tf_tokenizer in self.tf_tokenizers:
               __UpperCAmelCase			:				Any													=    tf_tokenizer(self.paired_sentences    )
               __UpperCAmelCase			:				Union[str, Any]													=    tf_tokenizer(
                   text=[sentence[0] for sentence in self.paired_sentences]							,				text_pair=[sentence[1] for sentence in self.paired_sentences]							,				)
               for key in merged_outputs.keys():
                    self.assertTrue(tf.reduce_all(tf.cast(merged_outputs[key]							,				tf.intaa    ) == separated_outputs[key]    )    )

     @slow
     def 				lowerCamelCase__				(       self  :	str    )		->							Union[str, Any]:
          for tf_tokenizer in self.tf_tokenizers:
               __UpperCAmelCase			:				Optional[int]													=    tf.function(snake_case    )
               for test_inputs in (self.test_sentences, self.paired_sentences):
                    __UpperCAmelCase			:				int													=    tf.constant(snake_case    )
                    __UpperCAmelCase			:				Tuple													=    compiled_tokenizer(snake_case    )
                    __UpperCAmelCase			:				Optional[int]													=    tf_tokenizer(snake_case    )

                    for key in eager_outputs.keys():
                         self.assertTrue(tf.reduce_all(eager_outputs[key] == compiled_outputs[key]    )    )






     @slow
     def 				lowerCamelCase__				(       self  :	str    )		->							str:
          for tf_tokenizer in self.tf_tokenizers:
               __UpperCAmelCase			:				List[Any]													=    ModelToSave(tokenizer=snake_case    )
               __UpperCAmelCase			:				Union[str, Any]													=    tf.convert_to_tensor(self.test_sentences    )
               __UpperCAmelCase			:				Tuple													=    model(snake_case    )  # Build model with some sample inputs
               with TemporaryDirectory() as tempdir:
                    __UpperCAmelCase			:				Any													=    Path(snake_case    ) / '''saved.model'''
                    model.save(snake_case    )
                    __UpperCAmelCase			:				str													=    tf.keras.models.load_model(snake_case    )
               __UpperCAmelCase			:				Optional[int]													=    loaded_model(snake_case    )
               # We may see small differences because the loaded model is compiled, so we need an epsilon for the test
               self.assertLessEqual(tf.reduce_max(tf.abs(out - loaded_output    )    )							,				1E-5    )