


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			:					str         =							AttentionProcessor

class      __snake_case				(   _UpperCAmelCase):
					def __init__(						self       :						Optional[int]	,      *_lowerCAmelCase       :						Dict	,      **_lowerCAmelCase       :						Optional[Any]  )							->					List[Any]:



											'''simple docstring'''





											__magic_name__					=      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'	,      _lowerCAmelCase	,      standard_warn=_lowerCAmelCase  )
											super().__init__(*_lowerCAmelCase	,      **_lowerCAmelCase  )







class      __snake_case				(   _UpperCAmelCase):
					def __init__(						self       :						List[str]	,      *_lowerCAmelCase       :						Union[str, Any]	,      **_lowerCAmelCase       :						Optional[Any]  )							->					int:



											'''simple docstring'''





											__magic_name__					=      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'	,      _lowerCAmelCase	,      standard_warn=_lowerCAmelCase  )
											super().__init__(*_lowerCAmelCase	,      **_lowerCAmelCase  )







class      __snake_case				(   _UpperCAmelCase):
					def __init__(						self       :						List[Any]	,      *_lowerCAmelCase       :						List[str]	,      **_lowerCAmelCase       :						Tuple  )							->					Any:



											'''simple docstring'''





											__magic_name__					=      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'	,      _lowerCAmelCase	,      standard_warn=_lowerCAmelCase  )
											super().__init__(*_lowerCAmelCase	,      **_lowerCAmelCase  )







class      __snake_case				(   _UpperCAmelCase):
					def __init__(						self       :						Dict	,      *_lowerCAmelCase       :						Dict	,      **_lowerCAmelCase       :						List[Any]  )							->					Tuple:



											'''simple docstring'''





											__magic_name__					=      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'	,      _lowerCAmelCase	,      standard_warn=_lowerCAmelCase  )
											super().__init__(*_lowerCAmelCase	,      **_lowerCAmelCase  )







class      __snake_case				(   _UpperCAmelCase):
					def __init__(						self       :						List[str]	,      *_lowerCAmelCase       :						Any	,      **_lowerCAmelCase       :						Any  )							->					int:



											'''simple docstring'''





											__magic_name__					=      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'	,      _lowerCAmelCase	,      standard_warn=_lowerCAmelCase  )
											super().__init__(*_lowerCAmelCase	,      **_lowerCAmelCase  )







class      __snake_case				(   _UpperCAmelCase):
					def __init__(						self       :						Union[str, Any]	,      *_lowerCAmelCase       :						str	,      **_lowerCAmelCase       :						Optional[Any]  )							->					Optional[int]:



											'''simple docstring'''





											__magic_name__					=      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'	,      _lowerCAmelCase	,      standard_warn=_lowerCAmelCase  )
											super().__init__(*_lowerCAmelCase	,      **_lowerCAmelCase  )







class      __snake_case				(   _UpperCAmelCase):
					def __init__(						self       :						List[str]	,      *_lowerCAmelCase       :						int	,      **_lowerCAmelCase       :						int  )							->					List[str]:



											'''simple docstring'''





											__magic_name__					=      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'	,      _lowerCAmelCase	,      standard_warn=_lowerCAmelCase  )
											super().__init__(*_lowerCAmelCase	,      **_lowerCAmelCase  )







class      __snake_case				(   _UpperCAmelCase):
					def __init__(						self       :						Dict	,      *_lowerCAmelCase       :						str	,      **_lowerCAmelCase       :						str  )							->					Optional[Any]:



											'''simple docstring'''





											__magic_name__					=      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'	,      _lowerCAmelCase	,      standard_warn=_lowerCAmelCase  )
											super().__init__(*_lowerCAmelCase	,      **_lowerCAmelCase  )





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCamelCase			:					Optional[int]         =							{
    '''configuration_dpr''': ['''DPR_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''DPRConfig'''],
    '''tokenization_dpr''': [
        '''DPRContextEncoderTokenizer''',
        '''DPRQuestionEncoderTokenizer''',
        '''DPRReaderOutput''',
        '''DPRReaderTokenizer''',
    ],
}


try:
					if not is_tokenizers_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCamelCase			:					List[str]         =							[
					    '''DPRContextEncoderTokenizerFast''',
					    '''DPRQuestionEncoderTokenizerFast''',
					    '''DPRReaderTokenizerFast''',
					]

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCamelCase			:					Optional[Any]         =							[
					    '''DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''DPRContextEncoder''',
					    '''DPRPretrainedContextEncoder''',
					    '''DPRPreTrainedModel''',
					    '''DPRPretrainedQuestionEncoder''',
					    '''DPRPretrainedReader''',
					    '''DPRQuestionEncoder''',
					    '''DPRReader''',
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCamelCase			:					Optional[int]         =							[
					    '''TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''TFDPRContextEncoder''',
					    '''TFDPRPretrainedContextEncoder''',
					    '''TFDPRPretrainedQuestionEncoder''',
					    '''TFDPRPretrainedReader''',
					    '''TFDPRQuestionEncoder''',
					    '''TFDPRReader''',
					]


if TYPE_CHECKING:
					from .configuration_dpr import DPR_PRETRAINED_CONFIG_ARCHIVE_MAP, DPRConfig
					from .tokenization_dpr import (
					    DPRContextEncoderTokenizer,
					    DPRQuestionEncoderTokenizer,
					    DPRReaderOutput,
					    DPRReaderTokenizer,
					)

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_dpr_fast import (
										    DPRContextEncoderTokenizerFast,
										    DPRQuestionEncoderTokenizerFast,
										    DPRReaderTokenizerFast,
										)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_dpr import (
										    DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    DPRContextEncoder,
										    DPRPretrainedContextEncoder,
										    DPRPreTrainedModel,
										    DPRPretrainedQuestionEncoder,
										    DPRPretrainedReader,
										    DPRQuestionEncoder,
										    DPRReader,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_dpr import (
										    TF_DPR_CONTEXT_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TF_DPR_QUESTION_ENCODER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TF_DPR_READER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFDPRContextEncoder,
										    TFDPRPretrainedContextEncoder,
										    TFDPRPretrainedQuestionEncoder,
										    TFDPRPretrainedReader,
										    TFDPRQuestionEncoder,
										    TFDPRReader,
										)

else:
					import sys

					UpperCamelCase			:					List[Any]         =							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

