"""simple docstring"""
import itertools
import json
import os
import unittest

from transformers import AddedToken, LongformerTokenizer, LongformerTokenizerFast
from transformers.models.longformer.tokenization_longformer import VOCAB_FILES_NAMES
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin



@require_tokenizers
class   lowerCAmelCase_    (			lowerCAmelCase     ,    unittest.TestCase					):



				"""simple docstring"""
				_lowerCAmelCase     :    Any			  =						LongformerTokenizer
				_lowerCAmelCase     :    int			  =						True
				_lowerCAmelCase     :    Optional[int]			  =						LongformerTokenizerFast
				_lowerCAmelCase     :    Optional[Any]			  =						True

				def 		snake_case (				self    ):






										"""simple docstring"""

										super().setUp()

										# Adapted from Sennrich et al. 2015 and https://github.com/rsennrich/subword-nmt
										snake_case								=			[
										    'l',
										    'o',
										    'w',
										    'e',
										    'r',
										    's',
										    't',
										    'i',
										    'd',
										    'n',
										    '\u0120',
										    '\u0120l',
										    '\u0120n',
										    '\u0120lo',
										    '\u0120low',
										    'er',
										    '\u0120lowest',
										    '\u0120newer',
										    '\u0120wider',
										    '<unk>',
										]
										snake_case								=			dict(zip(lowerCAmelCase		,    range(len(lowerCAmelCase    )    )    )    )
										snake_case								=			['#version: 0.2', '\u0120 l', '\u0120l o', '\u0120lo w', 'e r', '']
										snake_case								=			{'unk_token': '<unk>'}

										snake_case								=			os.path.join(self.tmpdirname		,    VOCAB_FILES_NAMES['vocab_file']    )
										snake_case								=			os.path.join(self.tmpdirname		,    VOCAB_FILES_NAMES['merges_file']    )
										with open(self.vocab_file		,    'w'		,    encoding='utf-8'    ) as fp:
																fp.write(json.dumps(lowerCAmelCase    ) + '\n'    )
										with open(self.merges_file		,    'w'		,    encoding='utf-8'    ) as fp:
																fp.write('\n'.join(lowerCAmelCase    )    )

				def 		snake_case (				self		,    **lowerCAmelCase    ):






										"""simple docstring"""

										kwargs.update(self.special_tokens_map    )
										return self.tokenizer_class.from_pretrained(self.tmpdirname		,    **lowerCAmelCase    )

				def 		snake_case (				self		,    **lowerCAmelCase    ):






										"""simple docstring"""

										kwargs.update(self.special_tokens_map    )
										return self.rust_tokenizer_class.from_pretrained(self.tmpdirname		,    **lowerCAmelCase    )

				def 		snake_case (				self		,    lowerCAmelCase    ):






										"""simple docstring"""

										snake_case								=			'lower newer'
										snake_case								=			'lower newer'
										return input_text, output_text

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.tokenizer_class(self.vocab_file		,    self.merges_file		,    **self.special_tokens_map    )
										snake_case								=			'lower newer'
										snake_case								=			['l', 'o', 'w', 'er', '\u0120', 'n', 'e', 'w', 'er']
										snake_case								=			tokenizer.tokenize(lowerCAmelCase    )  # , add_prefix_space=True)
										self.assertListEqual(lowerCAmelCase		,    lowerCAmelCase    )

										snake_case								=			tokens + [tokenizer.unk_token]
										snake_case								=			[0, 1, 2, 15, 10, 9, 3, 2, 15, 19]
										self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCAmelCase    )		,    lowerCAmelCase    )

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.get_tokenizer()

										self.assertListEqual(tokenizer.encode('Hello world!'		,    add_special_tokens=lowerCAmelCase    )		,    [0, 3_14_14, 2_32, 3_28, 2]    )
										self.assertListEqual(
										    tokenizer.encode('Hello world! cécé herlolip 418'		,    add_special_tokens=lowerCAmelCase    )		,    [0, 3_14_14, 2_32, 3_28, 7_40, 11_40, 1_26_95, 69, 4_60_78, 15_88, 2]		,    )

				@slow
				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.tokenizer_class.from_pretrained('allenai/longformer-base-4096'    )

										snake_case								=			tokenizer.encode('sequence builders'		,    add_special_tokens=lowerCAmelCase    )
										snake_case								=			tokenizer.encode('multi-sequence build'		,    add_special_tokens=lowerCAmelCase    )

										snake_case								=			tokenizer.encode(
										    'sequence builders'		,    add_special_tokens=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase    )
										snake_case								=			tokenizer.encode(
										    'sequence builders'		,    'multi-sequence build'		,    add_special_tokens=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase    )

										snake_case								=			tokenizer.build_inputs_with_special_tokens(lowerCAmelCase    )
										snake_case								=			tokenizer.build_inputs_with_special_tokens(lowerCAmelCase		,    lowerCAmelCase    )

										assert encoded_sentence == encoded_text_from_decode
										assert encoded_pair == encoded_pair_from_decode

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.get_tokenizer()

										snake_case								=			'Encode this sequence.'
										snake_case								=			tokenizer.byte_encoder[' '.encode('utf-8'    )[0]]

										# Testing encoder arguments
										snake_case								=			tokenizer.encode(lowerCAmelCase		,    add_special_tokens=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase    )
										snake_case								=			tokenizer.convert_ids_to_tokens(encoded[0]    )[0]
										self.assertNotEqual(lowerCAmelCase		,    lowerCAmelCase    )

										snake_case								=			tokenizer.encode(lowerCAmelCase		,    add_special_tokens=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase    )
										snake_case								=			tokenizer.convert_ids_to_tokens(encoded[0]    )[0]
										self.assertEqual(lowerCAmelCase		,    lowerCAmelCase    )

										tokenizer.add_special_tokens({'bos_token': '<s>'}    )
										snake_case								=			tokenizer.encode(lowerCAmelCase		,    add_special_tokens=lowerCAmelCase    )
										snake_case								=			tokenizer.convert_ids_to_tokens(encoded[1]    )[0]
										self.assertNotEqual(lowerCAmelCase		,    lowerCAmelCase    )

										# Testing spaces after special tokens
										snake_case								=			'<mask>'
										tokenizer.add_special_tokens(
										    {'mask_token': AddedToken(lowerCAmelCase		,    lstrip=lowerCAmelCase		,    rstrip=lowerCAmelCase    )}    )  # mask token has a left space
										snake_case								=			tokenizer.convert_tokens_to_ids(lowerCAmelCase    )

										snake_case								=			'Encode <mask> sequence'
										snake_case								=			'Encode <mask>sequence'

										snake_case								=			tokenizer.encode(lowerCAmelCase    )
										snake_case								=			encoded.index(lowerCAmelCase    )
										snake_case								=			tokenizer.convert_ids_to_tokens(encoded[mask_loc + 1]    )[0]
										self.assertEqual(lowerCAmelCase		,    lowerCAmelCase    )

										snake_case								=			tokenizer.encode(lowerCAmelCase    )
										snake_case								=			encoded.index(lowerCAmelCase    )
										snake_case								=			tokenizer.convert_ids_to_tokens(encoded[mask_loc + 1]    )[0]
										self.assertNotEqual(lowerCAmelCase		,    lowerCAmelCase    )

				def 		snake_case (				self    ):






										"""simple docstring"""

										pass

				def 		snake_case (				self    ):






										"""simple docstring"""

										for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
																with self.subTest(F"""{tokenizer.__class__.__name__} ({pretrained_name})"""    ):
																						snake_case								=			self.rust_tokenizer_class.from_pretrained(lowerCAmelCase		,    **lowerCAmelCase    )
																						snake_case								=			self.tokenizer_class.from_pretrained(lowerCAmelCase		,    **lowerCAmelCase    )
																						snake_case								=			'A, <mask> AllenNLP sentence.'
																						snake_case								=			tokenizer_r.encode_plus(lowerCAmelCase		,    add_special_tokens=lowerCAmelCase		,    return_token_type_ids=lowerCAmelCase    )
																						snake_case								=			tokenizer_p.encode_plus(lowerCAmelCase		,    add_special_tokens=lowerCAmelCase		,    return_token_type_ids=lowerCAmelCase    )

																						# token_type_ids should put 0 everywhere
																						self.assertEqual(sum(tokens_r['token_type_ids']    )		,    sum(tokens_p['token_type_ids']    )    )

																						# attention_mask should put 1 everywhere, so sum over length should be 1
																						self.assertEqual(
																						    sum(tokens_r['attention_mask']    ) / len(tokens_r['attention_mask']    )		,    sum(tokens_p['attention_mask']    ) / len(tokens_p['attention_mask']    )		,    )

																						snake_case								=			tokenizer_r.convert_ids_to_tokens(tokens_r['input_ids']    )
																						snake_case								=			tokenizer_p.convert_ids_to_tokens(tokens_p['input_ids']    )

																						# Rust correctly handles the space before the mask while python doesnt
																						self.assertSequenceEqual(tokens_p['input_ids']		,    [0, 2_50, 6, 5_02_64, 38_23, 4_87, 2_19_92, 36_45, 4, 2]    )
																						self.assertSequenceEqual(tokens_r['input_ids']		,    [0, 2_50, 6, 5_02_64, 38_23, 4_87, 2_19_92, 36_45, 4, 2]    )

																						self.assertSequenceEqual(
																						    lowerCAmelCase		,    ['<s>', 'A', ',', '<mask>', 'ĠAllen', 'N', 'LP', 'Ġsentence', '.', '</s>']    )
																						self.assertSequenceEqual(
																						    lowerCAmelCase		,    ['<s>', 'A', ',', '<mask>', 'ĠAllen', 'N', 'LP', 'Ġsentence', '.', '</s>']    )

				def 		snake_case (				self    ):






										"""simple docstring"""

										for trim_offsets, add_prefix_space in itertools.product([True, False]		,    repeat=2    ):
																snake_case								=			self.rust_tokenizer_class.from_pretrained(
																    self.tmpdirname		,    use_fast=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase		,    trim_offsets=lowerCAmelCase    )

																snake_case								=			json.loads(tokenizer_r.backend_tokenizer.pre_tokenizer.__getstate__()    )
																snake_case								=			json.loads(tokenizer_r.backend_tokenizer.post_processor.__getstate__()    )

																self.assertEqual(pre_tokenizer_state['add_prefix_space']		,    lowerCAmelCase    )

																self.assertEqual(post_processor_state['add_prefix_space']		,    lowerCAmelCase    )
																self.assertEqual(post_processor_state['trim_offsets']		,    lowerCAmelCase    )

				def 		snake_case (				self    ):






										"""simple docstring"""

										for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
																with self.subTest(F"""{tokenizer.__class__.__name__} ({pretrained_name})"""    ):
																						snake_case								=			'hello'  # `hello` is a token in the vocabulary of `pretrained_name`
																						snake_case								=			F"""{text_of_1_token} {text_of_1_token}"""

																						snake_case								=			self.rust_tokenizer_class.from_pretrained(
																						    lowerCAmelCase		,    use_fast=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase		,    trim_offsets=lowerCAmelCase    )
																						snake_case								=			tokenizer_r(lowerCAmelCase		,    return_offsets_mapping=lowerCAmelCase		,    add_special_tokens=lowerCAmelCase    )
																						self.assertEqual(encoding.offset_mapping[0]		,    (0, len(lowerCAmelCase    ))    )
																						self.assertEqual(
																						    encoding.offset_mapping[1]		,    (len(lowerCAmelCase    ) + 1, len(lowerCAmelCase    ) + 1 + len(lowerCAmelCase    ))		,    )

																						snake_case								=			self.rust_tokenizer_class.from_pretrained(
																						    lowerCAmelCase		,    use_fast=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase		,    trim_offsets=lowerCAmelCase    )
																						snake_case								=			tokenizer_r(lowerCAmelCase		,    return_offsets_mapping=lowerCAmelCase		,    add_special_tokens=lowerCAmelCase    )
																						self.assertEqual(encoding.offset_mapping[0]		,    (0, len(lowerCAmelCase    ))    )
																						self.assertEqual(
																						    encoding.offset_mapping[1]		,    (len(lowerCAmelCase    ) + 1, len(lowerCAmelCase    ) + 1 + len(lowerCAmelCase    ))		,    )

																						snake_case								=			self.rust_tokenizer_class.from_pretrained(
																						    lowerCAmelCase		,    use_fast=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase		,    trim_offsets=lowerCAmelCase    )
																						snake_case								=			tokenizer_r(lowerCAmelCase		,    return_offsets_mapping=lowerCAmelCase		,    add_special_tokens=lowerCAmelCase    )
																						self.assertEqual(encoding.offset_mapping[0]		,    (0, len(lowerCAmelCase    ))    )
																						self.assertEqual(
																						    encoding.offset_mapping[1]		,    (len(lowerCAmelCase    ), len(lowerCAmelCase    ) + 1 + len(lowerCAmelCase    ))		,    )

																						snake_case								=			self.rust_tokenizer_class.from_pretrained(
																						    lowerCAmelCase		,    use_fast=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase		,    trim_offsets=lowerCAmelCase    )
																						snake_case								=			tokenizer_r(lowerCAmelCase		,    return_offsets_mapping=lowerCAmelCase		,    add_special_tokens=lowerCAmelCase    )
																						self.assertEqual(encoding.offset_mapping[0]		,    (0, len(lowerCAmelCase    ))    )
																						self.assertEqual(
																						    encoding.offset_mapping[1]		,    (len(lowerCAmelCase    ), len(lowerCAmelCase    ) + 1 + len(lowerCAmelCase    ))		,    )

																						snake_case								=			F""" {text}"""

																						# tokenizer_r = self.rust_tokenizer_class.from_pretrained(
																						#     pretrained_name, use_fast=True, add_prefix_space=True, trim_offsets=True
																						# )
																						# encoding = tokenizer_r(text, return_offsets_mapping=True, add_special_tokens=False)
																						# self.assertEqual(encoding.offset_mapping[0], (1, 1 + len(text_of_1_token)))
																						# self.assertEqual(
																						#     encoding.offset_mapping[1],
																						#     (1 + len(text_of_1_token) + 1, 1 + len(text_of_1_token) + 1 + len(text_of_1_token)),
																						# )

																						snake_case								=			self.rust_tokenizer_class.from_pretrained(
																						    lowerCAmelCase		,    use_fast=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase		,    trim_offsets=lowerCAmelCase    )
																						snake_case								=			tokenizer_r(lowerCAmelCase		,    return_offsets_mapping=lowerCAmelCase		,    add_special_tokens=lowerCAmelCase    )
																						self.assertEqual(encoding.offset_mapping[0]		,    (1, 1 + len(lowerCAmelCase    ))    )
																						self.assertEqual(
																						    encoding.offset_mapping[1]		,    (1 + len(lowerCAmelCase    ) + 1, 1 + len(lowerCAmelCase    ) + 1 + len(lowerCAmelCase    ))		,    )

																						snake_case								=			self.rust_tokenizer_class.from_pretrained(
																						    lowerCAmelCase		,    use_fast=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase		,    trim_offsets=lowerCAmelCase    )
																						snake_case								=			tokenizer_r(lowerCAmelCase		,    return_offsets_mapping=lowerCAmelCase		,    add_special_tokens=lowerCAmelCase    )
																						self.assertEqual(encoding.offset_mapping[0]		,    (0, 1 + len(lowerCAmelCase    ))    )
																						self.assertEqual(
																						    encoding.offset_mapping[1]		,    (1 + len(lowerCAmelCase    ), 1 + len(lowerCAmelCase    ) + 1 + len(lowerCAmelCase    ))		,    )

																						snake_case								=			self.rust_tokenizer_class.from_pretrained(
																						    lowerCAmelCase		,    use_fast=lowerCAmelCase		,    add_prefix_space=lowerCAmelCase		,    trim_offsets=lowerCAmelCase    )
																						snake_case								=			tokenizer_r(lowerCAmelCase		,    return_offsets_mapping=lowerCAmelCase		,    add_special_tokens=lowerCAmelCase    )
																						self.assertEqual(encoding.offset_mapping[0]		,    (0, 1 + len(lowerCAmelCase    ))    )
																						self.assertEqual(
																						    encoding.offset_mapping[1]		,    (1 + len(lowerCAmelCase    ), 1 + len(lowerCAmelCase    ) + 1 + len(lowerCAmelCase    ))		,    )



