





'''simple docstring'''


import unittest

import torch

from diffusers import VQModel
from diffusers.utils import floats_tensor, torch_device
from diffusers.utils.testing_utils import enable_full_determinism

from .test_modeling_common import ModelTesterMixin, UNetTesterMixin


enable_full_determinism()
class 				a_       (    _lowerCAmelCase     ,						_lowerCAmelCase     ,						unittest.TestCase							):
     __A								=      VQModel
     __A								=      "sample"





     @property
     def 							lowercase__				(			self		: Tuple     ,				lowercase		: List[Any]=(32, 32)						):





        """simple docstring"""




        lowercase_      :List[Any]         =			4
        lowercase_      :int         =			3

        lowercase_      :Optional[int]         =			floats_tensor((batch_size, num_channels) + sizes						).to(lowercase						)

        return {"sample": image}





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





        """simple docstring"""




        return (3, 32, 32)





     @property
     def 							lowercase__				(			self		: str						):





        """simple docstring"""




        return (3, 32, 32)





     def 							lowercase__				(			self		: Optional[int]						):





        """simple docstring"""




        lowercase_      :Any         =			{
            "block_out_channels": [32, 64],
            "in_channels": 3,
            "out_channels": 3,
            "down_block_types": ["DownEncoderBlock2D", "DownEncoderBlock2D"],
            "up_block_types": ["UpDecoderBlock2D", "UpDecoderBlock2D"],
            "latent_channels": 3,
        }
        lowercase_      :Tuple         =			self.dummy_input
        return init_dict, inputs_dict





     def 							lowercase__				(			self		: Optional[int]						):





        """simple docstring"""




        pass





     def 							lowercase__				(			self		: List[str]						):





        """simple docstring"""




        pass





     def 							lowercase__				(			self		: Tuple						):





        """simple docstring"""




        lowercase_      :int         =			VQModel.from_pretrained("fusing/vqgan-dummy"     ,				output_loading_info=lowercase						)
        self.assertIsNotNone(lowercase						)
        self.assertEqual(len(loading_info["missing_keys"]						)     ,				0						)

        model.to(lowercase						)
        lowercase_      :int         =			model(**self.dummy_input						)

        assert image is not None, "Make sure output is not None"







     def 							lowercase__				(			self		: List[Any]						):





        """simple docstring"""




        lowercase_      :Optional[Any]         =			VQModel.from_pretrained("fusing/vqgan-dummy"						)
        model.to(lowercase						).eval()

        torch.manual_seed(0						)
        if torch.cuda.is_available():
           torch.cuda.manual_seed_all(0						)

        lowercase_      :Any         =			torch.randn(1     ,				model.config.in_channels     ,				model.config.sample_size     ,				model.config.sample_size						)
        lowercase_      :str         =			image.to(lowercase						)
        with torch.no_grad():
           lowercase_      :int         =			model(lowercase						).sample

        lowercase_      :Optional[Any]         =			output[0, -1, -3:, -3:].flatten().cpu()
        # fmt: off
        lowercase_      :Tuple         =			torch.tensor([-0.01_53, -0.40_44, -0.18_80, -0.51_61, -0.24_18, -0.40_72, -0.16_12, -0.06_33, -0.01_43]						)
        # fmt: on
        self.assertTrue(torch.allclose(lowercase     ,				lowercase     ,				atol=1e-3						)						)









'''simple docstring'''


import sys

lowerCAmelCase :					List[Any] 							=(
    '''73167176531330624919225119674426574742355349194934'''
    '''96983520312774506326239578318016984801869478851843'''
    '''85861560789112949495459501737958331952853208805511'''
    '''12540698747158523863050715693290963295227443043557'''
    '''66896648950445244523161731856403098711121722383113'''
    '''62229893423380308135336276614282806444486645238749'''
    '''30358907296290491560440772390713810515859307960866'''
    '''70172427121883998797908792274921901699720888093776'''
    '''65727333001053367881220235421809751254540594752243'''
    '''52584907711670556013604839586446706324415722155397'''
    '''53697817977846174064955149290862569321978468622482'''
    '''83972241375657056057490261407972968652414535100474'''
    '''82166370484403199890008895243450658541227588666881'''
    '''16427171479924442928230863465674813919123162824586'''
    '''17866458359124566529476545682848912883142607690042'''
    '''24219022671055626321111109370544217506941658960408'''
    '''07198403850962455444362981230987879927244284909188'''
    '''84580156166097919133875499200524063689912560717606'''
    '''05886116467109405077541002256983155200055935729725'''
    '''71636269561882670428252483600823257530420752963450'''
)
def 							UpperCAmelCase_  (						__lowerCamelCase : str			):
   lowercase_      :List[str]         =			1
   for digit in s:
      product *= int(__lowerCamelCase			)
   return product
def 							UpperCAmelCase_  (						__lowerCamelCase : str = N			):
   lowercase_      :Any         =			-sys.maxsize - 1
   lowercase_      :int         =			n[:13]
   lowercase_      :Optional[int]         =			13
   while cur_index < len(__lowerCamelCase			) - 13:
      if int(n[cur_index]			) >= int(substr[0]			):
         lowercase_      :str         =			substr[1:] + n[cur_index]
         cur_index += 1
      else:
         lowercase_      :List[str]         =			max(__lowerCamelCase     ,str_eval(__lowerCamelCase			)			)
         lowercase_      :Any         =			n[cur_index : cur_index + 13]
         cur_index += 13
   return largest_product


if __name__ == "__main__":
 print(F'''{solution() = }''')


