





'''simple docstring'''







import unittest

from diffusers import FlaxAutoencoderKL
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import require_flax

from .test_modeling_common_flax import FlaxModelTesterMixin


if is_flax_available():
					import jax
@require_flax
class 				__SCREAMING_SNAKE_CASE  (lowerCamelCase_       ,							unittest.TestCase      ):






				"""simple docstring"""







				__a            =FlaxAutoencoderKL




				@property
				def   UpperCamelCase__   (  self     :					List[str]					):
								_a								= 4
								_a								= 3
								_a								= (32, 32)

								_a								= jax.random.PRNGKey(0					)
								_a								= jax.random.uniform(__a					,				((batch_size, num_channels) + sizes)					)

								return {"sample": image, "prng_key": prng_key}




				def   UpperCamelCase__   (  self     :					str					):
								_a								= {
								    "block_out_channels": [32, 64],
								    "in_channels": 3,
								    "out_channels": 3,
								    "down_block_types": ["DownEncoderBlock2D", "DownEncoderBlock2D"],
								    "up_block_types": ["UpDecoderBlock2D", "UpDecoderBlock2D"],
								    "latent_channels": 4,
								}
								_a								= self.dummy_input
								return init_dict, inputs_dict




"""simple docstring"""




def        lowercase							(		lowerCAmelCase__ :     list			) ->      bool:
		if not isinstance(lowerCAmelCase__    ,					lowerCAmelCase__			):
				raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''			)
		if len(lowerCAmelCase__			) == 0:
				raise ValueError('''Input list must be a non empty list'''			)
		if len(lowerCAmelCase__			) == 1:
				return True
		__a           =			series[1] - series[0]
		for index in range(len(lowerCAmelCase__			) - 1			):
				if series[index + 1] - series[index] != common_diff:
						return False
		return True

def        lowercase							(		lowerCAmelCase__ :     list			) ->      float:
		if not isinstance(lowerCAmelCase__    ,					lowerCAmelCase__			):
				raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''			)
		if len(lowerCAmelCase__			) == 0:
				raise ValueError('''Input list must be a non empty list'''			)
		__a           =			0
		for val in series:
				answer += val
		return answer / len(lowerCAmelCase__			)


if __name__ == "__main__":
				import doctest

				doctest.testmod()