"""simple docstring"""
import unittest

import numpy as np

from transformers.testing_utils import is_flaky, require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
					import torch

if is_vision_available():
					from PIL import Image

					from transformers import DonutImageProcessor



class   lowerCAmelCase_    (			unittest.TestCase					):



				"""simple docstring"""

				def __init__(				self		,    lowerCAmelCase		,    lowerCAmelCase=7		,    lowerCAmelCase=3		,    lowerCAmelCase=18		,    lowerCAmelCase=30		,    lowerCAmelCase=4_00		,    lowerCAmelCase=True		,    lowerCAmelCase=None		,    lowerCAmelCase=True		,    lowerCAmelCase=False		,    lowerCAmelCase=True		,    lowerCAmelCase=True		,    lowerCAmelCase=[0.5, 0.5, 0.5]		,    lowerCAmelCase=[0.5, 0.5, 0.5]		,    ):






										"""simple docstring"""

										snake_case								=			parent
										snake_case								=			batch_size
										snake_case								=			num_channels
										snake_case								=			image_size
										snake_case								=			min_resolution
										snake_case								=			max_resolution
										snake_case								=			do_resize
										snake_case								=			size if size is not None else {'height': 18, 'width': 20}
										snake_case								=			do_thumbnail
										snake_case								=			do_align_axis
										snake_case								=			do_pad
										snake_case								=			do_normalize
										snake_case								=			image_mean
										snake_case								=			image_std

				def 		snake_case (				self    ):






										"""simple docstring"""

										return {
										    "do_resize": self.do_resize,
										    "size": self.size,
										    "do_thumbnail": self.do_thumbnail,
										    "do_align_long_axis": self.do_align_axis,
										    "do_pad": self.do_pad,
										    "do_normalize": self.do_normalize,
										    "image_mean": self.image_mean,
										    "image_std": self.image_std,
										}





