


"""simple docstring"""






import itertools
import random
import unittest

import numpy as np

from transformers import is_speech_available
from transformers.testing_utils import require_torch, require_torchaudio

from ...test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin


if is_speech_available():
	from transformers import SpeechaTextFeatureExtractor

_lowerCamelCase     =  random.Random()


def __lowercase     (      lowerCamelCase_  :      Optional[Any]						,					lowerCamelCase_  :      Optional[int]=1.0						,					lowerCamelCase_  :      List[Any]=None						,					lowerCamelCase_  :      Dict=None  ):
				if rng is None:
								SCREAMING_SNAKE_CASE__     							=				global_rng

				SCREAMING_SNAKE_CASE__     							=				[]
				for batch_idx in range(shape[0]  ):
								values.append([]  )
								for _ in range(shape[1]  ):
												values[-1].append(rng.random() * scale  )

				return values


@require_torch
@require_torchaudio
class 			lowerCamelCase_		(			unittest.TestCase   ):





				"""simple docstring"""







				def __init__(						self       ,		UpperCAmelCase__       ,		UpperCAmelCase__=7       ,		UpperCAmelCase__=400       ,		UpperCAmelCase__=2000       ,		UpperCAmelCase__=24       ,		UpperCAmelCase__=24       ,		UpperCAmelCase__=0.0       ,		UpperCAmelCase__=1_6000       ,		UpperCAmelCase__=True       ,		UpperCAmelCase__=True       ,		):
								SCREAMING_SNAKE_CASE__     							=				parent
								SCREAMING_SNAKE_CASE__     							=				batch_size
								SCREAMING_SNAKE_CASE__     							=				min_seq_length
								SCREAMING_SNAKE_CASE__     							=				max_seq_length
								SCREAMING_SNAKE_CASE__     							=				(self.max_seq_length - self.min_seq_length) // (self.batch_size - 1)
								SCREAMING_SNAKE_CASE__     							=				feature_size
								SCREAMING_SNAKE_CASE__     							=				num_mel_bins
								SCREAMING_SNAKE_CASE__     							=				padding_value
								SCREAMING_SNAKE_CASE__     							=				sampling_rate
								SCREAMING_SNAKE_CASE__     							=				return_attention_mask
								SCREAMING_SNAKE_CASE__     							=				do_normalize



				def   lowerCAmelCase__		(						self     ):
								return {
								    "feature_size": self.feature_size,
								    "num_mel_bins": self.num_mel_bins,
								    "padding_value": self.padding_value,
								    "sampling_rate": self.sampling_rate,
								    "return_attention_mask": self.return_attention_mask,
								    "do_normalize": self.do_normalize,
								}






				def   lowerCAmelCase__		(						self       ,		UpperCAmelCase__=False       ,		UpperCAmelCase__=False     ):
								def _flatten(UpperCAmelCase__     ):
												return list(itertools.chain(*UpperCAmelCase__     )     )

								if equal_length:
												SCREAMING_SNAKE_CASE__     							=				[floats_list((self.max_seq_length, self.feature_size)     ) for _ in range(self.batch_size     )]
								else:
												# make sure that inputs increase in size
												SCREAMING_SNAKE_CASE__     							=				[
												    floats_list((x, self.feature_size)     )
												    for x in range(self.min_seq_length       ,		self.max_seq_length       ,		self.seq_length_diff     )
												]
								if numpify:
												SCREAMING_SNAKE_CASE__     							=				[np.asarray(UpperCAmelCase__     ) for x in speech_inputs]
								return speech_inputs


