





import functools
import math

import flax.linen as nn
import jax
import jax.numpy as jnp
def 			__UpperCamelCase				(			lowercase__	:       List[str]		,    lowercase__	:       str		,    lowercase__	:       Optional[int]		,    lowercase__	:       List[str]		,    lowercase__	:       int = 4096		)	->      List[Any]:
    '''simple docstring'''





    lowerCAmelCase_		,		lowerCAmelCase_		,		lowerCAmelCase_					:	str						=   key.shape[-3:]
    lowerCAmelCase_					:	List[str]						=   value.shape[-1]
    lowerCAmelCase_					:	List[Any]						=   min(lowercase__		,    lowercase__		)
    lowerCAmelCase_					:	List[Any]						=   query / jnp.sqrt(lowercase__		)

    @functools.partial(jax.checkpoint		,    prevent_cse=lowercase__		)
    def summarize_chunk(lowercase__	:       int		,    lowercase__	:       Union[str, Any]		,    lowercase__	:       str		):
        lowerCAmelCase_					:	List[str]						=   jnp.einsum("""...qhd,...khd->...qhk"""		,    lowercase__		,    lowercase__		,    precision=lowercase__		)

        lowerCAmelCase_					:	Dict						=   jnp.max(lowercase__		,    axis=-1		,    keepdims=lowercase__		)
        lowerCAmelCase_					:	Dict						=   jax.lax.stop_gradient(lowercase__		)
        lowerCAmelCase_					:	str						=   jnp.exp(attn_weights - max_score		)

        lowerCAmelCase_					:	Dict						=   jnp.einsum("""...vhf,...qhv->...qhf"""		,    lowercase__		,    lowercase__		,    precision=lowercase__		)
        lowerCAmelCase_					:	Union[str, Any]						=   jnp.einsum("""...qhk->...qh"""		,    lowercase__		)

        return (exp_values, exp_weights.sum(axis=-1		), max_score)

    def chunk_scanner(lowercase__	:       Dict		):
        # julienne key array
        lowerCAmelCase_					:	List[str]						=   jax.lax.dynamic_slice(
            operand=lowercase__		,    start_indices=[0] * (key.ndim - 3) + [chunk_idx, 0, 0]		,    slice_sizes=list(key.shape[:-3]		) + [key_chunk_size, num_heads, k_features]		,    )

        # julienne value array
        lowerCAmelCase_					:	Optional[int]						=   jax.lax.dynamic_slice(
            operand=lowercase__		,    start_indices=[0] * (value.ndim - 3) + [chunk_idx, 0, 0]		,    slice_sizes=list(value.shape[:-3]		) + [key_chunk_size, num_heads, v_features]		,    )

        return summarize_chunk(lowercase__		,    lowercase__		,    lowercase__		)

    lowerCAmelCase_		,		lowerCAmelCase_		,		lowerCAmelCase_					:	List[Any]						=   jax.lax.map(f=lowercase__		,    xs=jnp.arange(0		,    lowercase__		,    lowercase__		)		)

    lowerCAmelCase_					:	Optional[int]						=   jnp.max(lowercase__		,    axis=0		,    keepdims=lowercase__		)
    lowerCAmelCase_					:	Optional[int]						=   jnp.exp(chunk_max - global_max		)

    chunk_values *= jnp.expand_dims(lowercase__		,    axis=-1		)
    chunk_weights *= max_diffs

    lowerCAmelCase_					:	Dict						=   chunk_values.sum(axis=0		)
    lowerCAmelCase_					:	Dict						=   jnp.expand_dims(lowercase__		,    -1		).sum(axis=0		)

    return all_values / all_weights
