






import inspect
import unittest

from datasets import load_dataset
from packaging import version

from transformers import BeitConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
							import torch
							from torch import nn

							from transformers import (
							    MODEL_MAPPING,
							    BeitForImageClassification,
							    BeitForMaskedImageModeling,
							    BeitForSemanticSegmentation,
							    BeitModel,
							)
							from transformers.models.beit.modeling_beit import BEIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
							import PIL
							from PIL import Image

							from transformers import BeitImageProcessor
class    _UpperCAmelCase      :

				"""simple docstring"""




				def __init__(  self		:					Optional[int],						lowerCamelCase		:					Optional[int],						lowerCamelCase		:					Tuple=100,						lowerCamelCase		:					Any=13,						lowerCamelCase		:					Union[str, Any]=30,						lowerCamelCase		:					Dict=2,						lowerCamelCase		:					Optional[int]=3,						lowerCamelCase		:					int=True,						lowerCamelCase		:					Tuple=True,						lowerCamelCase		:					Optional[int]=32,						lowerCamelCase		:					Any=4,						lowerCamelCase		:					int=4,						lowerCamelCase		:					int=37,						lowerCamelCase		:					Tuple="gelu",						lowerCamelCase		:					List[str]=0.1,						lowerCamelCase		:					Optional[int]=0.1,						lowerCamelCase		:					Dict=10,						lowerCamelCase		:					int=0.02,						lowerCamelCase		:					List[str]=3,						lowerCamelCase		:					List[Any]=None,						lowerCamelCase		:					List[str]=[0, 1, 2, 3],						):

								'''simple docstring'''
								lowercase__     				=    parent
								lowercase__     				=    100
								lowercase__     				=    batch_size
								lowercase__     				=    image_size
								lowercase__     				=    patch_size
								lowercase__     				=    num_channels
								lowercase__     				=    is_training
								lowercase__     				=    use_labels
								lowercase__     				=    hidden_size
								lowercase__     				=    num_hidden_layers
								lowercase__     				=    num_attention_heads
								lowercase__     				=    intermediate_size
								lowercase__     				=    hidden_act
								lowercase__     				=    hidden_dropout_prob
								lowercase__     				=    attention_probs_dropout_prob
								lowercase__     				=    type_sequence_label_size
								lowercase__     				=    initializer_range
								lowercase__     				=    scope
								lowercase__     				=    out_indices
								lowercase__     				=    num_labels

								# in BeiT, the seq length equals the number of patches + 1 (we add 1 for the [CLS] token)
								lowercase__     				=    (image_size // patch_size) ** 2
								lowercase__     				=    num_patches + 1




				def        lowercase__     (  self		:					Tuple						):

								'''simple docstring'''
								lowercase__     				=    floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]						)

								lowercase__     				=    None
								lowercase__     				=    None
								if self.use_labels:
												lowercase__     				=    ids_tensor([self.batch_size],						self.type_sequence_label_size						)
												lowercase__     				=    ids_tensor([self.batch_size, self.image_size, self.image_size],						self.num_labels						)

								lowercase__     				=    self.get_config()

								return config, pixel_values, labels, pixel_labels




				def        lowercase__     (  self		:					List[Any]						):

								'''simple docstring'''
								return BeitConfig(
								    vocab_size=self.vocab_size,						image_size=self.image_size,						patch_size=self.patch_size,						num_channels=self.num_channels,						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,						is_decoder=lowerCamelCase,						initializer_range=self.initializer_range,						out_indices=self.out_indices,						)




				def        lowercase__     (  self		:					Any,						lowerCamelCase		:					Union[str, Any],						lowerCamelCase		:					Tuple,						lowerCamelCase		:					Any,						lowerCamelCase		:					Any						):

								'''simple docstring'''
								lowercase__     				=    BeitModel(config=lowerCamelCase						)
								model.to(lowerCamelCase						)
								model.eval()
								lowercase__     				=    model(lowerCamelCase						)
								self.parent.assertEqual(result.last_hidden_state.shape,						(self.batch_size, self.seq_length, self.hidden_size)						)




				def        lowercase__     (  self		:					Tuple,						lowerCamelCase		:					Optional[int],						lowerCamelCase		:					List[Any],						lowerCamelCase		:					Optional[Any],						lowerCamelCase		:					Union[str, Any]						):

								'''simple docstring'''
								lowercase__     				=    BeitForMaskedImageModeling(config=lowerCamelCase						)
								model.to(lowerCamelCase						)
								model.eval()
								lowercase__     				=    model(lowerCamelCase						)
								self.parent.assertEqual(result.logits.shape,						(self.batch_size, self.seq_length - 1, self.vocab_size)						)




				def        lowercase__     (  self		:					List[Any],						lowerCamelCase		:					Union[str, Any],						lowerCamelCase		:					Optional[Any],						lowerCamelCase		:					Tuple,						lowerCamelCase		:					List[str]						):

								'''simple docstring'''
								lowercase__     				=    self.type_sequence_label_size
								lowercase__     				=    BeitForImageClassification(lowerCamelCase						)
								model.to(lowerCamelCase						)
								model.eval()
								lowercase__     				=    model(lowerCamelCase,						labels=lowerCamelCase						)
								self.parent.assertEqual(result.logits.shape,						(self.batch_size, self.type_sequence_label_size)						)

								# test greyscale images
								lowercase__     				=    1
								lowercase__     				=    BeitForImageClassification(lowerCamelCase						)
								model.to(lowerCamelCase						)
								model.eval()

								lowercase__     				=    floats_tensor([self.batch_size, 1, self.image_size, self.image_size]						)
								lowercase__     				=    model(lowerCamelCase,						labels=lowerCamelCase						)
								self.parent.assertEqual(result.logits.shape,						(self.batch_size, self.type_sequence_label_size)						)




				def        lowercase__     (  self		:					Tuple,						lowerCamelCase		:					Optional[Any],						lowerCamelCase		:					Union[str, Any],						lowerCamelCase		:					List[str],						lowerCamelCase		:					int						):

								'''simple docstring'''
								lowercase__     				=    self.num_labels
								lowercase__     				=    BeitForSemanticSegmentation(lowerCamelCase						)
								model.to(lowerCamelCase						)
								model.eval()
								lowercase__     				=    model(lowerCamelCase						)
								self.parent.assertEqual(
								    result.logits.shape,						(self.batch_size, self.num_labels, self.image_size * 2, self.image_size * 2)						)
								lowercase__     				=    model(lowerCamelCase,						labels=lowerCamelCase						)
								self.parent.assertEqual(
								    result.logits.shape,						(self.batch_size, self.num_labels, self.image_size * 2, self.image_size * 2)						)




				def        lowercase__     (  self		:					Optional[int]						):

								'''simple docstring'''
								lowercase__     				=    self.prepare_config_and_inputs()
								lowercase__				,		lowercase__				,		lowercase__				,		lowercase__     				=    config_and_inputs
								lowercase__     				=    {'''pixel_values''': pixel_values}
								return config, inputs_dict