@require_torch
@require_torchaudio
class 			lowerCamelCase_		(			lowercase       ,  unittest.TestCase   ):





				"""simple docstring"""







				_lowerCAmelCase      :      List[str]      							=					SpeechaTextFeatureExtractor if is_speech_available() else None



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				SpeechaTextFeatureExtractionTester(self     )



				def   lowerCAmelCase__		(						self       ,		UpperCAmelCase__     ):
								self.assertTrue(np.all(np.mean(UpperCAmelCase__       ,		axis=0     ) < 1e-3     )     )
								self.assertTrue(np.all(np.abs(np.var(UpperCAmelCase__       ,		axis=0     ) - 1     ) < 1e-3     )     )



				def   lowerCAmelCase__		(						self     ):
								# Tests that all call wrap to encode_plus and batch_encode_plus
								SCREAMING_SNAKE_CASE__     							=				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()     )
								# create three inputs of length 800, 1000, and 1200
								SCREAMING_SNAKE_CASE__     							=				[floats_list((1, x)     )[0] for x in range(800       ,		1400       ,		200     )]
								SCREAMING_SNAKE_CASE__     							=				[np.asarray(UpperCAmelCase__     ) for speech_input in speech_inputs]

								# Test feature size
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(UpperCAmelCase__       ,		padding=UpperCAmelCase__       ,		return_tensors="np"     ).input_features
								self.assertTrue(input_features.ndim == 3     )
								self.assertTrue(input_features.shape[-1] == feature_extractor.feature_size     )

								# Test not batched input
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(speech_inputs[0]       ,		return_tensors="np"     ).input_features
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(np_speech_inputs[0]       ,		return_tensors="np"     ).input_features
								self.assertTrue(np.allclose(UpperCAmelCase__       ,		UpperCAmelCase__       ,		atol=1e-3     )     )

								# Test batched
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(UpperCAmelCase__       ,		return_tensors="np"     ).input_features
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(UpperCAmelCase__       ,		return_tensors="np"     ).input_features
								for enc_seq_a, enc_seq_a in zip(UpperCAmelCase__       ,		UpperCAmelCase__     ):
												self.assertTrue(np.allclose(UpperCAmelCase__       ,		UpperCAmelCase__       ,		atol=1e-3     )     )

								# Test 2-D numpy arrays are batched.
								SCREAMING_SNAKE_CASE__     							=				[floats_list((1, x)     )[0] for x in (800, 800, 800)]
								SCREAMING_SNAKE_CASE__     							=				np.asarray(UpperCAmelCase__     )
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(UpperCAmelCase__       ,		return_tensors="np"     ).input_features
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(UpperCAmelCase__       ,		return_tensors="np"     ).input_features
								for enc_seq_a, enc_seq_a in zip(UpperCAmelCase__       ,		UpperCAmelCase__     ):
												self.assertTrue(np.allclose(UpperCAmelCase__       ,		UpperCAmelCase__       ,		atol=1e-3     )     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()     )
								SCREAMING_SNAKE_CASE__     							=				[floats_list((1, x)     )[0] for x in range(800       ,		1400       ,		200     )]

								SCREAMING_SNAKE_CASE__     							=				["longest", "max_length", "do_not_pad"]
								SCREAMING_SNAKE_CASE__     							=				[None, 16, None]
								for max_length, padding in zip(UpperCAmelCase__       ,		UpperCAmelCase__     ):
												SCREAMING_SNAKE_CASE__     							=				feature_extractor(
												    UpperCAmelCase__       ,		padding=UpperCAmelCase__       ,		max_length=UpperCAmelCase__       ,		return_attention_mask=UpperCAmelCase__     )
												SCREAMING_SNAKE_CASE__     							=				inputs.input_features
												SCREAMING_SNAKE_CASE__     							=				inputs.attention_mask
												SCREAMING_SNAKE_CASE__     							=				[np.sum(UpperCAmelCase__     ) for x in attention_mask]

												self._check_zero_mean_unit_variance(input_features[0][: fbank_feat_lengths[0]]     )
												self._check_zero_mean_unit_variance(input_features[1][: fbank_feat_lengths[1]]     )
												self._check_zero_mean_unit_variance(input_features[2][: fbank_feat_lengths[2]]     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()     )
								SCREAMING_SNAKE_CASE__     							=				[floats_list((1, x)     )[0] for x in range(800       ,		1400       ,		200     )]

								SCREAMING_SNAKE_CASE__     							=				["longest", "max_length", "do_not_pad"]
								SCREAMING_SNAKE_CASE__     							=				[None, 16, None]
								for max_length, padding in zip(UpperCAmelCase__       ,		UpperCAmelCase__     ):
												SCREAMING_SNAKE_CASE__     							=				feature_extractor(
												    UpperCAmelCase__       ,		max_length=UpperCAmelCase__       ,		padding=UpperCAmelCase__       ,		return_tensors="np"       ,		return_attention_mask=UpperCAmelCase__     )
												SCREAMING_SNAKE_CASE__     							=				inputs.input_features
												SCREAMING_SNAKE_CASE__     							=				inputs.attention_mask
												SCREAMING_SNAKE_CASE__     							=				[np.sum(UpperCAmelCase__     ) for x in attention_mask]

												self._check_zero_mean_unit_variance(input_features[0][: fbank_feat_lengths[0]]     )
												self.assertTrue(input_features[0][fbank_feat_lengths[0] :].sum() < 1e-6     )
												self._check_zero_mean_unit_variance(input_features[1][: fbank_feat_lengths[1]]     )
												self.assertTrue(input_features[0][fbank_feat_lengths[1] :].sum() < 1e-6     )
												self._check_zero_mean_unit_variance(input_features[2][: fbank_feat_lengths[2]]     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()     )
								SCREAMING_SNAKE_CASE__     							=				[floats_list((1, x)     )[0] for x in range(800       ,		1400       ,		200     )]
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(
								    UpperCAmelCase__       ,		padding="max_length"       ,		max_length=4       ,		truncation=UpperCAmelCase__       ,		return_tensors="np"       ,		return_attention_mask=UpperCAmelCase__       ,		)
								SCREAMING_SNAKE_CASE__     							=				inputs.input_features
								SCREAMING_SNAKE_CASE__     							=				inputs.attention_mask
								SCREAMING_SNAKE_CASE__     							=				np.sum(attention_mask == 1       ,		axis=1     )

								self._check_zero_mean_unit_variance(input_features[0, : fbank_feat_lengths[0]]     )
								self._check_zero_mean_unit_variance(input_features[1]     )
								self._check_zero_mean_unit_variance(input_features[2]     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()     )
								SCREAMING_SNAKE_CASE__     							=				[floats_list((1, x)     )[0] for x in range(800       ,		1400       ,		200     )]
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(
								    UpperCAmelCase__       ,		padding="longest"       ,		max_length=4       ,		truncation=UpperCAmelCase__       ,		return_tensors="np"       ,		return_attention_mask=UpperCAmelCase__       ,		)
								SCREAMING_SNAKE_CASE__     							=				inputs.input_features
								SCREAMING_SNAKE_CASE__     							=				inputs.attention_mask
								SCREAMING_SNAKE_CASE__     							=				np.sum(attention_mask == 1       ,		axis=1     )

								self._check_zero_mean_unit_variance(input_features[0, : fbank_feat_lengths[0]]     )
								self._check_zero_mean_unit_variance(input_features[1, : fbank_feat_lengths[1]]     )
								self._check_zero_mean_unit_variance(input_features[2]     )

								# make sure that if max_length < longest -> then pad to max_length
								self.assertEqual(input_features.shape       ,		(3, 4, 24)     )

								SCREAMING_SNAKE_CASE__     							=				[floats_list((1, x)     )[0] for x in range(800       ,		1400       ,		200     )]
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(
								    UpperCAmelCase__       ,		padding="longest"       ,		max_length=16       ,		truncation=UpperCAmelCase__       ,		return_tensors="np"       ,		return_attention_mask=UpperCAmelCase__       ,		)
								SCREAMING_SNAKE_CASE__     							=				inputs.input_features
								SCREAMING_SNAKE_CASE__     							=				inputs.attention_mask
								SCREAMING_SNAKE_CASE__     							=				np.sum(attention_mask == 1       ,		axis=1     )

								self._check_zero_mean_unit_variance(input_features[0, : fbank_feat_lengths[0]]     )
								self._check_zero_mean_unit_variance(input_features[1, : fbank_feat_lengths[1]]     )
								self._check_zero_mean_unit_variance(input_features[2]     )

								# make sure that if max_length < longest -> then pad to max_length
								self.assertEqual(input_features.shape       ,		(3, 6, 24)     )



				def   lowerCAmelCase__		(						self     ):
								import torch

								SCREAMING_SNAKE_CASE__     							=				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()     )
								SCREAMING_SNAKE_CASE__     							=				np.random.rand(100       ,		32     ).astype(np.floataa     )
								SCREAMING_SNAKE_CASE__     							=				np_speech_inputs.tolist()

								for inputs in [py_speech_inputs, np_speech_inputs]:
												SCREAMING_SNAKE_CASE__     							=				feature_extractor.pad([{"input_features": inputs}]       ,		return_tensors="np"     )
												self.assertTrue(np_processed.input_features.dtype == np.floataa     )
												SCREAMING_SNAKE_CASE__     							=				feature_extractor.pad([{"input_features": inputs}]       ,		return_tensors="pt"     )
												self.assertTrue(pt_processed.input_features.dtype == torch.floataa     )



				def   lowerCAmelCase__		(						self       ,		UpperCAmelCase__     ):
								from datasets import load_dataset

								SCREAMING_SNAKE_CASE__     							=				load_dataset("hf-internal-testing/librispeech_asr_dummy"       ,		"clean"       ,		split="validation"     )
								# automatic decoding with librispeech
								SCREAMING_SNAKE_CASE__     							=				ds.sort("id"     ).select(range(UpperCAmelCase__     )     )[:num_samples]["audio"]

								return [x["array"] for x in speech_samples]






				def   lowerCAmelCase__		(						self     ):
								# fmt: off
								SCREAMING_SNAKE_CASE__     							=				np.array([
								    -1.5_745, -1.7_713, -1.7_020, -1.6_069, -1.2_250, -1.1_105, -0.9_072, -0.8_241,
								    -1.2_310, -0.8_098, -0.3_320, -0.4_101, -0.7_985, -0.4_996, -0.8_213, -0.9_128,
								    -1.0_420, -1.1_286, -1.0_440, -0.7_999, -0.8_405, -1.2_275, -1.5_443, -1.4_625,
								]     )
								# fmt: on

								SCREAMING_SNAKE_CASE__     							=				self._load_datasamples(1     )
								SCREAMING_SNAKE_CASE__     							=				self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()     )
								SCREAMING_SNAKE_CASE__     							=				feature_extractor(UpperCAmelCase__       ,		return_tensors="pt"     ).input_features
								self.assertEquals(input_features.shape       ,		(1, 584, 24)     )
								self.assertTrue(np.allclose(input_features[0, 0, :30]       ,		UpperCAmelCase__       ,		atol=1e-4     )     )




