

"""simple docstring"""



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



class 					a						(       nn.Module				):



    """simple docstring"""



    UpperCAmelCase						 =					4_2
    UpperCAmelCase						 =					jnp.floataa

    def 				UpperCamelCase	(     self: Any       ):






         """simple docstring"""


         A__										=  nn.Conv(
             self.out_channels    ,						kernel_size=(3, 3)    ,						strides=(1, 1)    ,						padding=((1, 1), (1, 1))    ,						dtype=self.dtype    ,						)





    def __call__(     self: Dict    ,						UpperCamelCase: Tuple       ):






         """simple docstring"""


         A__			,				A__			,				A__			,				A__										=  hidden_states.shape
         A__										=  jax.image.resize(
             UpperCamelCase    ,						shape=(batch, height * 2, width * 2, channels)    ,						method="""nearest"""    ,						)
         A__										=  self.conv(UpperCamelCase       )
         return hidden_states



class 					a						(       nn.Module				):



    """simple docstring"""



    UpperCAmelCase						 =					4_2
    UpperCAmelCase						 =					jnp.floataa

    def 				UpperCamelCase	(     self: Optional[int]       ):






         """simple docstring"""


         A__										=  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]    ,						UpperCamelCase: List[str]       ):






         """simple docstring"""


         A__										=  self.conv(UpperCamelCase       )
         return hidden_states



class 					a						(       nn.Module				):



    """simple docstring"""



    UpperCAmelCase						 =					4_2
    UpperCAmelCase						 =					None
    UpperCAmelCase						 =					0.0
    UpperCAmelCase						 =					None
    UpperCAmelCase						 =					jnp.floataa

    def 				UpperCamelCase	(     self: Dict       ):






         """simple docstring"""


         A__										=  self.in_channels if self.out_channels is None else self.out_channels

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

         A__										=  nn.Dense(UpperCamelCase    ,						dtype=self.dtype       )

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

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

         A__										=  None
         if use_nin_shortcut:
              A__										=  nn.Conv(
                  UpperCamelCase    ,						kernel_size=(1, 1)    ,						strides=(1, 1)    ,						padding="""VALID"""    ,						dtype=self.dtype    ,						)





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






         """simple docstring"""


         A__										=  hidden_states
         A__										=  self.norma(UpperCamelCase       )
         A__										=  nn.swish(UpperCamelCase       )
         A__										=  self.conva(UpperCamelCase       )

         A__										=  self.time_emb_proj(nn.swish(UpperCamelCase       )       )
         A__										=  jnp.expand_dims(jnp.expand_dims(UpperCamelCase    ,						1       )    ,						1       )
         A__										=  hidden_states + temb

         A__										=  self.norma(UpperCamelCase       )
         A__										=  nn.swish(UpperCamelCase       )
         A__										=  self.dropout(UpperCamelCase    ,						UpperCamelCase       )
         A__										=  self.conva(UpperCamelCase       )

         if self.conv_shortcut is not None:
              A__										=  self.conv_shortcut(UpperCamelCase       )

         return hidden_states + residual









"""simple docstring"""



from itertools import count





def  _snake_case     (    UpperCAmelCase_  :					int = 50			):
     A__										=  [1] * min_block_length

     for n in count(UpperCAmelCase_			):
          fill_count_functions.append(1			)

          for block_length in range(UpperCAmelCase_					,   n + 1			):
               for block_start in range(n - block_length			):
                    fill_count_functions[n] += fill_count_functions[
                        n - block_start - block_length - 1
                    ]

               fill_count_functions[n] += 1

          if fill_count_functions[n] > 100_0000:
               break

     return n


if __name__ == "__main__":
 print(f"""{solution() = }""")