@require_torch
class    _UpperCAmelCase      ( A__	,A__	,unittest.TestCase			):

				"""simple docstring"""




				lowercase__       							= (
				    (BeitModel, BeitForImageClassification, BeitForMaskedImageModeling, BeitForSemanticSegmentation)
				    if is_torch_available()
				    else ()
				)
				lowercase__       							= (
				    {
				        """feature-extraction""": BeitModel,
				        """image-classification""": BeitForImageClassification,
				        """image-segmentation""": BeitForSemanticSegmentation,
				    }
				    if is_torch_available()
				    else {}
				)

				lowercase__       							= False
				lowercase__       							= False
				lowercase__       							= False




				def        lowercase__     (  self		:					Tuple						):

								'''simple docstring'''
								lowercase__     				=    BeitModelTester(self						)
								lowercase__     				=    ConfigTester(self,						config_class=lowerCamelCase,						has_text_modality=lowerCamelCase,						hidden_size=37						)




				def        lowercase__     (  self		:					List[Any]						):

								'''simple docstring'''
								self.config_tester.run_common_tests()




				@unittest.skip(reason='''BEiT does not use inputs_embeds'''						)
				def        lowercase__     (  self		:					Any						):

								'''simple docstring'''
								pass




				@require_torch_multi_gpu
				@unittest.skip(reason='''BEiT has some layers using `add_module` which doesn\'t work well with `nn.DataParallel`'''						)
				def        lowercase__     (  self		:					str						):

								'''simple docstring'''
								pass




				def        lowercase__     (  self		:					str						):

								'''simple docstring'''
								lowercase__				,		lowercase__     				=    self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
												lowercase__     				=    model_class(lowerCamelCase						)
												self.assertIsInstance(model.get_input_embeddings(),						(nn.Module)						)
												lowercase__     				=    model.get_output_embeddings()
												self.assertTrue(x is None or isinstance(lowerCamelCase,						nn.Linear						)						)




				def        lowercase__     (  self		:					Optional[Any]						):

								'''simple docstring'''
								lowercase__				,		lowercase__     				=    self.model_tester.prepare_config_and_inputs_for_common()

								for model_class in self.all_model_classes:
												lowercase__     				=    model_class(lowerCamelCase						)
												lowercase__     				=    inspect.signature(model.forward						)
												# signature.parameters is an OrderedDict => so arg_names order is deterministic
												lowercase__     				=    [*signature.parameters.keys()]

												lowercase__     				=    ['''pixel_values''']
												self.assertListEqual(arg_names[:1],						lowerCamelCase						)




				def        lowercase__     (  self		:					Dict						):

								'''simple docstring'''
								lowercase__     				=    self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*lowerCamelCase						)




				def        lowercase__     (  self		:					str						):

								'''simple docstring'''
								lowercase__     				=    self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_masked_lm(*lowerCamelCase						)




				def        lowercase__     (  self		:					Any						):

								'''simple docstring'''
								lowercase__     				=    self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_image_classification(*lowerCamelCase						)




				def        lowercase__     (  self		:					Dict						):

								'''simple docstring'''
								lowercase__     				=    self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_semantic_segmentation(*lowerCamelCase						)




				def        lowercase__     (  self		:					Dict						):

								'''simple docstring'''
								if not self.model_tester.is_training:
												return

								lowercase__				,		lowercase__     				=    self.model_tester.prepare_config_and_inputs_for_common()
								lowercase__     				=    True

								for model_class in self.all_model_classes:
												# we don't test BeitForMaskedImageModeling
												if model_class in [*get_values(lowerCamelCase						), BeitForMaskedImageModeling]:
																continue

												lowercase__     				=    model_class(lowerCamelCase						)
												model.to(lowerCamelCase						)
												model.train()
												lowercase__     				=    self._prepare_for_class(lowerCamelCase,						lowerCamelCase,						return_labels=lowerCamelCase						)
												lowercase__     				=    model(**lowerCamelCase						).loss
												loss.backward()




				def        lowercase__     (  self		:					Optional[int]						):

								'''simple docstring'''
								lowercase__				,		lowercase__     				=    self.model_tester.prepare_config_and_inputs_for_common()
								if not self.model_tester.is_training:
												return

								lowercase__     				=    False
								lowercase__     				=    True

								for model_class in self.all_model_classes:
												# we don't test BeitForMaskedImageModeling
												if (
												    model_class in [*get_values(lowerCamelCase						), BeitForMaskedImageModeling]
												    or not model_class.supports_gradient_checkpointing
												):
																continue

												lowercase__     				=    model_class(lowerCamelCase						)
												model.gradient_checkpointing_enable()
												model.to(lowerCamelCase						)
												model.train()
												lowercase__     				=    self._prepare_for_class(lowerCamelCase,						lowerCamelCase,						return_labels=lowerCamelCase						)
												lowercase__     				=    model(**lowerCamelCase						).loss
												loss.backward()




				def        lowercase__     (  self		:					Union[str, Any]						):

								'''simple docstring'''
								lowercase__				,		lowercase__     				=    self.model_tester.prepare_config_and_inputs_for_common()

								lowercase__     				=    _config_zero_init(lowerCamelCase						)
								for model_class in self.all_model_classes:
												lowercase__     				=    model_class(config=lowerCamelCase						)
												for name, param in model.named_parameters():
																# we skip lambda parameters as these require special initial values
																# determined by config.layer_scale_init_value
																if "lambda" in name:
																				continue
																if param.requires_grad:
																				self.assertIn(
																				    ((param.data.mean() * 1E9).round() / 1E9).item(),						[0.0, 1.0],						msg=F"""Parameter {name} of model {model_class} seems not properly initialized""",						)




				@slow
				def        lowercase__     (  self		:					List[Any]						):

								'''simple docstring'''
								for model_name in BEIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
												lowercase__     				=    BeitModel.from_pretrained(lowerCamelCase						)
												self.assertIsNotNone(lowerCamelCase						)