"""simple docstring"""






import ast
import os
import re
import shutil
import tempfile
import unittest
from unittest import mock

import torch

from accelerate.test_utils.examples import compare_against_test
from accelerate.test_utils.testing import TempDirTestCase, require_trackers, run_command, slow
from accelerate.utils import write_basic_config


# DataLoaders built from `test_samples/MRPC` for quick testing
# Should mock `{script_name}.get_dataloaders` via:
# @mock.patch("{script_name}.get_dataloaders", mocked_dataloaders)

_lowerCamelCase     =  [
    'cross_validation.py',
    'gradient_accumulation.py',
    'local_sgd.py',
    'multi_process_metrics.py',
    'memory.py',
    'automatic_gradient_accumulation.py',
    'fsdp_with_peak_mem_tracking.py',
    'deepspeed_with_config_support.py',
    'megatron_lm_gpt_pretraining.py',
]


class 			lowerCamelCase_		(			unittest.TestCase   ):





				"""simple docstring"""







				def   lowerCAmelCase__		(						self       ,		UpperCAmelCase__       ,		UpperCAmelCase__       ,		UpperCAmelCase__ = None       ,		UpperCAmelCase__ = None     ):
								SCREAMING_SNAKE_CASE__     							=				None
								SCREAMING_SNAKE_CASE__     							=				os.path.abspath(os.path.join("examples"       ,		"by_feature"     )     )
								SCREAMING_SNAKE_CASE__     							=				os.path.abspath("examples"     )
								for item in os.listdir(UpperCAmelCase__     ):
												if item not in EXCLUDE_EXAMPLES:
																SCREAMING_SNAKE_CASE__     							=				os.path.join(UpperCAmelCase__       ,		UpperCAmelCase__     )
																if os.path.isfile(UpperCAmelCase__     ) and ".py" in item_path:
																				with self.subTest(
																				    tested_script=UpperCAmelCase__       ,		feature_script=UpperCAmelCase__       ,		tested_section="main()" if parser_only else "training_function()"       ,		):
																								SCREAMING_SNAKE_CASE__     							=				compare_against_test(
																								    os.path.join(UpperCAmelCase__       ,		UpperCAmelCase__     )       ,		UpperCAmelCase__       ,		UpperCAmelCase__       ,		UpperCAmelCase__     )
																								SCREAMING_SNAKE_CASE__     							=				"\n".join(UpperCAmelCase__     )
																								if special_strings is not None:
																												for string in special_strings:
																																SCREAMING_SNAKE_CASE__     							=				diff.replace(UpperCAmelCase__       ,		""     )
																								self.assertEqual(UpperCAmelCase__       ,		""     )



				def   lowerCAmelCase__		(						self     ):
								self.one_complete_example("complete_nlp_example.py"       ,		UpperCAmelCase__     )
								self.one_complete_example("complete_nlp_example.py"       ,		UpperCAmelCase__     )






				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				os.path.abspath(os.path.join("examples"       ,		"cv_example.py"     )     )
								SCREAMING_SNAKE_CASE__     							=				[
								    " " * 16 + "{\n\n",
								    " " * 20 + "\"accuracy\": eval_metric[\"accuracy\"],\n\n",
								    " " * 20 + "\"f1\": eval_metric[\"f1\"],\n\n",
								    " " * 20 + "\"train_loss\": total_loss.item() / len(train_dataloader),\n\n",
								    " " * 20 + "\"epoch\": epoch,\n\n",
								    " " * 16 + "},\n\n",
								    " " * 16 + "step=epoch,\n",
								    " " * 12,
								    " " * 8 + "for step, batch in enumerate(active_dataloader):\n",
								]
								self.one_complete_example("complete_cv_example.py"       ,		UpperCAmelCase__       ,		UpperCAmelCase__       ,		UpperCAmelCase__     )
								self.one_complete_example("complete_cv_example.py"       ,		UpperCAmelCase__       ,		UpperCAmelCase__       ,		UpperCAmelCase__     )


