



import argparse

import huggingface_hub
import k_diffusion as K
import torch

from diffusers import UNetaDConditionModel


A__  :  List[Any]       = '''pcuenq/k-upscaler'''


def       UpperCamelCase(  __UpperCamelCase							:		List[str]					,__UpperCamelCase							:		Tuple					,*, __UpperCamelCase							:		str					,__UpperCamelCase							:		str			):
		lowerCAmelCase_      :					Tuple     =			{
		    # norm1
		    f"""{diffusers_resnet_prefix}.norm1.linear.weight""": checkpoint[f"""{resnet_prefix}.main.0.mapper.weight"""],
		    f"""{diffusers_resnet_prefix}.norm1.linear.bias""": checkpoint[f"""{resnet_prefix}.main.0.mapper.bias"""],
		    # conv1
		    f"""{diffusers_resnet_prefix}.conv1.weight""": checkpoint[f"""{resnet_prefix}.main.2.weight"""],
		    f"""{diffusers_resnet_prefix}.conv1.bias""": checkpoint[f"""{resnet_prefix}.main.2.bias"""],
		    # norm2
		    f"""{diffusers_resnet_prefix}.norm2.linear.weight""": checkpoint[f"""{resnet_prefix}.main.4.mapper.weight"""],
		    f"""{diffusers_resnet_prefix}.norm2.linear.bias""": checkpoint[f"""{resnet_prefix}.main.4.mapper.bias"""],
		    # conv2
		    f"""{diffusers_resnet_prefix}.conv2.weight""": checkpoint[f"""{resnet_prefix}.main.6.weight"""],
		    f"""{diffusers_resnet_prefix}.conv2.bias""": checkpoint[f"""{resnet_prefix}.main.6.bias"""],
		}

		if resnet.conv_shortcut is not None:
				rv.update(
				    {
				        f"""{diffusers_resnet_prefix}.conv_shortcut.weight""": checkpoint[f"""{resnet_prefix}.skip.weight"""],
				    }			)

		return rv


def       UpperCamelCase(  __UpperCamelCase							:		Union[str, Any]					,*, __UpperCamelCase							:		Optional[int]					,__UpperCamelCase							:		Dict			):
		lowerCAmelCase_ ,  lowerCAmelCase_ ,  lowerCAmelCase_      :					Optional[Any]     =			checkpoint[f"""{attention_prefix}.qkv_proj.weight"""].chunk(3					,dim=0			)
		lowerCAmelCase_ ,  lowerCAmelCase_ ,  lowerCAmelCase_      :					List[Any]     =			checkpoint[f"""{attention_prefix}.qkv_proj.bias"""].chunk(3					,dim=0			)
		lowerCAmelCase_      :					Union[str, Any]     =			{
		    # norm
		    f"""{diffusers_attention_prefix}.norm1.linear.weight""": checkpoint[f"""{attention_prefix}.norm_in.mapper.weight"""],
		    f"""{diffusers_attention_prefix}.norm1.linear.bias""": checkpoint[f"""{attention_prefix}.norm_in.mapper.bias"""],
		    # to_q
		    f"""{diffusers_attention_prefix}.attn1.to_q.weight""": weight_q.squeeze(-1			).squeeze(-1			),
		    f"""{diffusers_attention_prefix}.attn1.to_q.bias""": bias_q,
		    # to_k
		    f"""{diffusers_attention_prefix}.attn1.to_k.weight""": weight_k.squeeze(-1			).squeeze(-1			),
		    f"""{diffusers_attention_prefix}.attn1.to_k.bias""": bias_k,
		    # to_v
		    f"""{diffusers_attention_prefix}.attn1.to_v.weight""": weight_v.squeeze(-1			).squeeze(-1			),
		    f"""{diffusers_attention_prefix}.attn1.to_v.bias""": bias_v,
		    # to_out
		    f"""{diffusers_attention_prefix}.attn1.to_out.0.weight""": checkpoint[f"""{attention_prefix}.out_proj.weight"""]
		    .squeeze(-1			)
		    .squeeze(-1			),
		    f"""{diffusers_attention_prefix}.attn1.to_out.0.bias""": checkpoint[f"""{attention_prefix}.out_proj.bias"""],
		}

		return rv


