



'''simple docstring'''


import unittest

from diffusers import FlaxAutoencoderKL
from diffusers.utils import is_flax_available
from diffusers.utils.testing_utils import require_flax

from .test_modeling_common_flax import FlaxModelTesterMixin


if is_flax_available():
  import jax







@require_flax
class 	UpperCAmelCase	(		__a					,	unittest.TestCase):


 '''simple docstring'''




 __magic_name__					: Optional[Any]  =      FlaxAutoencoderKL




 @property
 def       lowercase_  (   self) ->      Tuple:



      """simple docstring"""







      a_       		=4
      a_       		=3
      a_       		=(3_2, 3_2)

      a_       		=jax.random.PRNGKey(0)
      a_       		=jax.random.uniform(lowerCAmelCase_							,  ((batch_size, num_channels) + sizes))

      return {"sample": image, "prng_key": prng_key}




 def       lowercase_  (   self) ->      Tuple:



      """simple docstring"""







      a_       		={
          "block_out_channels": [3_2, 6_4],
          "in_channels": 3,
          "out_channels": 3,
          "down_block_types": ["DownEncoderBlock2D", "DownEncoderBlock2D"],
          "up_block_types": ["UpDecoderBlock2D", "UpDecoderBlock2D"],
          "latent_channels": 4,
      }
      a_       		=self.dummy_input
      return init_dict, inputs_dict







'''simple docstring'''


from __future__ import annotations






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     if b == 0:
          return (1, 0)
     ((a_)		,						(a_))       		=extended_euclid(lowercase__       ,	a % b       )
     a_       		=a // b
     return (y, x - k * y)






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     ((a_)		,						(a_))       		=extended_euclid(lowercase__       ,	lowercase__       )
     a_       		=na * na
     a_       		=ra * x * na + ra * y * na
     return (n % m + m) % m






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     ((a_)		,						(a_))       		=extended_euclid(lowercase__       ,	lowercase__       )
     if b < 0:
          a_       		=(b % n + n) % n
     return b






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     a_		,						a_       		=invert_modulo(lowercase__       ,	lowercase__       ), invert_modulo(lowercase__       ,	lowercase__       )
     a_       		=na * na
     a_       		=ra * x * na + ra * y * na
     return (n % m + m) % m


if __name__ == "__main__":
  from doctest import testmod

  testmod(name='''chinese_remainder_theorem''', verbose=True)
  testmod(name='''chinese_remainder_theorem2''', verbose=True)
  testmod(name='''invert_modulo''', verbose=True)
  testmod(name='''extended_euclid''', verbose=True)