@mock.patch.dict(os.environ       ,  {"TESTING_MOCKED_DATALOADERS": "1"}   )
class 			lowerCamelCase_		(			lowercase   ):





				"""simple docstring"""







				_lowerCAmelCase      :      Dict      							=					False



				@classmethod
				def   lowerCAmelCase__		(						cls     ):
								super().setUpClass()
								SCREAMING_SNAKE_CASE__     							=				tempfile.mkdtemp()
								SCREAMING_SNAKE_CASE__     							=				os.path.join(cls._tmpdir       ,		"default_config.yml"     )

								write_basic_config(save_location=cls.configPath     )
								SCREAMING_SNAKE_CASE__     							=				["accelerate", "launch", "--config_file", cls.configPath]



				@classmethod
				def   lowerCAmelCase__		(						cls     ):
								super().tearDownClass()
								shutil.rmtree(cls._tmpdir     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				f'''
        examples/by_feature/checkpointing.py
        --checkpointing_steps epoch
        --output_dir {self.tmpdir}
        '''.split()
								run_command(self._launch_args + testargs     )
								self.assertTrue(os.path.exists(os.path.join(self.tmpdir       ,		"epoch_0"     )     )     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				f'''
        examples/by_feature/checkpointing.py
        --checkpointing_steps 1
        --output_dir {self.tmpdir}
        '''.split()
								SCREAMING_SNAKE_CASE__     							=				run_command(self._launch_args + testargs     )
								self.assertTrue(os.path.exists(os.path.join(self.tmpdir       ,		"step_2"     )     )     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				f'''
        examples/by_feature/checkpointing.py
        --resume_from_checkpoint {os.path.join(self.tmpdir       ,		"epoch_0"     )}
        '''.split()
								SCREAMING_SNAKE_CASE__     							=				run_command(self._launch_args + testargs       ,		return_stdout=UpperCAmelCase__     )
								self.assertNotIn("epoch 0:"       ,		UpperCAmelCase__     )
								self.assertIn("epoch 1:"       ,		UpperCAmelCase__     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				f'''
        examples/by_feature/checkpointing.py
        --resume_from_checkpoint {os.path.join(self.tmpdir       ,		"step_2"     )}
        '''.split()
								SCREAMING_SNAKE_CASE__     							=				run_command(self._launch_args + testargs       ,		return_stdout=UpperCAmelCase__     )
								if torch.cuda.is_available():
												SCREAMING_SNAKE_CASE__     							=				torch.cuda.device_count()
								else:
												SCREAMING_SNAKE_CASE__     							=				1
								if num_processes > 1:
												self.assertNotIn("epoch 0:"       ,		UpperCAmelCase__     )
												self.assertIn("epoch 1:"       ,		UpperCAmelCase__     )
								else:
												self.assertIn("epoch 0:"       ,		UpperCAmelCase__     )
												self.assertIn("epoch 1:"       ,		UpperCAmelCase__     )



				@slow
				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				"\n        examples/by_feature/cross_validation.py\n        --num_folds 2\n        ".split()
								with mock.patch.dict(os.environ       ,		{"TESTING_MOCKED_DATALOADERS": "0"}     ):
												SCREAMING_SNAKE_CASE__     							=				run_command(self._launch_args + testargs       ,		return_stdout=UpperCAmelCase__     )
												SCREAMING_SNAKE_CASE__     							=				re.findall("({.+})"       ,		UpperCAmelCase__     )
												SCREAMING_SNAKE_CASE__     							=				[r for r in results if "accuracy" in r][-1]
												SCREAMING_SNAKE_CASE__     							=				ast.literal_eval(UpperCAmelCase__     )
												self.assertGreaterEqual(results["accuracy"]       ,		0.75     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				["examples/by_feature/multi_process_metrics.py"]
								run_command(self._launch_args + testargs     )



				@require_trackers
				@mock.patch.dict(os.environ       ,		{"WANDB_MODE": "offline"}     )
				def   lowerCAmelCase__		(						self     ):
								with tempfile.TemporaryDirectory() as tmpdir:
												SCREAMING_SNAKE_CASE__     							=				f'''
            examples/by_feature/tracking.py
            --with_tracking
            --project_dir {tmpdir}
            '''.split()
												run_command(self._launch_args + testargs     )
												self.assertTrue(os.path.exists(os.path.join(UpperCAmelCase__       ,		"tracking"     )     )     )



				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				["examples/by_feature/gradient_accumulation.py"]
								run_command(self._launch_args + testargs     )






				def   lowerCAmelCase__		(						self     ):
								SCREAMING_SNAKE_CASE__     							=				["examples/by_feature/local_sgd.py"]
								run_command(self._launch_args + testargs     )