@require_torch
@require_vision
class   lowerCAmelCase_    (			lowerCAmelCase     ,    unittest.TestCase					):



				"""simple docstring"""
				_lowerCAmelCase     :    str			  =						DonutImageProcessor if is_vision_available() else None

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			DonutImageProcessingTester(self    )

				@property
				def 		snake_case (				self    ):






										"""simple docstring"""

										return self.image_processor_tester.prepare_image_processor_dict()

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.image_processing_class(**self.image_processor_dict    )
										self.assertTrue(hasattr(lowerCAmelCase		,    'do_resize'    )    )
										self.assertTrue(hasattr(lowerCAmelCase		,    'size'    )    )
										self.assertTrue(hasattr(lowerCAmelCase		,    'do_thumbnail'    )    )
										self.assertTrue(hasattr(lowerCAmelCase		,    'do_align_long_axis'    )    )
										self.assertTrue(hasattr(lowerCAmelCase		,    'do_pad'    )    )
										self.assertTrue(hasattr(lowerCAmelCase		,    'do_normalize'    )    )
										self.assertTrue(hasattr(lowerCAmelCase		,    'image_mean'    )    )
										self.assertTrue(hasattr(lowerCAmelCase		,    'image_std'    )    )

				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.image_processing_class.from_dict(self.image_processor_dict    )
										self.assertEqual(image_processor.size		,    {'height': 18, 'width': 20}    )

										snake_case								=			self.image_processing_class.from_dict(self.image_processor_dict		,    size=42    )
										self.assertEqual(image_processor.size		,    {'height': 42, 'width': 42}    )

										# Previous config had dimensions in (width, height) order
										snake_case								=			self.image_processing_class.from_dict(self.image_processor_dict		,    size=(42, 84)    )
										self.assertEqual(image_processor.size		,    {'height': 84, 'width': 42}    )

				def 		snake_case (				self    ):






										"""simple docstring"""

										pass

				@is_flaky()
				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.image_processing_class(**self.image_processor_dict    )
										# create random PIL images
										snake_case								=			prepare_image_inputs(self.image_processor_tester		,    equal_resolution=lowerCAmelCase    )
										for image in image_inputs:
																self.assertIsInstance(lowerCAmelCase		,    Image.Image    )

										# Test not batched input
										snake_case								=			image_processing(image_inputs[0]		,    return_tensors='pt'    ).pixel_values
										self.assertEqual(
										    encoded_images.shape		,    (
										        1,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.size['height'],
										        self.image_processor_tester.size['width'],
										    )		,    )

										# Test batched
										snake_case								=			image_processing(lowerCAmelCase		,    return_tensors='pt'    ).pixel_values
										self.assertEqual(
										    encoded_images.shape		,    (
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.size['height'],
										        self.image_processor_tester.size['width'],
										    )		,    )

				@is_flaky()
				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.image_processing_class(**self.image_processor_dict    )
										# create random numpy tensors
										snake_case								=			prepare_image_inputs(self.image_processor_tester		,    equal_resolution=lowerCAmelCase		,    numpify=lowerCAmelCase    )
										for image in image_inputs:
																self.assertIsInstance(lowerCAmelCase		,    np.ndarray    )

										# Test not batched input
										snake_case								=			image_processing(image_inputs[0]		,    return_tensors='pt'    ).pixel_values
										self.assertEqual(
										    encoded_images.shape		,    (
										        1,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.size['height'],
										        self.image_processor_tester.size['width'],
										    )		,    )

										# Test batched
										snake_case								=			image_processing(lowerCAmelCase		,    return_tensors='pt'    ).pixel_values
										self.assertEqual(
										    encoded_images.shape		,    (
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.size['height'],
										        self.image_processor_tester.size['width'],
										    )		,    )

				@is_flaky()
				def 		snake_case (				self    ):






										"""simple docstring"""

										snake_case								=			self.image_processing_class(**self.image_processor_dict    )
										# create random PyTorch tensors
										snake_case								=			prepare_image_inputs(self.image_processor_tester		,    equal_resolution=lowerCAmelCase		,    torchify=lowerCAmelCase    )
										for image in image_inputs:
																self.assertIsInstance(lowerCAmelCase		,    torch.Tensor    )

										# Test not batched input
										snake_case								=			image_processing(image_inputs[0]		,    return_tensors='pt'    ).pixel_values
										self.assertEqual(
										    encoded_images.shape		,    (
										        1,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.size['height'],
										        self.image_processor_tester.size['width'],
										    )		,    )

										# Test batched
										snake_case								=			image_processing(lowerCAmelCase		,    return_tensors='pt'    ).pixel_values
										self.assertEqual(
										    encoded_images.shape		,    (
										        self.image_processor_tester.batch_size,
										        self.image_processor_tester.num_channels,
										        self.image_processor_tester.size['height'],
										        self.image_processor_tester.size['width'],
										    )		,    )


