



import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel



class 				__snake_case						(     UpperCamelCase_						):
							_a			      = '''M-CLIP'''




							def __init__(       self     :       int				,				A_     :       int=1_0_2_4				,				A_     :       Optional[Any]=7_6_8				,				**A_     :       int):
									lowerCAmelCase_			:     List[str]									= transformerDimSize
									lowerCAmelCase_			:     List[str]									= imageDimSize
									super().__init__(**A_)





class 				__snake_case						(     UpperCamelCase_						):
							_a			      = MCLIPConfig




							def __init__(       self     :       Union[str, Any]				,				A_     :       Union[str, Any]				,				*A_     :       List[Any]				,				**A_     :       int):
									super().__init__(A_				,				*A_				,				**A_)
									lowerCAmelCase_			:     int									= XLMRobertaModel(A_)
									lowerCAmelCase_			:     List[str]									= torch.nn.Linear(
									    in_features=config.transformerDimensions				,				out_features=config.numDims)







							def    UpperCAmelCase__			(       self     :       Any				,				A_     :       Any				,				A_     :       Optional[int]):
									lowerCAmelCase_			:     Tuple									= self.transformer(input_ids=A_				,				attention_mask=A_)[0]
									lowerCAmelCase_			:     List[str]									= (embs * attention_mask.unsqueeze(2)).sum(dim=1) / attention_mask.sum(dim=1)[:, None]
									return self.LinearTransformation(A_), embs










import string


def 			UpperCamelCase(  __UpperCamelCase							:		str ):
		for key in range(len(string.ascii_uppercase ) ):
				lowerCAmelCase_			:     List[Any]									= ''''''
				for symbol in message:
						if symbol in string.ascii_uppercase:
								lowerCAmelCase_			:     Optional[int]									= string.ascii_uppercase.find(__UpperCamelCase )
								lowerCAmelCase_			:     Optional[int]									= num - key
								if num < 0:
										lowerCAmelCase_			:     int									= num + len(string.ascii_uppercase )
								lowerCAmelCase_			:     int									= translated + string.ascii_uppercase[num]
						else:
								lowerCAmelCase_			:     Optional[int]									= translated + symbol
				print(f"""Decryption using Key #{key}: {translated}""" )


def 			UpperCamelCase(  ):
		lowerCAmelCase_			:     Dict									= input('''Encrypted message: ''' )
		lowerCAmelCase_			:     List[str]									= message.upper()
		decrypt(__UpperCamelCase )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						main()





