




"""simple docstring"""


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






class       lowercase(  nn.Module				):







 '''simple docstring'''





 lowercase__				      =      42
 lowercase__				      =      jnp.floataa


 def 				UpperCamelCase_     (       self:	Tuple	):




   '''simple docstring'''



   _snake_case							:	Optional[Any]			=						nn.Conv(
       self.out_channels,   kernel_size=(3, 3),   strides=(1, 1),   padding=((1, 1), (1, 1)),   dtype=self.dtype,   )


 def __call__(       self:	List[Any],   a_:	Optional[int]	):




   '''simple docstring'''



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







class       lowercase(  nn.Module				):







 '''simple docstring'''





 lowercase__				      =      42
 lowercase__				      =      jnp.floataa


 def 				UpperCamelCase_     (       self:	Union[str, Any]	):




   '''simple docstring'''



   _snake_case							:	Optional[int]			=						nn.Conv(
       self.out_channels,   kernel_size=(3, 3),   strides=(2, 2),   padding=((1, 1), (1, 1)),   dtype=self.dtype,   )


 def __call__(       self:	str,   a_:	Any	):




   '''simple docstring'''



   _snake_case							:	int			=						self.conv(a_	)
   return hidden_states







class       lowercase(  nn.Module				):







 '''simple docstring'''





 lowercase__				      =      42
 lowercase__				      =      None
 lowercase__				      =      0.0
 lowercase__				      =      None
 lowercase__				      =      jnp.floataa


 def 				UpperCamelCase_     (       self:	str	):




   '''simple docstring'''



   _snake_case							:	Optional[Any]			=						self.in_channels if self.out_channels is None else self.out_channels

   _snake_case							:	Dict			=						nn.GroupNorm(num_groups=32,   epsilon=1E-5	)
   _snake_case							:	Optional[Any]			=						nn.Conv(
       a_,   kernel_size=(3, 3),   strides=(1, 1),   padding=((1, 1), (1, 1)),   dtype=self.dtype,   )

   _snake_case							:	Dict			=						nn.Dense(a_,   dtype=self.dtype	)

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

   _snake_case							:	Optional[Any]			=						self.in_channels != out_channels if self.use_nin_shortcut is None else self.use_nin_shortcut

   _snake_case							:	int			=						None
   if use_nin_shortcut:
     _snake_case							:	Union[str, Any]			=						nn.Conv(
         a_,   kernel_size=(1, 1),   strides=(1, 1),   padding="""VALID""",   dtype=self.dtype,   )


 def __call__(       self:	List[Any],   a_:	Optional[int],   a_:	List[str],   a_:	str=True	):




   '''simple docstring'''



   _snake_case							:	int			=						hidden_states
   _snake_case							:	Union[str, Any]			=						self.norma(a_	)
   _snake_case							:	int			=						nn.swish(a_	)
   _snake_case							:	str			=						self.conva(a_	)

   _snake_case							:	Any			=						self.time_emb_proj(nn.swish(a_	)	)
   _snake_case							:	Any			=						jnp.expand_dims(jnp.expand_dims(a_,   1	),   1	)
   _snake_case							:	Tuple			=						hidden_states + temb

   _snake_case							:	Optional[Any]			=						self.norma(a_	)
   _snake_case							:	str			=						nn.swish(a_	)
   _snake_case							:	int			=						self.dropout(a_,   a_	)
   _snake_case							:	Dict			=						self.conva(a_	)

   if self.conv_shortcut is not None:
     _snake_case							:	Dict			=						self.conv_shortcut(a_	)

   return hidden_states + residual








"""simple docstring"""


from abc import ABC, abstractmethod
from argparse import ArgumentParser






class       lowercase(  __a				):







 '''simple docstring'''





 @staticmethod
 @abstractmethod
 def 				UpperCamelCase_     (       a_:	ArgumentParser	):




   '''simple docstring'''



   raise NotImplementedError()


 @abstractmethod
 def 				UpperCamelCase_     (       self:	List[str]	):




   '''simple docstring'''



   raise NotImplementedError()


