


"""simple docstring"""




import collections
import json
import math
import os
import re
import time
from fnmatch import fnmatch
from typing import Dict

import requests
from slack_sdk import WebClient


__UpperCamelCase						=      WebClient(token=os.environ['''CI_SLACK_BOT_TOKEN'''])


def     lowercase			(SCREAMING_SNAKE_CASE_		:				int  )   ->						Optional[int]:
						SCREAMING_SNAKE_CASE													=					test_results.split(' '  )

						SCREAMING_SNAKE_CASE													=					0
						SCREAMING_SNAKE_CASE													=					0

						# When the output is short enough, the output is surrounded by = signs: "== OUTPUT =="
						# When it is too long, those signs are not present.
						SCREAMING_SNAKE_CASE													=					expressions[-2] if '=' in expressions[-1] else expressions[-1]

						for i, expression in enumerate(SCREAMING_SNAKE_CASE_  ):
												if "failed" in expression:
																		failed += int(expressions[i - 1]  )
												if "passed" in expression:
																		success += int(expressions[i - 1]  )

						return failed, success, time_spent


def     lowercase			(SCREAMING_SNAKE_CASE_		:				Dict  )   ->						List[Any]:
						SCREAMING_SNAKE_CASE													=					{}
						SCREAMING_SNAKE_CASE													=					None
						SCREAMING_SNAKE_CASE													=					False
						for line in failures_short_lines.split('\n'  ):
												if re.search(R'_ \[doctest\]' ,			SCREAMING_SNAKE_CASE_  ):
																		SCREAMING_SNAKE_CASE													=					True
																		SCREAMING_SNAKE_CASE													=					line.split(' '  )[2]
												elif in_error and not line.split(' '  )[0].isdigit():
																		SCREAMING_SNAKE_CASE													=					line
																		SCREAMING_SNAKE_CASE													=					False

						return failures
