



'''simple docstring'''





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






class __A    (						nn.Module		):



 '''simple docstring'''







 __lowerCamelCase					: int
 __lowerCamelCase					: jnp.dtype    = jnp.floataa



 def       a__						(self )					->  int:


      """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				,     A )					->  Optional[Any]:


      """simple docstring"""



      _a						,					_a						,					_a						,					_a											=						hidden_states.shape
      _a											=						jax.image.resize(
          A				,     shape=(batch, height * 2, width * 2, channels)				,     method='''nearest'''				,     )
      _a											=						self.conv(A )
      return hidden_states






class __A    (						nn.Module		):



 '''simple docstring'''







 __lowerCamelCase					: int
 __lowerCamelCase					: jnp.dtype    = jnp.floataa



 def       a__						(self )					->  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				,     A )					->  Tuple:


      """simple docstring"""



      _a											=						self.conv(A )
      return hidden_states






class __A    (						nn.Module		):



 '''simple docstring'''







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



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


      """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(
          A				,     kernel_size=(3, 3)				,     strides=(1, 1)				,     padding=((1, 1), (1, 1))				,     dtype=self.dtype				,     )

      _a											=						nn.Dense(A				,     dtype=self.dtype )

      _a											=						nn.GroupNorm(num_groups=32				,     epsilon=1E-5 )
      _a											=						nn.Dropout(self.dropout_prob )
      _a											=						nn.Conv(
          A				,     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(
               A				,     kernel_size=(1, 1)				,     strides=(1, 1)				,     padding='''VALID'''				,     dtype=self.dtype				,     )



 def __call__(self				,     A				,     A				,     A=True )					->  Any:


      """simple docstring"""



      _a											=						hidden_states
      _a											=						self.norma(A )
      _a											=						nn.swish(A )
      _a											=						self.conva(A )

      _a											=						self.time_emb_proj(nn.swish(A ) )
      _a											=						jnp.expand_dims(jnp.expand_dims(A				,     1 )				,     1 )
      _a											=						hidden_states + temb

      _a											=						self.norma(A )
      _a											=						nn.swish(A )
      _a											=						self.dropout(A				,     A )
      _a											=						self.conva(A )

      if self.conv_shortcut is not None:
           _a											=						self.conv_shortcut(A )

      return hidden_states + residual








'''simple docstring'''





import pytest

import datasets


# Import fixture modules as plugins
lowercase_	 =						["tests.fixtures.files", "tests.fixtures.hub", "tests.fixtures.fsspec"]




def lowerCAmelCase						(__A						,			__A):



     """simple docstring"""



     for item in items:
          if any(marker in item.keywords for marker in ['''integration''', '''unit''']):
               continue
          item.add_marker(pytest.mark.unit)




def lowerCAmelCase						(__A):



     """simple docstring"""



     config.addinivalue_line('''markers'''						,			'''torchaudio_latest: mark test to run with torchaudio>=0.12''')




@pytest.fixture(autouse=__A)
def lowerCAmelCase						(__A						,			__A):



     """simple docstring"""



     _a											=						tmp_path_factory.getbasetemp() / '''cache'''
     _a											=						test_hf_cache_home / '''datasets'''
     _a											=						test_hf_cache_home / '''metrics'''
     _a											=						test_hf_cache_home / '''modules'''
     monkeypatch.setattr('''datasets.config.HF_DATASETS_CACHE'''						,			str(__A))
     monkeypatch.setattr('''datasets.config.HF_METRICS_CACHE'''						,			str(__A))
     monkeypatch.setattr('''datasets.config.HF_MODULES_CACHE'''						,			str(__A))
     _a											=						test_hf_datasets_cache / '''downloads'''
     monkeypatch.setattr('''datasets.config.DOWNLOADED_DATASETS_PATH'''						,			str(__A))
     _a											=						test_hf_datasets_cache / '''downloads''' / '''extracted'''
     monkeypatch.setattr('''datasets.config.EXTRACTED_DATASETS_PATH'''						,			str(__A))




@pytest.fixture(autouse=__A						,			scope='''session''')
def lowerCAmelCase						():



     """simple docstring"""



     datasets.disable_progress_bar()




@pytest.fixture(autouse=__A)
def lowerCAmelCase						(__A):



     """simple docstring"""



     monkeypatch.setattr('''datasets.config.HF_UPDATE_DOWNLOAD_COUNTS'''						,			__A)




@pytest.fixture
def lowerCAmelCase						(__A):



     """simple docstring"""



     monkeypatch.setattr('''sqlalchemy.util.deprecations.SILENCE_UBER_WARNING'''						,			__A)



