


'''simple docstring'''

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





      '''simple docstring'''






      lowerCAmelCase__   :	int
      lowerCAmelCase__   :	jnp.dtype       =				jnp.floataa



      def  UpperCamelCase__						(self       :       int					):

             '''simple docstring'''







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






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

             '''simple docstring'''







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






class     __lowerCAmelCase		(nn.Module	):





      '''simple docstring'''






      lowerCAmelCase__   :	int
      lowerCAmelCase__   :	jnp.dtype       =				jnp.floataa



      def  UpperCamelCase__						(self       :       Dict					):

             '''simple docstring'''







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






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

             '''simple docstring'''







             lowercase__      =					self.conv(UpperCamelCase					)
             return hidden_states






class     __lowerCAmelCase		(nn.Module	):





      '''simple docstring'''






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



      def  UpperCamelCase__						(self       :       Dict					):

             '''simple docstring'''







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

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

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

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

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

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






      def __call__(self       :       Tuple  ,		UpperCamelCase       :       Any  ,		UpperCamelCase       :       List[Any]  ,		UpperCamelCase       :       Tuple=True					):

             '''simple docstring'''







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

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

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

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

             return hidden_states + residual








'''simple docstring'''

from argparse import ArgumentParser

from .add_new_model import AddNewModelCommand
from .add_new_model_like import AddNewModelLikeCommand
from .convert import ConvertCommand
from .download import DownloadCommand
from .env import EnvironmentCommand
from .lfs import LfsCommands
from .pt_to_tf import PTtoTFCommand
from .run import RunCommand
from .serving import ServeCommand
from .user import UserCommands

def _SCREAMING_SNAKE_CASE ()			->			Dict:






       """simple docstring"""







       lowercase__      =					ArgumentParser('''Transformers CLI tool'''    ,					usage='''transformers-cli <command> [<args>]'''			)
       lowercase__      =					parser.add_subparsers(help='''transformers-cli command helpers'''			)

       # Register commands
       ConvertCommand.register_subcommand(A			)
       DownloadCommand.register_subcommand(A			)
       EnvironmentCommand.register_subcommand(A			)
       RunCommand.register_subcommand(A			)
       ServeCommand.register_subcommand(A			)
       UserCommands.register_subcommand(A			)
       AddNewModelCommand.register_subcommand(A			)
       AddNewModelLikeCommand.register_subcommand(A			)
       LfsCommands.register_subcommand(A			)
       PTtoTFCommand.register_subcommand(A			)

       # Let's go
       lowercase__      =					parser.parse_args()

       if not hasattr(A    ,					'''func'''			):
              parser.print_help()
              exit(1			)

       # Run
       lowercase__      =					args.func(A			)
       service.run()


if __name__ == "__main__":
 main()