def       UpperCamelCase(  __UpperCamelCase							:		Union[str, Any]					,*, __UpperCamelCase							:		Dict					,__UpperCamelCase							:		int					,__UpperCamelCase							:		Union[str, Any]			):
		lowerCAmelCase_ ,  lowerCAmelCase_      :					int     =			checkpoint[f"""{attention_prefix}.kv_proj.weight"""].chunk(2					,dim=0			)
		lowerCAmelCase_ ,  lowerCAmelCase_      :					List[str]     =			checkpoint[f"""{attention_prefix}.kv_proj.bias"""].chunk(2					,dim=0			)

		lowerCAmelCase_      :					List[str]     =			{
		    # norm2 (ada groupnorm)
		    f"""{diffusers_attention_prefix}.norm{diffusers_attention_index}.linear.weight""": checkpoint[
		        f"""{attention_prefix}.norm_dec.mapper.weight"""
		    ],
		    f"""{diffusers_attention_prefix}.norm{diffusers_attention_index}.linear.bias""": checkpoint[
		        f"""{attention_prefix}.norm_dec.mapper.bias"""
		    ],
		    # layernorm on encoder_hidden_state
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.norm_cross.weight""": checkpoint[
		        f"""{attention_prefix}.norm_enc.weight"""
		    ],
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.norm_cross.bias""": checkpoint[
		        f"""{attention_prefix}.norm_enc.bias"""
		    ],
		    # to_q
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.to_q.weight""": checkpoint[
		        f"""{attention_prefix}.q_proj.weight"""
		    ]
		    .squeeze(-1			)
		    .squeeze(-1			),
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.to_q.bias""": checkpoint[
		        f"""{attention_prefix}.q_proj.bias"""
		    ],
		    # to_k
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.to_k.weight""": weight_k.squeeze(-1			).squeeze(-1			),
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.to_k.bias""": bias_k,
		    # to_v
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.to_v.weight""": weight_v.squeeze(-1			).squeeze(-1			),
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.to_v.bias""": bias_v,
		    # to_out
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.to_out.0.weight""": checkpoint[
		        f"""{attention_prefix}.out_proj.weight"""
		    ]
		    .squeeze(-1			)
		    .squeeze(-1			),
		    f"""{diffusers_attention_prefix}.attn{diffusers_attention_index}.to_out.0.bias""": checkpoint[
		        f"""{attention_prefix}.out_proj.bias"""
		    ],
		}

		return rv


def       UpperCamelCase(  __UpperCamelCase							:		List[Any]					,__UpperCamelCase							:		str					,__UpperCamelCase							:		Any					,__UpperCamelCase							:		Optional[Any]			):
		lowerCAmelCase_      :					str     =			'''inner_model.u_net.u_blocks''' if block_type == '''up''' else '''inner_model.u_net.d_blocks'''
		lowerCAmelCase_      :					int     =			f"""{block_prefix}.{block_idx}"""

		lowerCAmelCase_      :					int     =			{}

		if not hasattr(__UpperCamelCase					,'''attentions'''			):
				lowerCAmelCase_      :					Dict     =			1  # resnet only
		elif not block.attentions[0].add_self_attention:
				lowerCAmelCase_      :					Union[str, Any]     =			2  # resnet -> cross-attention
		else:
				lowerCAmelCase_      :					str     =			3  # resnet -> self-attention -> cross-attention)

		for resnet_idx, resnet in enumerate(block.resnets			):
				# diffusers_resnet_prefix = f"{diffusers_up_block_prefix}.resnets.{resnet_idx}"
				lowerCAmelCase_      :					Union[str, Any]     =			f"""{block_type}_blocks.{block_idx}.resnets.{resnet_idx}"""
				lowerCAmelCase_      :					Dict     =			n * resnet_idx if block_type == '''up''' else n * resnet_idx + 1
				lowerCAmelCase_      :					List[str]     =			f"""{block_prefix}.{idx}""" if block_type == '''up''' else f"""{block_prefix}.{idx}"""

				diffusers_checkpoint.update(
				    resnet_to_diffusers_checkpoint(
				        __UpperCamelCase					,__UpperCamelCase					,diffusers_resnet_prefix=__UpperCamelCase					,resnet_prefix=__UpperCamelCase			)			)

		if hasattr(__UpperCamelCase					,'''attentions'''			):
				for attention_idx, attention in enumerate(block.attentions			):
						lowerCAmelCase_      :					Optional[Any]     =			f"""{block_type}_blocks.{block_idx}.attentions.{attention_idx}"""
						lowerCAmelCase_      :					Any     =			n * attention_idx + 1 if block_type == '''up''' else n * attention_idx + 2
						lowerCAmelCase_      :					str     =			f"""{block_prefix}.{idx}"""
						lowerCAmelCase_      :					Any     =			f"""{block_prefix}.{idx }"""
						lowerCAmelCase_      :					List[str]     =			1 if not attention.add_self_attention else 2
						lowerCAmelCase_      :					int     =			(
						    n * attention_idx + cross_attention_index
						    if block_type == '''up'''
						    else n * attention_idx + cross_attention_index + 1
						)
						lowerCAmelCase_      :					Union[str, Any]     =			f"""{block_prefix}.{idx }"""

						diffusers_checkpoint.update(
						    cross_attn_to_diffusers_checkpoint(
						        __UpperCamelCase					,diffusers_attention_prefix=__UpperCamelCase					,diffusers_attention_index=2					,attention_prefix=__UpperCamelCase					,)			)

						if attention.add_self_attention is True:
								diffusers_checkpoint.update(
								    self_attn_to_diffusers_checkpoint(
								        __UpperCamelCase					,diffusers_attention_prefix=__UpperCamelCase					,attention_prefix=__UpperCamelCase					,)			)

		return diffusers_checkpoint


def       UpperCamelCase(  __UpperCamelCase							:		Optional[Any]					,__UpperCamelCase							:		Tuple			):
		lowerCAmelCase_      :					Tuple     =			{}

		# pre-processing
		diffusers_checkpoint.update(
		    {
		        '''conv_in.weight''': checkpoint['''inner_model.proj_in.weight'''],
		        '''conv_in.bias''': checkpoint['''inner_model.proj_in.bias'''],
		    }			)

		# timestep and class embedding
		diffusers_checkpoint.update(
		    {
		        '''time_proj.weight''': checkpoint['''inner_model.timestep_embed.weight'''].squeeze(-1			),
		        '''time_embedding.linear_1.weight''': checkpoint['''inner_model.mapping.0.weight'''],
		        '''time_embedding.linear_1.bias''': checkpoint['''inner_model.mapping.0.bias'''],
		        '''time_embedding.linear_2.weight''': checkpoint['''inner_model.mapping.2.weight'''],
		        '''time_embedding.linear_2.bias''': checkpoint['''inner_model.mapping.2.bias'''],
		        '''time_embedding.cond_proj.weight''': checkpoint['''inner_model.mapping_cond.weight'''],
		    }			)

		# down_blocks
		for down_block_idx, down_block in enumerate(model.down_blocks			):
				diffusers_checkpoint.update(block_to_diffusers_checkpoint(__UpperCamelCase					,__UpperCamelCase					,__UpperCamelCase					,'''down'''			)			)

		# up_blocks
		for up_block_idx, up_block in enumerate(model.up_blocks			):
				diffusers_checkpoint.update(block_to_diffusers_checkpoint(__UpperCamelCase					,__UpperCamelCase					,__UpperCamelCase					,'''up'''			)			)

		# post-processing
		diffusers_checkpoint.update(
		    {
		        '''conv_out.weight''': checkpoint['''inner_model.proj_out.weight'''],
		        '''conv_out.bias''': checkpoint['''inner_model.proj_out.bias'''],
		    }			)

		return diffusers_checkpoint


def       UpperCamelCase(  __UpperCamelCase							:		int			):
		lowerCAmelCase_      :					Dict     =			original_config['''input_channels'''] + original_config['''unet_cond_dim''']
		lowerCAmelCase_      :					Optional[int]     =			original_config['''input_channels'''] + (1 if original_config['''has_variance'''] else 0)

		lowerCAmelCase_      :					Any     =			original_config['''channels''']

		assert (
		    len(set(original_config['''depths''']			)			) == 1
		), "UNet2DConditionModel currently do not support blocks with different number of layers"
		lowerCAmelCase_      :					str     =			original_config['''depths'''][0]

		lowerCAmelCase_      :					str     =			original_config['''mapping_cond_dim''']
		lowerCAmelCase_      :					List[str]     =			original_config['''cross_cond_dim''']

		lowerCAmelCase_      :					str     =			[]
		lowerCAmelCase_      :					Optional[int]     =			[]
		for s, c in zip(original_config['''self_attn_depths''']					,original_config['''cross_attn_depths''']			):
				if s:
						lowerCAmelCase_      :					Union[str, Any]     =			'''self'''
						lowerCAmelCase_      :					str     =			'''cross''' if c else None
				elif c:
						lowerCAmelCase_      :					List[Any]     =			'''cross'''
						lowerCAmelCase_      :					List[str]     =			None
				else:
						lowerCAmelCase_      :					Any     =			None
						lowerCAmelCase_      :					List[Any]     =			None
				attna_types.append(__UpperCamelCase			)
				attna_types.append(__UpperCamelCase			)

		lowerCAmelCase_      :					Dict     =			UNetaDConditionModel(
		    in_channels=__UpperCamelCase					,out_channels=__UpperCamelCase					,down_block_types=('''KDownBlock2D''', '''KCrossAttnDownBlock2D''', '''KCrossAttnDownBlock2D''', '''KCrossAttnDownBlock2D''')					,mid_block_type=__UpperCamelCase					,up_block_types=('''KCrossAttnUpBlock2D''', '''KCrossAttnUpBlock2D''', '''KCrossAttnUpBlock2D''', '''KUpBlock2D''')					,block_out_channels=__UpperCamelCase					,layers_per_block=__UpperCamelCase					,act_fn='''gelu'''					,norm_num_groups=__UpperCamelCase					,cross_attention_dim=__UpperCamelCase					,attention_head_dim=64					,time_cond_proj_dim=__UpperCamelCase					,resnet_time_scale_shift='''scale_shift'''					,time_embedding_type='''fourier'''					,timestep_post_act='''gelu'''					,conv_in_kernel=1					,conv_out_kernel=1					,)

		return unet


def       UpperCamelCase(  __UpperCamelCase							:		List[Any]			):
		lowerCAmelCase_      :					Dict     =			torch.device('''cuda''' if torch.cuda.is_available() else '''cpu'''			)

		lowerCAmelCase_      :					Any     =			huggingface_hub.hf_hub_download(__UpperCamelCase					,'''config_laion_text_cond_latent_upscaler_2.json'''			)
		lowerCAmelCase_      :					Union[str, Any]     =			huggingface_hub.hf_hub_download(
		    __UpperCamelCase					,'''laion_text_cond_latent_upscaler_2_1_00470000_slim.pth'''			)
		print(f"""loading original model configuration from {orig_config_path}"""			)
		print(f"""loading original model checkpoint from {orig_weights_path}"""			)

		print('''converting to diffusers unet'''			)
		lowerCAmelCase_      :					Dict     =			K.config.load_config(open(__UpperCamelCase			)			)['''model''']
		lowerCAmelCase_      :					Dict     =			unet_model_from_original_config(__UpperCamelCase			)

		lowerCAmelCase_      :					Any     =			torch.load(__UpperCamelCase					,map_location=__UpperCamelCase			)['''model_ema''']
		lowerCAmelCase_      :					Union[str, Any]     =			unet_to_diffusers_checkpoint(__UpperCamelCase					,__UpperCamelCase			)

		model.load_state_dict(__UpperCamelCase					,strict=__UpperCamelCase			)
		model.save_pretrained(args.dump_path			)
		print(f"""saving converted unet model in {args.dump_path}"""			)


if __name__ == "__main__":
						A__  :  Optional[int]       = argparse.ArgumentParser()

						parser.add_argument('''--dump_path''', default=None, type=str, required=True, help='''Path to the output model.''')
						A__  :  List[str]       = parser.parse_args()

						main(args)










import unittest

import numpy as np

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

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_video_inputs


if is_torch_available():
						import torch

if is_vision_available():
						from PIL import Image

						from transformers import VideoMAEImageProcessor



class     __snake_case						(					unittest.TestCase						):




							def __init__(	self					:	str    ,    A_					:	str    ,    A_					:	int=7    ,    A_					:	List[Any]=3    ,    A_					:	Dict=1_0    ,    A_					:	List[str]=1_8    ,    A_					:	List[Any]=3_0    ,    A_					:	str=4_0_0    ,    A_					:	str=True    ,    A_					:	Tuple=None    ,    A_					:	Optional[Any]=True    ,    A_					:	Tuple=[0.5, 0.5, 0.5]    ,    A_					:	Any=[0.5, 0.5, 0.5]    ,    A_					:	List[str]=None    ,    ):
									lowerCAmelCase_      :					Optional[Any]     =			size if size is not None else {'''shortest_edge''': 1_8}
									lowerCAmelCase_      :					Optional[int]     =			crop_size if crop_size is not None else {'''height''': 1_8, '''width''': 1_8}

									lowerCAmelCase_      :					Any     =			parent
									lowerCAmelCase_      :					Optional[Any]     =			batch_size
									lowerCAmelCase_      :					List[Any]     =			num_channels
									lowerCAmelCase_      :					Optional[int]     =			num_frames
									lowerCAmelCase_      :					Optional[int]     =			image_size
									lowerCAmelCase_      :					List[Any]     =			min_resolution
									lowerCAmelCase_      :					str     =			max_resolution
									lowerCAmelCase_      :					List[str]     =			do_resize
									lowerCAmelCase_      :					int     =			size
									lowerCAmelCase_      :					Union[str, Any]     =			do_normalize
									lowerCAmelCase_      :					Union[str, Any]     =			image_mean
									lowerCAmelCase_      :					List[str]     =			image_std
									lowerCAmelCase_      :					Any     =			crop_size







							def        UpperCAmelCase__      (	self					:	Any):
									return {
									    "image_mean": self.image_mean,
									    "image_std": self.image_std,
									    "do_normalize": self.do_normalize,
									    "do_resize": self.do_resize,
									    "size": self.size,
									    "crop_size": self.crop_size,
									}





@require_torch
@require_vision
class     __snake_case						(					UpperCamelCase_						,unittest.TestCase						):
							_a      				=			VideoMAEImageProcessor if is_vision_available() else None




							def        UpperCAmelCase__      (	self					:	Tuple):
									lowerCAmelCase_      :					int     =			VideoMAEImageProcessingTester(self)




							@property
							def        UpperCAmelCase__      (	self					:	Tuple):
									return self.image_processor_tester.prepare_image_processor_dict()




							def        UpperCAmelCase__      (	self					:	Optional[int]):
									lowerCAmelCase_      :					int     =			self.image_processing_class(**self.image_processor_dict)
									self.assertTrue(hasattr(A_    ,    '''image_mean'''))
									self.assertTrue(hasattr(A_    ,    '''image_std'''))
									self.assertTrue(hasattr(A_    ,    '''do_normalize'''))
									self.assertTrue(hasattr(A_    ,    '''do_resize'''))
									self.assertTrue(hasattr(A_    ,    '''do_center_crop'''))
									self.assertTrue(hasattr(A_    ,    '''size'''))




							def        UpperCAmelCase__      (	self					:	Dict):
									lowerCAmelCase_      :					int     =			self.image_processing_class.from_dict(self.image_processor_dict)
									self.assertEqual(image_processor.size    ,    {'''shortest_edge''': 1_8})
									self.assertEqual(image_processor.crop_size    ,    {'''height''': 1_8, '''width''': 1_8})

									lowerCAmelCase_      :					str     =			self.image_processing_class.from_dict(self.image_processor_dict    ,    size=4_2    ,    crop_size=8_4)
									self.assertEqual(image_processor.size    ,    {'''shortest_edge''': 4_2})
									self.assertEqual(image_processor.crop_size    ,    {'''height''': 8_4, '''width''': 8_4})




							def        UpperCAmelCase__      (	self					:	Dict):
									pass




							def        UpperCAmelCase__      (	self					:	str):
									# Initialize image_processing
									lowerCAmelCase_      :					int     =			self.image_processing_class(**self.image_processor_dict)
									# create random PIL videos
									lowerCAmelCase_      :					Optional[int]     =			prepare_video_inputs(self.image_processor_tester    ,    equal_resolution=A_)
									for video in video_inputs:
											self.assertIsInstance(A_    ,    A_)
											self.assertIsInstance(video[0]    ,    Image.Image)

									# Test not batched input
									lowerCAmelCase_      :					int     =			image_processing(video_inputs[0]    ,    return_tensors='''pt''').pixel_values
									self.assertEqual(
									    encoded_videos.shape    ,    (
									        1,
									        self.image_processor_tester.num_frames,
									        self.image_processor_tester.num_channels,
									        self.image_processor_tester.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )    ,    )

									# Test batched
									lowerCAmelCase_      :					Tuple     =			image_processing(A_    ,    return_tensors='''pt''').pixel_values
									self.assertEqual(
									    encoded_videos.shape    ,    (
									        self.image_processor_tester.batch_size,
									        self.image_processor_tester.num_frames,
									        self.image_processor_tester.num_channels,
									        self.image_processor_tester.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )    ,    )




							def        UpperCAmelCase__      (	self					:	int):
									# Initialize image_processing
									lowerCAmelCase_      :					Dict     =			self.image_processing_class(**self.image_processor_dict)
									# create random numpy tensors
									lowerCAmelCase_      :					str     =			prepare_video_inputs(self.image_processor_tester    ,    equal_resolution=A_    ,    numpify=A_)
									for video in video_inputs:
											self.assertIsInstance(A_    ,    A_)
											self.assertIsInstance(video[0]    ,    np.ndarray)

									# Test not batched input
									lowerCAmelCase_      :					Tuple     =			image_processing(video_inputs[0]    ,    return_tensors='''pt''').pixel_values
									self.assertEqual(
									    encoded_videos.shape    ,    (
									        1,
									        self.image_processor_tester.num_frames,
									        self.image_processor_tester.num_channels,
									        self.image_processor_tester.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )    ,    )

									# Test batched
									lowerCAmelCase_      :					Union[str, Any]     =			image_processing(A_    ,    return_tensors='''pt''').pixel_values
									self.assertEqual(
									    encoded_videos.shape    ,    (
									        self.image_processor_tester.batch_size,
									        self.image_processor_tester.num_frames,
									        self.image_processor_tester.num_channels,
									        self.image_processor_tester.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )    ,    )







							def        UpperCAmelCase__      (	self					:	List[str]):
									# Initialize image_processing
									lowerCAmelCase_      :					Tuple     =			self.image_processing_class(**self.image_processor_dict)
									# create random PyTorch tensors
									lowerCAmelCase_      :					Tuple     =			prepare_video_inputs(self.image_processor_tester    ,    equal_resolution=A_    ,    torchify=A_)
									for video in video_inputs:
											self.assertIsInstance(A_    ,    A_)
											self.assertIsInstance(video[0]    ,    torch.Tensor)

									# Test not batched input
									lowerCAmelCase_      :					List[str]     =			image_processing(video_inputs[0]    ,    return_tensors='''pt''').pixel_values
									self.assertEqual(
									    encoded_videos.shape    ,    (
									        1,
									        self.image_processor_tester.num_frames,
									        self.image_processor_tester.num_channels,
									        self.image_processor_tester.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )    ,    )

									# Test batched
									lowerCAmelCase_      :					List[Any]     =			image_processing(A_    ,    return_tensors='''pt''').pixel_values
									self.assertEqual(
									    encoded_videos.shape    ,    (
									        self.image_processor_tester.batch_size,
									        self.image_processor_tester.num_frames,
									        self.image_processor_tester.num_channels,
									        self.image_processor_tester.crop_size['''height'''],
									        self.image_processor_tester.crop_size['''width'''],
									    )    ,    )





