
'''simple docstring'''

import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel




class    lowerCAmelCase       (     UpperCamelCase_  ):
 A_				:				Union[str, Any]	=			"""M-CLIP"""


 def __init__(    self  : Any			,							a__  : Tuple=1024			,							a__  : Dict=768			,							**a__  : Optional[Any]    ):
  '''simple docstring'''

  lowerCAmelCase__     :   int     		=	transformerDimSize
  lowerCAmelCase__     :   Union[str, Any]     		=	imageDimSize
  super().__init__(**a__    )




class    lowerCAmelCase       (     UpperCamelCase_  ):
 A_				:				Dict	=			MCLIPConfig


 def __init__(    self  : Optional[Any]			,							a__  : Optional[int]			,							*a__  : Any			,							**a__  : int    ):
  '''simple docstring'''

  super().__init__(a__			,							*a__			,							**a__    )
  lowerCAmelCase__     :   Any     		=	XLMRobertaModel(a__    )
  lowerCAmelCase__     :   List[Any]     		=	torch.nn.Linear(
      in_features=config.transformerDimensions			,							out_features=config.numDims    )


 def    _A	(    self  : Dict			,							a__  : str			,							a__  : List[Any]    ):
  '''simple docstring'''

  lowerCAmelCase__     :   Dict     		=	self.transformer(input_ids=a__			,							attention_mask=a__    )[0]
  lowerCAmelCase__     :   Tuple     		=	(embs * attention_mask.unsqueeze(2    )).sum(dim=1    ) / attention_mask.sum(dim=1    )[:, None]
  return self.LinearTransformation(a__    ), embs







'''simple docstring'''

def        UpperCAmelCase_ (  lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_			):







 """simple docstring"""


 if height >= 1:
  move_tower(height - 1      ,			lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_			)
  move_disk(lowerCamelCase_      ,			lowerCamelCase_			)
  move_tower(height - 1      ,			lowerCamelCase_      ,			lowerCamelCase_      ,			lowerCamelCase_			)


def        UpperCAmelCase_ (  lowerCamelCase_      ,			lowerCamelCase_			):







 """simple docstring"""


 print("moving disk from"      ,			lowerCamelCase_      ,			"to"      ,			lowerCamelCase_			)


def        UpperCAmelCase_ (  ):







 """simple docstring"""


 lowerCAmelCase__     :   List[str]     		=	int(input("Height of hanoi: "			).strip()			)
 move_tower(lowerCamelCase_      ,			"A"      ,			"B"      ,			"C"			)


if __name__ == "__main__":
     main()





