






'''simple docstring'''





import flax.linen as nn
import jax
import jax.numpy as jnp
class 				lowercase       (							nn.Module      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							42
    lowerCAmelCase__      				=							jnp.floataa

    def    a__				(					self     :     Optional[Any]     )							->							Optional[Any]:

     '''simple docstring'''




     lowerCamelCase__  =     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]				,     __lowerCamelCase     :     Union[str, Any]     )							->							Dict:

     '''simple docstring'''




     lowerCamelCase__  ,	lowerCamelCase__  ,	lowerCamelCase__  ,	lowerCamelCase__  =     hidden_states.shape
     lowerCamelCase__  =     jax.image.resize(
         __lowerCamelCase				,     shape=(batch, height * 2, width * 2, channels)				,     method="nearest"				,     )
     lowerCamelCase__  =     self.conv(__lowerCamelCase     )
     return hidden_states
class 				lowercase       (							nn.Module      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							42
    lowerCAmelCase__      				=							jnp.floataa

    def    a__				(					self     :     Optional[Any]     )							->							Optional[int]:

     '''simple docstring'''




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




    def __call__(					self     :     Optional[Any]				,     __lowerCamelCase     :     List[str]     )							->							Any:

     '''simple docstring'''




     lowerCamelCase__  =     self.conv(__lowerCamelCase     )
     return hidden_states
class 				lowercase       (							nn.Module      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							42
    lowerCAmelCase__      				=							None
    lowerCAmelCase__      				=							0.0
    lowerCAmelCase__      				=							None
    lowerCAmelCase__      				=							jnp.floataa

    def    a__				(					self     :     Optional[Any]     )							->							Dict:

     '''simple docstring'''




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

     lowerCamelCase__  =     nn.GroupNorm(num_groups=32				,     epsilon=1E-5     )
     lowerCamelCase__  =     nn.Conv(
         __lowerCamelCase				,     kernel_size=(3, 3)				,     strides=(1, 1)				,     padding=((1, 1), (1, 1))				,     dtype=self.dtype				,     )

     lowerCamelCase__  =     nn.Dense(__lowerCamelCase				,     dtype=self.dtype     )

     lowerCamelCase__  =     nn.GroupNorm(num_groups=32				,     epsilon=1E-5     )
     lowerCamelCase__  =     nn.Dropout(self.dropout_prob     )
     lowerCamelCase__  =     nn.Conv(
         __lowerCamelCase				,     kernel_size=(3, 3)				,     strides=(1, 1)				,     padding=((1, 1), (1, 1))				,     dtype=self.dtype				,     )

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

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




    def __call__(					self     :     Union[str, Any]				,     __lowerCamelCase     :     Any				,     __lowerCamelCase     :     str				,     __lowerCamelCase     :     Union[str, Any]=True     )							->							List[str]:

     '''simple docstring'''




     lowerCamelCase__  =     hidden_states
     lowerCamelCase__  =     self.norma(__lowerCamelCase     )
     lowerCamelCase__  =     nn.swish(__lowerCamelCase     )
     lowerCamelCase__  =     self.conva(__lowerCamelCase     )

     lowerCamelCase__  =     self.time_emb_proj(nn.swish(__lowerCamelCase     )     )
     lowerCamelCase__  =     jnp.expand_dims(jnp.expand_dims(__lowerCamelCase				,     1     )				,     1     )
     lowerCamelCase__  =     hidden_states + temb

     lowerCamelCase__  =     self.norma(__lowerCamelCase     )
     lowerCamelCase__  =     nn.swish(__lowerCamelCase     )
     lowerCamelCase__  =     self.dropout(__lowerCamelCase				,     __lowerCamelCase     )
     lowerCamelCase__  =     self.conva(__lowerCamelCase     )

     if self.conv_shortcut is not None:
      lowerCamelCase__  =     self.conv_shortcut(__lowerCamelCase     )

     return hidden_states + residual









'''simple docstring'''





from decimal import Decimal, getcontext
from math import ceil, factorial






def    lowerCamelCase_     (    lowercase__):

 if not isinstance(lowercase__				,     lowercase__):
  raise TypeError("Undefined for non-integers")
 elif precision < 1:
  raise ValueError("Undefined for non-natural numbers")

 lowerCamelCase__  =     precision
 lowerCamelCase__  =     ceil(precision / 14)
 lowerCamelCase__  =     426880 * Decimal(10005).sqrt()
 lowerCamelCase__  =     1
 lowerCamelCase__  =     13591409
 lowerCamelCase__  =     Decimal(lowercase__)
 for k in range(1				,     lowercase__):
  lowerCamelCase__  =     factorial(6 * k) // (factorial(3 * k) * factorial(lowercase__) ** 3)
  linear_term += 545140134
  exponential_term *= -262537412640768000
  partial_sum += Decimal(multinomial_term * linear_term) / exponential_term
 return str(constant_term / partial_sum)[:-1]


if __name__ == "__main__":
 __A							:							Dict  							=		50
 print(F"""The first {n} digits of pi is: {pi(n)}""")

