



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


class 				_a						(       nn.Module			):





							'''simple docstring'''

							A				:int
							A				:jnp.dtype =       jnp.floataa



							def 		_A	(							self				):







											"""simple docstring"""



											a__	:							str      						= nn.Conv(
											    self.out_channels ,					kernel_size=(3, 3) ,					strides=(1, 1) ,					padding=((1, 1), (1, 1)) ,					dtype=self.dtype ,					)




							def __call__(							self ,					__UpperCAmelCase				):







											"""simple docstring"""



											a__						,   a__						,   a__						,   a__	:							int      						= hidden_states.shape
											a__	:							Union[str, Any]      						= jax.image.resize(
											    __UpperCAmelCase ,					shape=(batch, height * 2, width * 2, channels) ,					method="nearest" ,					)
											a__	:							int      						= self.conv(__UpperCAmelCase				)
											return hidden_states





class 				_a						(       nn.Module			):





							'''simple docstring'''

							A				:int
							A				:jnp.dtype =       jnp.floataa



							def 		_A	(							self				):







											"""simple docstring"""



											a__	:							Any      						= nn.Conv(
											    self.out_channels ,					kernel_size=(3, 3) ,					strides=(2, 2) ,					padding=((1, 1), (1, 1)) ,					dtype=self.dtype ,					)




							def __call__(							self ,					__UpperCAmelCase				):







											"""simple docstring"""



											a__	:							int      						= self.conv(__UpperCAmelCase				)
											return hidden_states





class 				_a						(       nn.Module			):





							'''simple docstring'''

							A				:int
							A				:int =       None
							A				:float =       0.0
							A				:bool =       None
							A				:jnp.dtype =       jnp.floataa



							def 		_A	(							self				):







											"""simple docstring"""



											a__	:							List[Any]      						= self.in_channels if self.out_channels is None else self.out_channels

											a__	:							Tuple      						= nn.GroupNorm(num_groups=32 ,					epsilon=1E-5				)
											a__	:							List[Any]      						= nn.Conv(
											    __UpperCAmelCase ,					kernel_size=(3, 3) ,					strides=(1, 1) ,					padding=((1, 1), (1, 1)) ,					dtype=self.dtype ,					)

											a__	:							Any      						= nn.Dense(__UpperCAmelCase ,					dtype=self.dtype				)

											a__	:							Union[str, Any]      						= nn.GroupNorm(num_groups=32 ,					epsilon=1E-5				)
											a__	:							List[Any]      						= nn.Dropout(self.dropout_prob				)
											a__	:							str      						= nn.Conv(
											    __UpperCAmelCase ,					kernel_size=(3, 3) ,					strides=(1, 1) ,					padding=((1, 1), (1, 1)) ,					dtype=self.dtype ,					)

											a__	:							Any      						= self.in_channels != out_channels if self.use_nin_shortcut is None else self.use_nin_shortcut

											a__	:							int      						= None
											if use_nin_shortcut:
															a__	:							Optional[int]      						= nn.Conv(
															    __UpperCAmelCase ,					kernel_size=(1, 1) ,					strides=(1, 1) ,					padding="VALID" ,					dtype=self.dtype ,					)




							def __call__(							self ,					__UpperCAmelCase ,					__UpperCAmelCase ,					__UpperCAmelCase=True				):







											"""simple docstring"""



											a__	:							Union[str, Any]      						= hidden_states
											a__	:							Union[str, Any]      						= self.norma(__UpperCAmelCase				)
											a__	:							Tuple      						= nn.swish(__UpperCAmelCase				)
											a__	:							List[Any]      						= self.conva(__UpperCAmelCase				)

											a__	:							Dict      						= self.time_emb_proj(nn.swish(__UpperCAmelCase				)				)
											a__	:							Optional[int]      						= jnp.expand_dims(jnp.expand_dims(__UpperCAmelCase ,					1				) ,					1				)
											a__	:							Dict      						= hidden_states + temb

											a__	:							Optional[Any]      						= self.norma(__UpperCAmelCase				)
											a__	:							Any      						= nn.swish(__UpperCAmelCase				)
											a__	:							Optional[Any]      						= self.dropout(__UpperCAmelCase ,					__UpperCAmelCase				)
											a__	:							Tuple      						= self.conva(__UpperCAmelCase				)

											if self.conv_shortcut is not None:
															a__	:							List[Any]      						= self.conv_shortcut(__UpperCAmelCase				)

											return hidden_states + residual







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available


lowerCamelCase		       =      {}


try:
						if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase		       =      ["""MLukeTokenizer"""]

if TYPE_CHECKING:
						try:
												if not is_sentencepiece_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_mluke import MLukeTokenizer


else:
						import sys

						lowerCamelCase		       =      _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


