




'''simple docstring'''

import flax.linen as nn
import jax
import jax.numpy as jnp






class 						a				(   nn.Module     ):
				snake_case_      =		42
				snake_case_      =		jnp.floataa


				def   A_ (		self    :					int					):
									snake_case_									=				nn.Conv(
									    self.out_channels       ,				kernel_size=(3, 3)       ,				strides=(1, 1)       ,				padding=((1, 1), (1, 1))       ,				dtype=self.dtype       ,				)


				def __call__(		self    :					Optional[int]       ,				lowercase_    :					Tuple					):
									snake_case_			,snake_case_			,snake_case_			,snake_case_									=				hidden_states.shape
									snake_case_									=				jax.image.resize(
									    lowercase_       ,				shape=(batch, height * 2, width * 2, channels)       ,				method='''nearest'''       ,				)
									snake_case_									=				self.conv(lowercase_					)
									return hidden_states







class 						a				(   nn.Module     ):
				snake_case_      =		42
				snake_case_      =		jnp.floataa


				def   A_ (		self    :					str					):
									snake_case_									=				nn.Conv(
									    self.out_channels       ,				kernel_size=(3, 3)       ,				strides=(2, 2)       ,				padding=((1, 1), (1, 1))       ,				dtype=self.dtype       ,				)


				def __call__(		self    :					List[Any]       ,				lowercase_    :					List[Any]					):
									# pad = ((0, 0), (0, 1), (0, 1), (0, 0))  # pad height and width dim
									# hidden_states = jnp.pad(hidden_states, pad_width=pad)
									snake_case_									=				self.conv(lowercase_					)
									return hidden_states







class 						a				(   nn.Module     ):
				snake_case_      =		42
				snake_case_      =		None
				snake_case_      =		0.0
				snake_case_      =		None
				snake_case_      =		jnp.floataa


				def   A_ (		self    :					Optional[Any]					):
									snake_case_									=				self.in_channels if self.out_channels is None else self.out_channels

									snake_case_									=				nn.GroupNorm(num_groups=32       ,				epsilon=1e-5					)
									snake_case_									=				nn.Conv(
									    lowercase_       ,				kernel_size=(3, 3)       ,				strides=(1, 1)       ,				padding=((1, 1), (1, 1))       ,				dtype=self.dtype       ,				)

									snake_case_									=				nn.Dense(lowercase_       ,				dtype=self.dtype					)

									snake_case_									=				nn.GroupNorm(num_groups=32       ,				epsilon=1e-5					)
									snake_case_									=				nn.Dropout(self.dropout_prob					)
									snake_case_									=				nn.Conv(
									    lowercase_       ,				kernel_size=(3, 3)       ,				strides=(1, 1)       ,				padding=((1, 1), (1, 1))       ,				dtype=self.dtype       ,				)

									snake_case_									=				self.in_channels != out_channels if self.use_nin_shortcut is None else self.use_nin_shortcut

									snake_case_									=				None
									if use_nin_shortcut:
														snake_case_									=				nn.Conv(
														    lowercase_       ,				kernel_size=(1, 1)       ,				strides=(1, 1)       ,				padding='''VALID'''       ,				dtype=self.dtype       ,				)


				def __call__(		self    :					Any       ,				lowercase_    :					Optional[int]       ,				lowercase_    :					Tuple       ,				lowercase_    :					Any=True					):
									snake_case_									=				hidden_states
									snake_case_									=				self.norma(lowercase_					)
									snake_case_									=				nn.swish(lowercase_					)
									snake_case_									=				self.conva(lowercase_					)

									snake_case_									=				self.time_emb_proj(nn.swish(lowercase_					)					)
									snake_case_									=				jnp.expand_dims(jnp.expand_dims(lowercase_       ,				1					)       ,				1					)
									snake_case_									=				hidden_states + temb

									snake_case_									=				self.norma(lowercase_					)
									snake_case_									=				nn.swish(lowercase_					)
									snake_case_									=				self.dropout(lowercase_       ,				lowercase_					)
									snake_case_									=				self.conva(lowercase_					)

									if self.conv_shortcut is not None:
														snake_case_									=				self.conv_shortcut(lowercase_					)

									return hidden_states + residual






"""simple docstring"""






from functools import lru_cache






def      snake_case__   (		__lowerCamelCase				:    int	):
			"""simple docstring"""
			lowerCamelCase__		:		Optional[Any]			=2
			lowerCamelCase__		:		Optional[int]			=set()
			while i * i <= n:
						if n % i:
									i += 1
						else:
									n //= i
									factors.add(__lowerCamelCase	)
			if n > 1:
						factors.add(__lowerCamelCase	)
			return factors






@lru_cache
def      snake_case__   (		__lowerCamelCase				:    int	):
			"""simple docstring"""
			return len(unique_prime_factors(__lowerCamelCase	)	)






def      snake_case__   (		__lowerCamelCase				:    list	):
			"""simple docstring"""
			return len(set(__lowerCamelCase	)	) in (0, 1)






def      snake_case__   (		__lowerCamelCase				:    int	):
			"""simple docstring"""
			lowerCamelCase__		:		Tuple			=2

			while True:
						# Increment each value of a generated range
						lowerCamelCase__		:		Tuple			=[base + i for i in range(__lowerCamelCase	)]

						# Run elements through out unique_prime_factors function
						# Append our target number to the end.
						lowerCamelCase__		:		Optional[Any]			=[upf_len(__lowerCamelCase	) for x in group]
						checker.append(__lowerCamelCase	)

						# If all numbers in the list are equal, return the group variable.
						if equality(__lowerCamelCase	):
									return group

						# Increment our base variable by 1
						base += 1






def      snake_case__   (		__lowerCamelCase				:    int = 4	):
			"""simple docstring"""
			lowerCamelCase__		:		List[Any]			=run(__lowerCamelCase	)
			return results[0] if len(__lowerCamelCase	) else None


if __name__ == "__main__":
		print(solution())