def 						a    (		):






				'''simple docstring'''
				lowercase__     				=    Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''       )
				return image




@require_torch
@require_vision
class    _UpperCAmelCase      ( unittest.TestCase			):

				"""simple docstring"""




				@cached_property
				def        lowercase__     (  self		:					Tuple						):

								'''simple docstring'''
								return BeitImageProcessor.from_pretrained('''microsoft/beit-base-patch16-224'''						) if is_vision_available() else None




				@slow
				def        lowercase__     (  self		:					str						):

								'''simple docstring'''
								lowercase__     				=    BeitForMaskedImageModeling.from_pretrained('''microsoft/beit-base-patch16-224-pt22k'''						).to(lowerCamelCase						)

								lowercase__     				=    self.default_image_processor
								lowercase__     				=    prepare_img()
								lowercase__     				=    image_processor(images=lowerCamelCase,						return_tensors='''pt'''						).pixel_values.to(lowerCamelCase						)

								# prepare bool_masked_pos
								lowercase__     				=    torch.ones((1, 196),						dtype=torch.bool						).to(lowerCamelCase						)

								# forward pass
								with torch.no_grad():
												lowercase__     				=    model(pixel_values=lowerCamelCase,						bool_masked_pos=lowerCamelCase						)
								lowercase__     				=    outputs.logits

								# verify the logits
								lowercase__     				=    torch.Size((1, 196, 8_192)						)
								self.assertEqual(logits.shape,						lowerCamelCase						)

								lowercase__     				=    torch.tensor(
								    [[-3.2437, 0.5072, -13.9174], [-3.2456, 0.4948, -13.9401], [-3.2033, 0.5121, -13.8550]]						).to(lowerCamelCase						)

								self.assertTrue(torch.allclose(logits[bool_masked_pos][:3, :3],						lowerCamelCase,						atol=1E-2						)						)




				@slow
				def        lowercase__     (  self		:					List[Any]						):

								'''simple docstring'''
								lowercase__     				=    BeitForImageClassification.from_pretrained('''microsoft/beit-base-patch16-224'''						).to(lowerCamelCase						)

								lowercase__     				=    self.default_image_processor
								lowercase__     				=    prepare_img()
								lowercase__     				=    image_processor(images=lowerCamelCase,						return_tensors='''pt'''						).to(lowerCamelCase						)

								# forward pass
								with torch.no_grad():
												lowercase__     				=    model(**lowerCamelCase						)
								lowercase__     				=    outputs.logits

								# verify the logits
								lowercase__     				=    torch.Size((1, 1_000)						)
								self.assertEqual(logits.shape,						lowerCamelCase						)

								lowercase__     				=    torch.tensor([-1.2385, -1.0987, -1.0108]						).to(lowerCamelCase						)

								self.assertTrue(torch.allclose(logits[0, :3],						lowerCamelCase,						atol=1E-4						)						)

								lowercase__     				=    281
								self.assertEqual(logits.argmax(-1						).item(),						lowerCamelCase						)




				@slow
				def        lowercase__     (  self		:					int						):

								'''simple docstring'''
								lowercase__     				=    BeitForImageClassification.from_pretrained('''microsoft/beit-large-patch16-224-pt22k-ft22k'''						).to(
								    lowerCamelCase						)

								lowercase__     				=    self.default_image_processor
								lowercase__     				=    prepare_img()
								lowercase__     				=    image_processor(images=lowerCamelCase,						return_tensors='''pt'''						).to(lowerCamelCase						)

								# forward pass
								with torch.no_grad():
												lowercase__     				=    model(**lowerCamelCase						)
								lowercase__     				=    outputs.logits

								# verify the logits
								lowercase__     				=    torch.Size((1, 21_841)						)
								self.assertEqual(logits.shape,						lowerCamelCase						)

								lowercase__     				=    torch.tensor([1.6881, -0.2787, 0.5901]						).to(lowerCamelCase						)

								self.assertTrue(torch.allclose(logits[0, :3],						lowerCamelCase,						atol=1E-4						)						)

								lowercase__     				=    2_396
								self.assertEqual(logits.argmax(-1						).item(),						lowerCamelCase						)




				@slow
				def        lowercase__     (  self		:					Optional[int]						):

								'''simple docstring'''
								lowercase__     				=    BeitForSemanticSegmentation.from_pretrained('''microsoft/beit-base-finetuned-ade-640-640'''						)
								lowercase__     				=    model.to(lowerCamelCase						)

								lowercase__     				=    BeitImageProcessor(do_resize=lowerCamelCase,						size=640,						do_center_crop=lowerCamelCase						)

								lowercase__     				=    load_dataset('''hf-internal-testing/fixtures_ade20k''',						split='''test'''						)
								lowercase__     				=    Image.open(ds[0]['''file''']						)
								lowercase__     				=    image_processor(images=lowerCamelCase,						return_tensors='''pt'''						).to(lowerCamelCase						)

								# forward pass
								with torch.no_grad():
												lowercase__     				=    model(**lowerCamelCase						)
								lowercase__     				=    outputs.logits

								# verify the logits
								lowercase__     				=    torch.Size((1, 150, 160, 160)						)
								self.assertEqual(logits.shape,						lowerCamelCase						)

								lowercase__     				=    version.parse(PIL.__version__						) < version.parse('''9.0.0'''						)

								if is_pillow_less_than_a:
												lowercase__     				=    torch.tensor(
												    [
												        [[-4.9225, -2.3954, -3.0522], [-2.8822, -1.0046, -1.7561], [-2.9549, -1.3228, -2.1347]],
												        [[-5.8168, -3.4129, -4.0778], [-3.8651, -2.2214, -3.0277], [-3.8356, -2.4643, -3.3535]],
												        [[-0.0078, 3.9952, 4.0754], [2.9856, 4.6944, 5.0035], [3.2413, 4.7813, 4.9969]],
												    ],						device=lowerCamelCase,						)
								else:
												lowercase__     				=    torch.tensor(
												    [
												        [[-4.8960, -2.3688, -3.0355], [-2.8478, -0.9836, -1.7418], [-2.9449, -1.3332, -2.1456]],
												        [[-5.8081, -3.4124, -4.1006], [-3.8561, -2.2081, -3.0323], [-3.8365, -2.4601, -3.3669]],
												        [[-0.0309, 3.9868, 4.0540], [2.9640, 4.6877, 4.9976], [3.2081, 4.7690, 4.9942]],
												    ],						device=lowerCamelCase,						)

								self.assertTrue(torch.allclose(logits[0, :3, :3, :3],						lowerCamelCase,						atol=1E-4						)						)




				@slow
				def        lowercase__     (  self		:					Optional[Any]						):

								'''simple docstring'''
								lowercase__     				=    BeitForSemanticSegmentation.from_pretrained('''microsoft/beit-base-finetuned-ade-640-640'''						)
								lowercase__     				=    model.to(lowerCamelCase						)

								lowercase__     				=    BeitImageProcessor(do_resize=lowerCamelCase,						size=640,						do_center_crop=lowerCamelCase						)

								lowercase__     				=    load_dataset('''hf-internal-testing/fixtures_ade20k''',						split='''test'''						)
								lowercase__     				=    Image.open(ds[0]['''file''']						)
								lowercase__     				=    image_processor(images=lowerCamelCase,						return_tensors='''pt'''						).to(lowerCamelCase						)

								# forward pass
								with torch.no_grad():
												lowercase__     				=    model(**lowerCamelCase						)

								lowercase__     				=    outputs.logits.detach().cpu()

								lowercase__     				=    image_processor.post_process_semantic_segmentation(outputs=lowerCamelCase,						target_sizes=[(500, 300)]						)
								lowercase__     				=    torch.Size((500, 300)						)
								self.assertEqual(segmentation[0].shape,						lowerCamelCase						)

								lowercase__     				=    image_processor.post_process_semantic_segmentation(outputs=lowerCamelCase						)
								lowercase__     				=    torch.Size((160, 160)						)
								self.assertEqual(segmentation[0].shape,						lowerCamelCase						)