def 			__UpperCamelCase				(			lowercase__	:       Optional[int]		,    lowercase__	:       Optional[Any]		,    lowercase__	:       Union[str, Any]		,    lowercase__	:       List[Any]=jax.lax.Precision.HIGHEST		,    lowercase__	:       int = 1024		,    lowercase__	:       int = 4096		)	->      str:
    '''simple docstring'''





    lowerCAmelCase_		,		lowerCAmelCase_		,		lowerCAmelCase_					:	str						=   query.shape[-3:]

    def chunk_scanner(lowercase__	:       int		,    lowercase__	:       str		):
        # julienne query array
        lowerCAmelCase_					:	List[Any]						=   jax.lax.dynamic_slice(
            operand=lowercase__		,    start_indices=([0] * (query.ndim - 3)) + [chunk_idx, 0, 0]		,    slice_sizes=list(query.shape[:-3]		) + [min(lowercase__		,    lowercase__		), num_heads, q_features]		,    )

        return (
            chunk_idx + query_chunk_size,  # unused ignore it
            _query_chunk_attention(
                query=lowercase__		,    key=lowercase__		,    value=lowercase__		,    precision=lowercase__		,    key_chunk_size=lowercase__		),
        )

    lowerCAmelCase_		,		lowerCAmelCase_					:	List[Any]						=   jax.lax.scan(
        f=lowercase__		,    init=0		,    xs=lowercase__		,    length=math.ceil(num_q / query_chunk_size		)		)

    return jnp.concatenate(lowercase__		,    axis=-3		)  # fuse the chunked result back

