

from collections import OrderedDict
from typing import List, Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_lowerCAmelCase					:			List[str]  				=			logging.get_logger(__name__)

_lowerCAmelCase					:			List[Any]  				=			{
    "google/efficientnet-b7": "https://huggingface.co/google/efficientnet-b7/resolve/main/config.json",
}






class 	__magic_name__    (			lowerCAmelCase_      ):
			SCREAMING_SNAKE_CASE							   =						'efficientnet'





			def __init__(		self					,  __snake_case = 3					,  __snake_case = 600					,  __snake_case = 2.0					,  __snake_case = 3.1					,  __snake_case = 8					,  __snake_case = [3, 3, 5, 3, 5, 5, 3]					,  __snake_case = [32, 16, 24, 40, 80, 112, 192]					,  __snake_case = [16, 24, 40, 80, 112, 192, 320]					,  __snake_case = []					,  __snake_case = [1, 2, 2, 2, 1, 2, 1]					,  __snake_case = [1, 2, 2, 3, 3, 4, 1]					,  __snake_case = [1, 6, 6, 6, 6, 6, 6]					,  __snake_case = 0.25					,  __snake_case = "swish"					,  __snake_case = 2560					,  __snake_case = "mean"					,  __snake_case = 0.02					,  __snake_case = 0.001					,  __snake_case = 0.99					,  __snake_case = 0.5					,  __snake_case = 0.2					,  **__snake_case					,  )   -> Tuple:




						'''simple docstring'''
						super().__init__(**__snake_case					)

						__a        =num_channels
						__a        =image_size
						__a        =width_coefficient
						__a        =depth_coefficient
						__a        =depth_divisor
						__a        =kernel_sizes
						__a        =in_channels
						__a        =out_channels
						__a        =depthwise_padding
						__a        =strides
						__a        =num_block_repeats
						__a        =expand_ratios
						__a        =squeeze_expansion_ratio
						__a        =hidden_act
						__a        =hidden_dim
						__a        =pooling_type
						__a        =initializer_range
						__a        =batch_norm_eps
						__a        =batch_norm_momentum
						__a        =dropout_rate
						__a        =drop_connect_rate
						__a        =sum(__snake_case					) * 4






class 	__magic_name__    (			lowerCAmelCase_      ):
			SCREAMING_SNAKE_CASE							   =						version.parse('1.11'      )





			@property
			def 		__magic_name__    (		self					)   -> Mapping[str, Mapping[int, str]]:




						'''simple docstring'''
						return OrderedDict(
						    [
						        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
						    ]					)





			@property
			def 		__magic_name__    (		self					)   -> float:




						'''simple docstring'''
						return 1e-5









import unittest

import numpy as np
import torch

from diffusers import VersatileDiffusionImageVariationPipeline
from diffusers.utils.testing_utils import load_image, require_torch_gpu, slow, torch_device


_lowerCAmelCase					:			Optional[Any]  				=			False






class 	__magic_name__    (			unittest.TestCase      ):
			pass






@slow
@require_torch_gpu
class 	__magic_name__    (			unittest.TestCase      ):





			def 		__magic_name__    (		self					)   -> Optional[int]:




						'''simple docstring'''
						__a        =VersatileDiffusionImageVariationPipeline.from_pretrained('shi-labs/versatile-diffusion'					)
						pipe.to(__snake_case					)
						pipe.set_progress_bar_config(disable=__snake_case					)

						__a        =load_image(
						    'https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/versatile_diffusion/benz.jpg'					)
						__a        =torch.manual_seed(0					)
						__a        =pipe(
						    image=__snake_case					,  generator=__snake_case					,  guidance_scale=7.5					,  num_inference_steps=50					,  output_type='numpy'					,  ).images

						__a        =image[0, 253:256, 253:256, -1]

						assert image.shape == (1, 512, 512, 3)
						__a        =np.array([0.0441, 0.0469, 0.0507, 0.0575, 0.0632, 0.0650, 0.0865, 0.0909, 0.0945]					)

						assert np.abs(image_slice.flatten() - expected_slice					).max() < 1e-2