import json
import os
import tempfile

import transformers

import datasets
from utils import generate_example_dataset, get_duration


A__			:    Dict         =				50_00_00

A__     ,     A__			:    str         =				os.path.split(__file__)
A__			:    Optional[Any]         =				os.path.join(RESULTS_BASEPATH, 'results', RESULTS_FILENAME.replace('.py', '.json'))






@get_duration
def 						a    (		lowerCamelCase_	,     **lowerCamelCase_       ):






				'''simple docstring'''
				lowercase__     				=    dataset.map(**lowerCamelCase_       )






@get_duration
def 						a    (		lowerCamelCase_	,     **lowerCamelCase_       ):






				'''simple docstring'''
				lowercase__     				=    dataset.filter(**lowerCamelCase_       )






def 						a    (		):






				'''simple docstring'''
				lowercase__     				=    {'''num examples''': SPEED_TEST_N_EXAMPLES}
				with tempfile.TemporaryDirectory() as tmp_dir:
								lowercase__     				=    datasets.Features({'''text''': datasets.Value('''string'''       ), '''numbers''': datasets.Value('''float32'''       )}       )
								lowercase__     				=    generate_example_dataset(
								    os.path.join(lowerCamelCase_	,     '''dataset.arrow'''       )	,     lowerCamelCase_	,     num_examples=lowerCamelCase_       )

								lowercase__     				=    transformers.AutoTokenizer.from_pretrained('''bert-base-cased'''	,     use_fast=lowerCamelCase_       )

								def tokenize(lowerCamelCase_       ):
												return tokenizer(examples['''text''']       )

								lowercase__     				=    map(lowerCamelCase_       )

								lowercase__     				=    map(lowerCamelCase_	,     batched=lowerCamelCase_       )

								lowercase__     				=    map(lowerCamelCase_	,     function=lambda lowerCamelCase_       : None	,     batched=lowerCamelCase_       )

								with dataset.formatted_as(type='''numpy'''       ):
												lowercase__     				=    map(lowerCamelCase_	,     function=lambda lowerCamelCase_       : None	,     batched=lowerCamelCase_       )

								with dataset.formatted_as(type='''pandas'''       ):
												lowercase__     				=    map(lowerCamelCase_	,     function=lambda lowerCamelCase_       : None	,     batched=lowerCamelCase_       )

								with dataset.formatted_as(type='''torch'''	,     columns='''numbers'''       ):
												lowercase__     				=    map(lowerCamelCase_	,     function=lambda lowerCamelCase_       : None	,     batched=lowerCamelCase_       )

								with dataset.formatted_as(type='''tensorflow'''	,     columns='''numbers'''       ):
												lowercase__     				=    map(lowerCamelCase_	,     function=lambda lowerCamelCase_       : None	,     batched=lowerCamelCase_       )

								lowercase__     				=    map(lowerCamelCase_	,     function=lowerCamelCase_	,     batched=lowerCamelCase_       )

								lowercase__     				=    filter(lowerCamelCase_       )

								# Activate later when tokenizer support batched inputs
								# with dataset.formatted_as(type='numpy'):
								#     times[func.__name__ + " fast-tokenizer batched numpy"] = func(dataset, function=tokenize, batched=True)

				with open(lowerCamelCase_	,     '''wb'''       ) as f:
								f.write(json.dumps(lowerCamelCase_       ).encode('''utf-8'''       )       )


if __name__ == "__main__":  # useful to run the profiler
							benchmark_map_filter()