class 		__a							(	nn.Module      ):
       __snake_case						:   int
       __snake_case						:   int      =		8
       __snake_case						:   int      =		64
       __snake_case						:   float      =		0.0
       __snake_case						:   bool      =		False
       __snake_case						:   jnp.dtype      =		jnp.floataa



       def  A							(     self	:   List[Any]			):
           lowerCAmelCase_					:	str						=   self.dim_head * self.heads
           lowerCAmelCase_					:	List[str]						=   self.dim_head**-0.5

           # Weights were exported with old names {to_q, to_k, to_v, to_out}
           lowerCAmelCase_					:	List[Any]						=   nn.Dense(UpperCAmelCase					,			use_bias=UpperCAmelCase					,			dtype=self.dtype					,			name="""to_q"""			)
           lowerCAmelCase_					:	str						=   nn.Dense(UpperCAmelCase					,			use_bias=UpperCAmelCase					,			dtype=self.dtype					,			name="""to_k"""			)
           lowerCAmelCase_					:	List[str]						=   nn.Dense(UpperCAmelCase					,			use_bias=UpperCAmelCase					,			dtype=self.dtype					,			name="""to_v"""			)

           lowerCAmelCase_					:	Tuple						=   nn.Dense(self.query_dim					,			dtype=self.dtype					,			name="""to_out_0"""			)
           lowerCAmelCase_					:	Any						=   nn.Dropout(rate=self.dropout			)



       def  A							(     self	:   Optional[int]					,			UpperCAmelCase	:   Tuple			):
           lowerCAmelCase_		,		lowerCAmelCase_		,		lowerCAmelCase_					:	str						=   tensor.shape
           lowerCAmelCase_					:	List[str]						=   self.heads
           lowerCAmelCase_					:	Any						=   tensor.reshape(UpperCAmelCase					,			UpperCAmelCase					,			UpperCAmelCase					,			dim // head_size			)
           lowerCAmelCase_					:	Tuple						=   jnp.transpose(UpperCAmelCase					,			(0, 2, 1, 3)			)
           lowerCAmelCase_					:	Dict						=   tensor.reshape(batch_size * head_size					,			UpperCAmelCase					,			dim // head_size			)
           return tensor



       def  A							(     self	:   Union[str, Any]					,			UpperCAmelCase	:   str			):
           lowerCAmelCase_		,		lowerCAmelCase_		,		lowerCAmelCase_					:	Optional[Any]						=   tensor.shape
           lowerCAmelCase_					:	Dict						=   self.heads
           lowerCAmelCase_					:	List[Any]						=   tensor.reshape(batch_size // head_size					,			UpperCAmelCase					,			UpperCAmelCase					,			UpperCAmelCase			)
           lowerCAmelCase_					:	Union[str, Any]						=   jnp.transpose(UpperCAmelCase					,			(0, 2, 1, 3)			)
           lowerCAmelCase_					:	Dict						=   tensor.reshape(batch_size // head_size					,			UpperCAmelCase					,			dim * head_size			)
           return tensor



       def __call__(     self	:   List[Any]					,			UpperCAmelCase	:   int					,			UpperCAmelCase	:   str=None					,			UpperCAmelCase	:   Optional[Any]=True			):
           lowerCAmelCase_					:	int						=   hidden_states if context is None else context

           lowerCAmelCase_					:	List[Any]						=   self.query(UpperCAmelCase			)
           lowerCAmelCase_					:	List[Any]						=   self.key(UpperCAmelCase			)
           lowerCAmelCase_					:	str						=   self.value(UpperCAmelCase			)

           lowerCAmelCase_					:	Tuple						=   self.reshape_heads_to_batch_dim(UpperCAmelCase			)
           lowerCAmelCase_					:	Optional[int]						=   self.reshape_heads_to_batch_dim(UpperCAmelCase			)
           lowerCAmelCase_					:	List[str]						=   self.reshape_heads_to_batch_dim(UpperCAmelCase			)

           if self.use_memory_efficient_attention:
               lowerCAmelCase_					:	int						=   query_states.transpose(1					,			0					,			2			)
               lowerCAmelCase_					:	Dict						=   key_states.transpose(1					,			0					,			2			)
               lowerCAmelCase_					:	List[str]						=   value_states.transpose(1					,			0					,			2			)

               # this if statement create a chunk size for each layer of the unet
               # the chunk size is equal to the query_length dimension of the deepest layer of the unet

               lowerCAmelCase_					:	Union[str, Any]						=   query_states.shape[-3]
               if flatten_latent_dim % 64 == 0:
                   lowerCAmelCase_					:	List[str]						=   int(flatten_latent_dim / 64			)
               elif flatten_latent_dim % 16 == 0:
                   lowerCAmelCase_					:	str						=   int(flatten_latent_dim / 16			)
               elif flatten_latent_dim % 4 == 0:
                   lowerCAmelCase_					:	str						=   int(flatten_latent_dim / 4			)
               else:
                   lowerCAmelCase_					:	List[str]						=   int(UpperCAmelCase			)

               lowerCAmelCase_					:	Any						=   jax_memory_efficient_attention(
                   UpperCAmelCase					,			UpperCAmelCase					,			UpperCAmelCase					,			query_chunk_size=UpperCAmelCase					,			key_chunk_size=40_96 * 4			)

               lowerCAmelCase_					:	Tuple						=   hidden_states.transpose(1					,			0					,			2			)
           else:
               # compute attentions
               lowerCAmelCase_					:	str						=   jnp.einsum("""b i d, b j d->b i j"""					,			UpperCAmelCase					,			UpperCAmelCase			)
               lowerCAmelCase_					:	Optional[Any]						=   attention_scores * self.scale
               lowerCAmelCase_					:	Union[str, Any]						=   nn.softmax(UpperCAmelCase					,			axis=2			)

               # attend to values
               lowerCAmelCase_					:	List[str]						=   jnp.einsum("""b i j, b j d -> b i d"""					,			UpperCAmelCase					,			UpperCAmelCase			)

           lowerCAmelCase_					:	List[str]						=   self.reshape_batch_dim_to_heads(UpperCAmelCase			)
           lowerCAmelCase_					:	Union[str, Any]						=   self.proj_attn(UpperCAmelCase			)
           return self.dropout_layer(UpperCAmelCase					,			deterministic=UpperCAmelCase			)






class 		__a							(	nn.Module      ):
       __snake_case						:   int
       __snake_case						:   int
       __snake_case						:   int
       __snake_case						:   float      =		0.0
       __snake_case						:   bool      =		False
       __snake_case						:   jnp.dtype      =		jnp.floataa
       __snake_case						:   bool      =		False



       def  A							(     self	:   Union[str, Any]			):
           # self attention (or cross_attention if only_cross_attention is True)
           lowerCAmelCase_					:	Dict						=   FlaxAttention(
               self.dim					,			self.n_heads					,			self.d_head					,			self.dropout					,			self.use_memory_efficient_attention					,			dtype=self.dtype			)
           # cross attention
           lowerCAmelCase_					:	int						=   FlaxAttention(
               self.dim					,			self.n_heads					,			self.d_head					,			self.dropout					,			self.use_memory_efficient_attention					,			dtype=self.dtype			)
           lowerCAmelCase_					:	int						=   FlaxFeedForward(dim=self.dim					,			dropout=self.dropout					,			dtype=self.dtype			)
           lowerCAmelCase_					:	List[Any]						=   nn.LayerNorm(epsilon=1e-5					,			dtype=self.dtype			)
           lowerCAmelCase_					:	int						=   nn.LayerNorm(epsilon=1e-5					,			dtype=self.dtype			)
           lowerCAmelCase_					:	List[Any]						=   nn.LayerNorm(epsilon=1e-5					,			dtype=self.dtype			)
           lowerCAmelCase_					:	int						=   nn.Dropout(rate=self.dropout			)



       def __call__(     self	:   int					,			UpperCAmelCase	:   int					,			UpperCAmelCase	:   Optional[Any]					,			UpperCAmelCase	:   List[str]=True			):
           # self attention
           lowerCAmelCase_					:	Optional[int]						=   hidden_states
           if self.only_cross_attention:
               lowerCAmelCase_					:	Dict						=   self.attna(self.norma(UpperCAmelCase			)					,			UpperCAmelCase					,			deterministic=UpperCAmelCase			)
           else:
               lowerCAmelCase_					:	Optional[int]						=   self.attna(self.norma(UpperCAmelCase			)					,			deterministic=UpperCAmelCase			)
           lowerCAmelCase_					:	List[str]						=   hidden_states + residual

           # cross attention
           lowerCAmelCase_					:	List[Any]						=   hidden_states
           lowerCAmelCase_					:	Optional[int]						=   self.attna(self.norma(UpperCAmelCase			)					,			UpperCAmelCase					,			deterministic=UpperCAmelCase			)
           lowerCAmelCase_					:	Union[str, Any]						=   hidden_states + residual

           # feed forward
           lowerCAmelCase_					:	Tuple						=   hidden_states
           lowerCAmelCase_					:	Optional[Any]						=   self.ff(self.norma(UpperCAmelCase			)					,			deterministic=UpperCAmelCase			)
           lowerCAmelCase_					:	int						=   hidden_states + residual

           return self.dropout_layer(UpperCAmelCase					,			deterministic=UpperCAmelCase			)






class 		__a							(	nn.Module      ):
       __snake_case						:   int
       __snake_case						:   int
       __snake_case						:   int
       __snake_case						:   int      =		1
       __snake_case						:   float      =		0.0
       __snake_case						:   bool      =		False
       __snake_case						:   bool      =		False
       __snake_case						:   jnp.dtype      =		jnp.floataa
       __snake_case						:   bool      =		False



       def  A							(     self	:   Optional[Any]			):
           lowerCAmelCase_					:	Optional[Any]						=   nn.GroupNorm(num_groups=32					,			epsilon=1e-5			)

           lowerCAmelCase_					:	Dict						=   self.n_heads * self.d_head
           if self.use_linear_projection:
               lowerCAmelCase_					:	Dict						=   nn.Dense(UpperCAmelCase					,			dtype=self.dtype			)
           else:
               lowerCAmelCase_					:	Any						=   nn.Conv(
                   UpperCAmelCase					,			kernel_size=(1, 1)					,			strides=(1, 1)					,			padding="""VALID"""					,			dtype=self.dtype					,			)

           lowerCAmelCase_					:	Any						=   [
               FlaxBasicTransformerBlock(
                   UpperCAmelCase					,			self.n_heads					,			self.d_head					,			dropout=self.dropout					,			only_cross_attention=self.only_cross_attention					,			dtype=self.dtype					,			use_memory_efficient_attention=self.use_memory_efficient_attention					,			)
               for _ in range(self.depth			)
           ]

           if self.use_linear_projection:
               lowerCAmelCase_					:	Optional[int]						=   nn.Dense(UpperCAmelCase					,			dtype=self.dtype			)
           else:
               lowerCAmelCase_					:	int						=   nn.Conv(
                   UpperCAmelCase					,			kernel_size=(1, 1)					,			strides=(1, 1)					,			padding="""VALID"""					,			dtype=self.dtype					,			)

           lowerCAmelCase_					:	List[str]						=   nn.Dropout(rate=self.dropout			)



       def __call__(     self	:   List[str]					,			UpperCAmelCase	:   Union[str, Any]					,			UpperCAmelCase	:   Optional[int]					,			UpperCAmelCase	:   Union[str, Any]=True			):
           lowerCAmelCase_		,		lowerCAmelCase_		,		lowerCAmelCase_		,		lowerCAmelCase_					:	Tuple						=   hidden_states.shape
           lowerCAmelCase_					:	Any						=   hidden_states
           lowerCAmelCase_					:	Tuple						=   self.norm(UpperCAmelCase			)
           if self.use_linear_projection:
               lowerCAmelCase_					:	Optional[int]						=   hidden_states.reshape(UpperCAmelCase					,			height * width					,			UpperCAmelCase			)
               lowerCAmelCase_					:	Any						=   self.proj_in(UpperCAmelCase			)
           else:
               lowerCAmelCase_					:	Optional[int]						=   self.proj_in(UpperCAmelCase			)
               lowerCAmelCase_					:	Dict						=   hidden_states.reshape(UpperCAmelCase					,			height * width					,			UpperCAmelCase			)

           for transformer_block in self.transformer_blocks:
               lowerCAmelCase_					:	str						=   transformer_block(UpperCAmelCase					,			UpperCAmelCase					,			deterministic=UpperCAmelCase			)

           if self.use_linear_projection:
               lowerCAmelCase_					:	str						=   self.proj_out(UpperCAmelCase			)
               lowerCAmelCase_					:	Optional[Any]						=   hidden_states.reshape(UpperCAmelCase					,			UpperCAmelCase					,			UpperCAmelCase					,			UpperCAmelCase			)
           else:
               lowerCAmelCase_					:	Union[str, Any]						=   hidden_states.reshape(UpperCAmelCase					,			UpperCAmelCase					,			UpperCAmelCase					,			UpperCAmelCase			)
               lowerCAmelCase_					:	Optional[Any]						=   self.proj_out(UpperCAmelCase			)

           lowerCAmelCase_					:	List[str]						=   hidden_states + residual
           return self.dropout_layer(UpperCAmelCase					,			deterministic=UpperCAmelCase			)






class 		__a							(	nn.Module      ):
       __snake_case						:   int
       __snake_case						:   float      =		0.0
       __snake_case						:   jnp.dtype      =		jnp.floataa



       def  A							(     self	:   List[str]			):
           # The second linear layer needs to be called
           # net_2 for now to match the index of the Sequential layer
           lowerCAmelCase_					:	Any						=   FlaxGEGLU(self.dim					,			self.dropout					,			self.dtype			)
           lowerCAmelCase_					:	Union[str, Any]						=   nn.Dense(self.dim					,			dtype=self.dtype			)



       def __call__(     self	:   str					,			UpperCAmelCase	:   List[str]					,			UpperCAmelCase	:   List[Any]=True			):
           lowerCAmelCase_					:	List[str]						=   self.net_a(UpperCAmelCase					,			deterministic=UpperCAmelCase			)
           lowerCAmelCase_					:	Optional[int]						=   self.net_a(UpperCAmelCase			)
           return hidden_states






class 		__a							(	nn.Module      ):
       __snake_case						:   int
       __snake_case						:   float      =		0.0
       __snake_case						:   jnp.dtype      =		jnp.floataa



       def  A							(     self	:   Any			):
           lowerCAmelCase_					:	Optional[int]						=   self.dim * 4
           lowerCAmelCase_					:	Optional[int]						=   nn.Dense(inner_dim * 2					,			dtype=self.dtype			)
           lowerCAmelCase_					:	Union[str, Any]						=   nn.Dropout(rate=self.dropout			)



       def __call__(     self	:   Dict					,			UpperCAmelCase	:   Any					,			UpperCAmelCase	:   Dict=True			):
           lowerCAmelCase_					:	List[str]						=   self.proj(UpperCAmelCase			)
           lowerCAmelCase_		,		lowerCAmelCase_					:	int						=   jnp.split(UpperCAmelCase					,			2					,			axis=2			)
           return self.dropout_layer(hidden_linear * nn.gelu(UpperCAmelCase			)					,			deterministic=UpperCAmelCase			)









from ..utils import deprecate
from .attention_processor import (  # noqa: F401
    Attention,
    AttentionProcessor,
    AttnAddedKVProcessor,
    AttnProcessor2_0,
    LoRAAttnProcessor,
    LoRALinearLayer,
    LoRAXFormersAttnProcessor,
    SlicedAttnAddedKVProcessor,
    SlicedAttnProcessor,
    XFormersAttnProcessor,
)
from .attention_processor import AttnProcessor as AttnProcessorRename  # noqa: F401


deprecate(
    'cross_attention',
    '0.20.0',
    'Importing from cross_attention is deprecated. Please import from diffusers.models.attention_processor instead.',
    standard_warn=False,
)


__UpperCAmelCase						=      AttentionProcessor

class 		__a							(	__UpperCamelCase      ):



       def __init__(     self	:   List[Any]					,			*UpperCAmelCase	:   List[Any]					,			**UpperCAmelCase	:   Any			):
           lowerCAmelCase_					:	str						=   F'{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {"".join(self.__class__.__name__.split("Cross"			)			)} instead.'
           deprecate("""cross_attention"""					,			"""0.20.0"""					,			UpperCAmelCase					,			standard_warn=UpperCAmelCase			)
           super().__init__(*UpperCAmelCase					,			**UpperCAmelCase			)






class 		__a							(	__UpperCamelCase      ):



       def __init__(     self	:   Optional[Any]					,			*UpperCAmelCase	:   List[Any]					,			**UpperCAmelCase	:   List[str]			):
           lowerCAmelCase_					:	List[Any]						=   F'{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {"".join(self.__class__.__name__.split("Cross"			)			)} instead.'
           deprecate("""cross_attention"""					,			"""0.20.0"""					,			UpperCAmelCase					,			standard_warn=UpperCAmelCase			)
           super().__init__(*UpperCAmelCase					,			**UpperCAmelCase			)






class 		__a							(	__UpperCamelCase      ):



       def __init__(     self	:   List[str]					,			*UpperCAmelCase	:   str					,			**UpperCAmelCase	:   Union[str, Any]			):
           lowerCAmelCase_					:	Tuple						=   F'{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {"".join(self.__class__.__name__.split("Cross"			)			)} instead.'
           deprecate("""cross_attention"""					,			"""0.20.0"""					,			UpperCAmelCase					,			standard_warn=UpperCAmelCase			)
           super().__init__(*UpperCAmelCase					,			**UpperCAmelCase			)






class 		__a							(	__UpperCamelCase      ):



       def __init__(     self	:   Optional[int]					,			*UpperCAmelCase	:   Union[str, Any]					,			**UpperCAmelCase	:   Any			):
           lowerCAmelCase_					:	Tuple						=   F'{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {"".join(self.__class__.__name__.split("Cross"			)			)} instead.'
           deprecate("""cross_attention"""					,			"""0.20.0"""					,			UpperCAmelCase					,			standard_warn=UpperCAmelCase			)
           super().__init__(*UpperCAmelCase					,			**UpperCAmelCase			)






class 		__a							(	__UpperCamelCase      ):



       def __init__(     self	:   str					,			*UpperCAmelCase	:   Any					,			**UpperCAmelCase	:   List[Any]			):
           lowerCAmelCase_					:	Union[str, Any]						=   F'{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {"".join(self.__class__.__name__.split("Cross"			)			)} instead.'
           deprecate("""cross_attention"""					,			"""0.20.0"""					,			UpperCAmelCase					,			standard_warn=UpperCAmelCase			)
           super().__init__(*UpperCAmelCase					,			**UpperCAmelCase			)






class 		__a							(	__UpperCamelCase      ):



       def __init__(     self	:   List[str]					,			*UpperCAmelCase	:   Union[str, Any]					,			**UpperCAmelCase	:   Tuple			):
           lowerCAmelCase_					:	Tuple						=   F'{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {"".join(self.__class__.__name__.split("Cross"			)			)} instead.'
           deprecate("""cross_attention"""					,			"""0.20.0"""					,			UpperCAmelCase					,			standard_warn=UpperCAmelCase			)
           super().__init__(*UpperCAmelCase					,			**UpperCAmelCase			)






class 		__a							(	__UpperCamelCase      ):



       def __init__(     self	:   Dict					,			*UpperCAmelCase	:   int					,			**UpperCAmelCase	:   int			):
           lowerCAmelCase_					:	List[str]						=   F'{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {"".join(self.__class__.__name__.split("Cross"			)			)} instead.'
           deprecate("""cross_attention"""					,			"""0.20.0"""					,			UpperCAmelCase					,			standard_warn=UpperCAmelCase			)
           super().__init__(*UpperCAmelCase					,			**UpperCAmelCase			)






class 		__a							(	__UpperCamelCase      ):



       def __init__(     self	:   Optional[Any]					,			*UpperCAmelCase	:   Any					,			**UpperCAmelCase	:   int			):
           lowerCAmelCase_					:	Union[str, Any]						=   F'{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {"".join(self.__class__.__name__.split("Cross"			)			)} instead.'
           deprecate("""cross_attention"""					,			"""0.20.0"""					,			UpperCAmelCase					,			standard_warn=UpperCAmelCase			)
           super().__init__(*UpperCAmelCase					,			**UpperCAmelCase			)