class 					lowerCAmelCase	:




		'''simple docstring'''







		def __init__(	self						,       lowerCAmelCase__						,       lowerCAmelCase__				)     ->							List[str]:
								SCREAMING_SNAKE_CASE													=					title

								SCREAMING_SNAKE_CASE													=					doc_test_results['time_spent'].split(','				)[0]
								SCREAMING_SNAKE_CASE													=					doc_test_results['success']
								SCREAMING_SNAKE_CASE													=					doc_test_results['failures']
								SCREAMING_SNAKE_CASE													=					self.n_success + self.n_failures

								# Failures and success of the modeling tests
								SCREAMING_SNAKE_CASE													=					doc_test_results







		@property
		def 							__A						(	self				)     ->							str:
								SCREAMING_SNAKE_CASE													=					[self._time_spent]
								SCREAMING_SNAKE_CASE													=					0

								for time in time_spent:
														SCREAMING_SNAKE_CASE													=					time.split(':'				)

														# Time can be formatted as xx:xx:xx, as .xx, or as x.xx if the time spent was less than a minute.
														if len(lowerCAmelCase__				) == 1:
																				SCREAMING_SNAKE_CASE													=					[0, 0, time_parts[0]]

														SCREAMING_SNAKE_CASE							,				SCREAMING_SNAKE_CASE							,				SCREAMING_SNAKE_CASE													=					int(time_parts[0]				), int(time_parts[1]				), float(time_parts[2]				)
														total_secs += hours * 3_600 + minutes * 60 + seconds

								SCREAMING_SNAKE_CASE							,				SCREAMING_SNAKE_CASE							,				SCREAMING_SNAKE_CASE													=					total_secs // 3_600, (total_secs % 3_600) // 60, total_secs % 60
								return F'{int(lowerCAmelCase__				)}h{int(lowerCAmelCase__				)}m{int(lowerCAmelCase__				)}s'







		@property
		def 							__A						(	self				)     ->							Dict:
								return {"type": "header", "text": {"type": "plain_text", "text": self.title}}







		@property
		def 							__A						(	self				)     ->							Dict:
								return {
								    "type": "section",
								    "text": {
								        "type": "plain_text",
								        "text": F'🌞 There were no failures: all {self.n_tests} tests passed. The suite ran in {self.time}.',
								        "emoji": True,
								    },
								    "accessory": {
								        "type": "button",
								        "text": {"type": "plain_text", "text": "Check Action results", "emoji": True},
								        "url": F'https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}',
								    },
								}







		@property
		def 							__A						(	self				)     ->							Dict:
								return {
								    "type": "section",
								    "text": {
								        "type": "plain_text",
								        "text": (
								            F'There were {self.n_failures} failures, out of {self.n_tests} tests.\nThe suite ran in'
								            F' {self.time}.'
								        ),
								        "emoji": True,
								    },
								    "accessory": {
								        "type": "button",
								        "text": {"type": "plain_text", "text": "Check Action results", "emoji": True},
								        "url": F'https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}',
								    },
								}







		@property
		def 							__A						(	self				)     ->							Dict:
								SCREAMING_SNAKE_CASE													=					40
								SCREAMING_SNAKE_CASE													=					{k: v['failed'] for k, v in doc_test_results.items() if isinstance(lowerCAmelCase__						,       lowerCAmelCase__				)}

								SCREAMING_SNAKE_CASE													=					''
								for category, failures in category_failures.items():
														if len(lowerCAmelCase__				) == 0:
																				continue

														if report != "":
																				report += "\n\n"

														report += F'*{category} failures*:'.ljust(line_length // 2				).rjust(line_length // 2				) + "\n"
														report += "`"
														report += "`\n`".join(lowerCAmelCase__				)
														report += "`"

								return {
								    "type": "section",
								    "text": {
								        "type": "mrkdwn",
								        "text": F'The following examples had failures:\n\n\n{report}\n',
								    },
								}







		@property
		def 							__A						(	self				)     ->							str:
								SCREAMING_SNAKE_CASE													=					[self.header]

								if self.n_failures > 0:
														blocks.append(self.failures				)

								if self.n_failures > 0:
														blocks.extend([self.category_failures]				)

								if self.n_failures == 0:
														blocks.append(self.no_failures				)

								return json.dumps(lowerCAmelCase__				)







		@staticmethod
		def 							__A						(	)     ->							int:
								SCREAMING_SNAKE_CASE													=					[
								    {
								        'type': 'section',
								        'text': {
								            'type': 'plain_text',
								            'text': 'There was an issue running the tests.',
								        },
								        'accessory': {
								            'type': 'button',
								            'text': {'type': 'plain_text', 'text': 'Check Action results', 'emoji': True},
								            'url': F'https://github.com/huggingface/transformers/actions/runs/{os.environ["GITHUB_RUN_ID"]}',
								        },
								    }
								]

								print('Sending the following payload'				)
								print(json.dumps({'blocks': json.loads(lowerCAmelCase__				)}				)				)

								client.chat_postMessage(
								    channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']						,       text='There was an issue running the tests.'						,       blocks=lowerCAmelCase__						,       )







		def 							__A						(	self				)     ->							Union[str, Any]:
								print('Sending the following payload'				)
								print(json.dumps({'blocks': json.loads(self.payload				)}				)				)

								SCREAMING_SNAKE_CASE													=					F'{self.n_failures} failures out of {self.n_tests} tests,' if self.n_failures else 'All tests passed.'

								SCREAMING_SNAKE_CASE													=					client.chat_postMessage(
								    channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']						,       blocks=self.payload						,       text=lowerCAmelCase__						,       )







		def 							__A						(	self						,       lowerCAmelCase__						,       lowerCAmelCase__						,       lowerCAmelCase__						,       lowerCAmelCase__				)     ->							int:
								SCREAMING_SNAKE_CASE													=					''
								for key, value in failures.items():
														SCREAMING_SNAKE_CASE													=					value[:200] + ' [Truncated]' if len(lowerCAmelCase__				) > 250 else value
														failures_text += F'*{key}*\n_{value}_\n\n'

								SCREAMING_SNAKE_CASE													=					job_name
								SCREAMING_SNAKE_CASE													=					{'type': 'section', 'text': {'type': 'mrkdwn', 'text': text}}

								if job_link is not None:
														SCREAMING_SNAKE_CASE													=					{
														    'type': 'button',
														    'text': {'type': 'plain_text', 'text': 'GitHub Action job', 'emoji': True},
														    'url': job_link,
														}

								return [
								    {"type": "header", "text": {"type": "plain_text", "text": title.upper(), "emoji": True}},
								    content,
								    {"type": "section", "text": {"type": "mrkdwn", "text": failures_text}},
								]







		def 							__A						(	self				)     ->							List[str]:
								if self.thread_ts is None:
														raise ValueError('Can only post reply if a post has been made.'				)

								SCREAMING_SNAKE_CASE													=					self.doc_test_results.pop('job_link'				)
								self.doc_test_results.pop('failures'				)
								self.doc_test_results.pop('success'				)
								self.doc_test_results.pop('time_spent'				)

								SCREAMING_SNAKE_CASE													=					sorted(self.doc_test_results.items()						,       key=lambda lowerCAmelCase__				: t[0]				)
								for job, job_result in sorted_dict:
														if len(job_result['failures']				):
																				SCREAMING_SNAKE_CASE													=					F'*Num failures* :{len(job_result["failed"]				)} \n'
																				SCREAMING_SNAKE_CASE													=					job_result['failures']
																				SCREAMING_SNAKE_CASE													=					self.get_reply_blocks(lowerCAmelCase__						,       lowerCAmelCase__						,       lowerCAmelCase__						,       text=lowerCAmelCase__				)

																				print('Sending the following reply'				)
																				print(json.dumps({'blocks': blocks}				)				)

																				client.chat_postMessage(
																				    channel=os.environ['CI_SLACK_CHANNEL_ID_DAILY']						,       text=F'Results for {job}'						,       blocks=lowerCAmelCase__						,       thread_ts=self.thread_ts['ts']						,       )

																				time.sleep(1				)





def     lowercase			()   ->						Optional[int]:
						SCREAMING_SNAKE_CASE													=					os.environ['GITHUB_RUN_ID']
						SCREAMING_SNAKE_CASE													=					F'https://api.github.com/repos/huggingface/transformers/actions/runs/{run_id}/jobs?per_page=100'
						SCREAMING_SNAKE_CASE													=					requests.get(SCREAMING_SNAKE_CASE_  ).json()
						SCREAMING_SNAKE_CASE													=					{}

						try:
												jobs.update({job['name']: job['html_url'] for job in result['jobs']}  )
												SCREAMING_SNAKE_CASE													=					math.ceil((result['total_count'] - 1_00) / 1_00  )

												for i in range(SCREAMING_SNAKE_CASE_  ):
																		SCREAMING_SNAKE_CASE													=					requests.get(url + F'&page={i + 2}'  ).json()
																		jobs.update({job['name']: job['html_url'] for job in result['jobs']}  )

												return jobs
						except Exception as e:
												print('Unknown error, could not fetch links.' ,			SCREAMING_SNAKE_CASE_  )

						return {}


def     lowercase			(SCREAMING_SNAKE_CASE_		:				str  )   ->						Any:
						SCREAMING_SNAKE_CASE													=					{}

						if os.path.exists(SCREAMING_SNAKE_CASE_  ):
												SCREAMING_SNAKE_CASE													=					os.listdir(SCREAMING_SNAKE_CASE_  )
												for file in files:
																		try:
																								with open(os.path.join(SCREAMING_SNAKE_CASE_ ,			SCREAMING_SNAKE_CASE_  ) ,			encoding='utf-8'  ) as f:
																														SCREAMING_SNAKE_CASE													=					f.read()
																		except UnicodeDecodeError as e:
																								raise ValueError(F'Could not open {os.path.join(SCREAMING_SNAKE_CASE_ ,			SCREAMING_SNAKE_CASE_  )}.'  ) from e

						return _artifact


def     lowercase			()   ->						str:
						class 					lowerCAmelCase	:




								'''simple docstring'''







								def __init__(	self						,       lowerCAmelCase__				)     ->							Optional[int]:
														SCREAMING_SNAKE_CASE													=					name
														SCREAMING_SNAKE_CASE													=					[]







								def __str__(	self				)     ->							Union[str, Any]:
														return self.name







								def 							__A						(	self						,       lowerCAmelCase__				)     ->							Optional[Any]:
														self.paths.append({'name': self.name, 'path': path}				)





						SCREAMING_SNAKE_CASE													=					{}

						SCREAMING_SNAKE_CASE													=					filter(os.path.isdir ,			os.listdir()  )
						for directory in directories:
												SCREAMING_SNAKE_CASE													=					directory
												if artifact_name not in _available_artifacts:
																		SCREAMING_SNAKE_CASE													=					Artifact(SCREAMING_SNAKE_CASE_  )

																		_available_artifacts[artifact_name].add_path(SCREAMING_SNAKE_CASE_  )

						return _available_artifacts


if __name__ == "__main__":
	__UpperCamelCase						=      get_job_links()
	__UpperCamelCase						=      retrieve_available_artifacts()

	__UpperCamelCase						=      collections.OrderedDict(
	    [
	        ('''*.py''', '''API Examples'''),
	        ('''*.md''', '''MD Examples'''),
	    ]
	)

	# This dict will contain all the information relative to each doc test category:
	# - failed: list of failed tests
	# - failures: dict in the format 'test': 'error_message'
	__UpperCamelCase						=      {
	    v: {
	        '''failed''': [],
	        '''failures''': {},
	    }
	    for v in docs.values()
	}

	# Link to the GitHub Action job
	__UpperCamelCase						=      github_actions_job_links.get('''run_doctests''')

	__UpperCamelCase						=      available_artifacts['''doc_tests_gpu_test_reports'''].paths[0]
	__UpperCamelCase						=      retrieve_artifact(artifact_path['''name'''])
	if "stats" in artifact:
		__UpperCamelCase,__UpperCamelCase,__UpperCamelCase						=      handle_test_results(artifact['''stats'''])
		__UpperCamelCase						=      failed
		__UpperCamelCase						=      success
		__UpperCamelCase						=      time_spent[1:-1] + ''', '''

		__UpperCamelCase						=      extract_first_line_failure(artifact['''failures_short'''])
		for line in artifact["summary_short"].split('''\n'''):
			if re.search('''FAILED''', line):
				__UpperCamelCase						=      line.replace('''FAILED ''', '''''')
				__UpperCamelCase						=      line.split()[0].replace('''\n''', '''''')

				if "::" in line:
					__UpperCamelCase,__UpperCamelCase						=      line.split('''::''')
				else:
					__UpperCamelCase,__UpperCamelCase						=      line, line

				for file_regex in docs.keys():
					if fnmatch(file_path, file_regex):
						__UpperCamelCase						=      docs[file_regex]
						doc_test_results[category]["failed"].append(test)

						__UpperCamelCase						=      all_failures[test] if test in all_failures else '''N/A'''
						__UpperCamelCase						=      failure
						break

	__UpperCamelCase						=      Message('''🤗 Results of the doc tests.''', doc_test_results)
	message.post()
	message.post_reply()









"""simple docstring"""





import tempfile

import numpy as np
import torch
from transformers import AutoTokenizer, TaEncoderModel

from diffusers import DDPMScheduler, UNetaDConditionModel
from diffusers.models.attention_processor import AttnAddedKVProcessor
from diffusers.pipelines.deepfloyd_if import IFWatermarker
from diffusers.utils.testing_utils import torch_device

from ..test_pipelines_common import to_np

class 		lowercase					:





      def     _snake_case			(       self )		->     List[Any]:
            torch.manual_seed(0 )
            lowerCAmelCase  						=       TaEncoderModel.from_pretrained("""hf-internal-testing/tiny-random-t5""" )

            torch.manual_seed(0 )
            lowerCAmelCase  						=       AutoTokenizer.from_pretrained("""hf-internal-testing/tiny-random-t5""" )

            torch.manual_seed(0 )
            lowerCAmelCase  						=       UNetaDConditionModel(
                sample_size=32      ,						layers_per_block=1      ,						block_out_channels=[32, 64]      ,						down_block_types=[
                    """ResnetDownsampleBlock2D""",
                    """SimpleCrossAttnDownBlock2D""",
                ]      ,						mid_block_type="""UNetMidBlock2DSimpleCrossAttn"""      ,						up_block_types=["""SimpleCrossAttnUpBlock2D""", """ResnetUpsampleBlock2D"""]      ,						in_channels=3      ,						out_channels=6      ,						cross_attention_dim=32      ,						encoder_hid_dim=32      ,						attention_head_dim=8      ,						addition_embed_type="""text"""      ,						addition_embed_type_num_heads=2      ,						cross_attention_norm="""group_norm"""      ,						resnet_time_scale_shift="""scale_shift"""      ,						act_fn="""gelu"""      ,						)
            unet.set_attn_processor(AttnAddedKVProcessor() )  # For reproducibility tests

            torch.manual_seed(0 )
            lowerCAmelCase  						=       DDPMScheduler(
                num_train_timesteps=1_000      ,						beta_schedule="""squaredcos_cap_v2"""      ,						beta_start=0.0_001      ,						beta_end=0.02      ,						thresholding=lowercase      ,						dynamic_thresholding_ratio=0.95      ,						sample_max_value=1.0      ,						prediction_type="""epsilon"""      ,						variance_type="""learned_range"""      ,						)

            torch.manual_seed(0 )
            lowerCAmelCase  						=       IFWatermarker()

            return {
                "text_encoder": text_encoder,
                "tokenizer": tokenizer,
                "unet": unet,
                "scheduler": scheduler,
                "watermarker": watermarker,
                "safety_checker": None,
                "feature_extractor": None,
            }





      def     _snake_case			(       self )		->     int:
            torch.manual_seed(0 )
            lowerCAmelCase  						=       TaEncoderModel.from_pretrained("""hf-internal-testing/tiny-random-t5""" )

            torch.manual_seed(0 )
            lowerCAmelCase  						=       AutoTokenizer.from_pretrained("""hf-internal-testing/tiny-random-t5""" )

            torch.manual_seed(0 )
            lowerCAmelCase  						=       UNetaDConditionModel(
                sample_size=32      ,						layers_per_block=[1, 2]      ,						block_out_channels=[32, 64]      ,						down_block_types=[
                    """ResnetDownsampleBlock2D""",
                    """SimpleCrossAttnDownBlock2D""",
                ]      ,						mid_block_type="""UNetMidBlock2DSimpleCrossAttn"""      ,						up_block_types=["""SimpleCrossAttnUpBlock2D""", """ResnetUpsampleBlock2D"""]      ,						in_channels=6      ,						out_channels=6      ,						cross_attention_dim=32      ,						encoder_hid_dim=32      ,						attention_head_dim=8      ,						addition_embed_type="""text"""      ,						addition_embed_type_num_heads=2      ,						cross_attention_norm="""group_norm"""      ,						resnet_time_scale_shift="""scale_shift"""      ,						act_fn="""gelu"""      ,						class_embed_type="""timestep"""      ,						mid_block_scale_factor=1.414      ,						time_embedding_act_fn="""gelu"""      ,						time_embedding_dim=32      ,						)
            unet.set_attn_processor(AttnAddedKVProcessor() )  # For reproducibility tests

            torch.manual_seed(0 )
            lowerCAmelCase  						=       DDPMScheduler(
                num_train_timesteps=1_000      ,						beta_schedule="""squaredcos_cap_v2"""      ,						beta_start=0.0_001      ,						beta_end=0.02      ,						thresholding=lowercase      ,						dynamic_thresholding_ratio=0.95      ,						sample_max_value=1.0      ,						prediction_type="""epsilon"""      ,						variance_type="""learned_range"""      ,						)

            torch.manual_seed(0 )
            lowerCAmelCase  						=       DDPMScheduler(
                num_train_timesteps=1_000      ,						beta_schedule="""squaredcos_cap_v2"""      ,						beta_start=0.0_001      ,						beta_end=0.02      ,						)

            torch.manual_seed(0 )
            lowerCAmelCase  						=       IFWatermarker()

            return {
                "text_encoder": text_encoder,
                "tokenizer": tokenizer,
                "unet": unet,
                "scheduler": scheduler,
                "image_noising_scheduler": image_noising_scheduler,
                "watermarker": watermarker,
                "safety_checker": None,
                "feature_extractor": None,
            }





      def     _snake_case			(       self )		->     Union[str, Any]:
            lowerCAmelCase  						=       self.get_dummy_components()
            lowerCAmelCase  						=       self.pipeline_class(**lowercase )
            pipe.to(lowercase )
            pipe.set_progress_bar_config(disable=lowercase )

            lowerCAmelCase  						=       self.get_dummy_inputs(lowercase )

            lowerCAmelCase  						=       inputs["""prompt"""]
            lowerCAmelCase  						=       inputs["""generator"""]
            lowerCAmelCase  						=       inputs["""num_inference_steps"""]
            lowerCAmelCase  						=       inputs["""output_type"""]

            if "image" in inputs:
                  lowerCAmelCase  						=       inputs["""image"""]
            else:
                  lowerCAmelCase  						=       None

            if "mask_image" in inputs:
                  lowerCAmelCase  						=       inputs["""mask_image"""]
            else:
                  lowerCAmelCase  						=       None

            if "original_image" in inputs:
                  lowerCAmelCase  						=       inputs["""original_image"""]
            else:
                  lowerCAmelCase  						=       None

            lowerCAmelCase						,		lowerCAmelCase  						=       pipe.encode_prompt(lowercase )

            # inputs with prompt converted to embeddings
            lowerCAmelCase  						=       {
                """prompt_embeds""": prompt_embeds,
                """negative_prompt_embeds""": negative_prompt_embeds,
                """generator""": generator,
                """num_inference_steps""": num_inference_steps,
                """output_type""": output_type,
            }

            if image is not None:
                  lowerCAmelCase  						=       image

            if mask_image is not None:
                  lowerCAmelCase  						=       mask_image

            if original_image is not None:
                  lowerCAmelCase  						=       original_image

            # set all optional components to None
            for optional_component in pipe._optional_components:
                  setattr(lowercase      ,						lowercase      ,						lowercase )

            lowerCAmelCase  						=       pipe(**lowercase )[0]

            with tempfile.TemporaryDirectory() as tmpdir:
                  pipe.save_pretrained(lowercase )
                  lowerCAmelCase  						=       self.pipeline_class.from_pretrained(lowercase )
                  pipe_loaded.to(lowercase )
                  pipe_loaded.set_progress_bar_config(disable=lowercase )

            pipe_loaded.unet.set_attn_processor(AttnAddedKVProcessor() )  # For reproducibility tests

            for optional_component in pipe._optional_components:
                  self.assertTrue(
                      getattr(lowercase      ,						lowercase ) is None      ,						f'`{optional_component}` did not stay set to None after loading.'      ,						)

            lowerCAmelCase  						=       self.get_dummy_inputs(lowercase )

            lowerCAmelCase  						=       inputs["""generator"""]
            lowerCAmelCase  						=       inputs["""num_inference_steps"""]
            lowerCAmelCase  						=       inputs["""output_type"""]

            # inputs with prompt converted to embeddings
            lowerCAmelCase  						=       {
                """prompt_embeds""": prompt_embeds,
                """negative_prompt_embeds""": negative_prompt_embeds,
                """generator""": generator,
                """num_inference_steps""": num_inference_steps,
                """output_type""": output_type,
            }

            if image is not None:
                  lowerCAmelCase  						=       image

            if mask_image is not None:
                  lowerCAmelCase  						=       mask_image

            if original_image is not None:
                  lowerCAmelCase  						=       original_image

            lowerCAmelCase  						=       pipe_loaded(**lowercase )[0]

            lowerCAmelCase  						=       np.abs(to_np(lowercase ) - to_np(lowercase ) ).max()
            self.assertLess(lowercase      ,						1e-4 )





      def     _snake_case			(       self )		->     Optional[int]:
            lowerCAmelCase  						=       self.get_dummy_components()
            lowerCAmelCase  						=       self.pipeline_class(**lowercase )
            pipe.to(lowercase )
            pipe.set_progress_bar_config(disable=lowercase )

            lowerCAmelCase  						=       self.get_dummy_inputs(lowercase )
            lowerCAmelCase  						=       pipe(**lowercase )[0]

            with tempfile.TemporaryDirectory() as tmpdir:
                  pipe.save_pretrained(lowercase )
                  lowerCAmelCase  						=       self.pipeline_class.from_pretrained(lowercase )
                  pipe_loaded.to(lowercase )
                  pipe_loaded.set_progress_bar_config(disable=lowercase )

            pipe_loaded.unet.set_attn_processor(AttnAddedKVProcessor() )  # For reproducibility tests

            lowerCAmelCase  						=       self.get_dummy_inputs(lowercase )
            lowerCAmelCase  						=       pipe_loaded(**lowercase )[0]

            lowerCAmelCase  						=       np.abs(to_np(lowercase ) - to_np(lowercase ) ).max()
            self.assertLess(lowercase      ,						1e-4 )






