





import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel




class 			__UpperCamelCase    (							A__    ):
     __A	:  str							  =   """M-CLIP"""





     def __init__(     self				,							_UpperCamelCase=1024				,							_UpperCamelCase=768				,							**_UpperCamelCase					):
        _UpperCAmelCase           =   transformerDimSize
        _UpperCAmelCase           =   imageDimSize
        super().__init__(**_UpperCamelCase					)




class 			__UpperCamelCase    (							A__    ):
     __A	:  Any							  =   MCLIPConfig





     def __init__(     self				,							_UpperCamelCase				,							*_UpperCamelCase				,							**_UpperCamelCase					):
        super().__init__(_UpperCamelCase				,							*_UpperCamelCase				,							**_UpperCamelCase					)
        _UpperCAmelCase           =   XLMRobertaModel(_UpperCamelCase					)
        _UpperCAmelCase           =   torch.nn.Linear(
            in_features=config.transformerDimensions				,							out_features=config.numDims					)





     def 		UpperCamelCase(     self				,							_UpperCamelCase				,							_UpperCamelCase					):
        _UpperCAmelCase           =   self.transformer(input_ids=_UpperCamelCase				,							attention_mask=_UpperCamelCase					)[0]
        _UpperCAmelCase           =   (embs * attention_mask.unsqueeze(2					)).sum(dim=1					) / attention_mask.sum(dim=1					)[:, None]
        return self.LinearTransformation(_UpperCamelCase					), embs


"""simple docstring"""
def 					a__						(						)	-> Union[str, Any]:
      UpperCAmelCase__			:							Dict							=    []
      UpperCAmelCase__			:							Tuple							=    1

      while len(lowerCAmelCase    ) < 1E6:
            constant.append(str(lowerCAmelCase    )    )
            i += 1

      UpperCAmelCase__			:							Any							=    """""".join(lowerCAmelCase    )

      return (
          int(constant[0]    )
          * int(constant[9]    )
          * int(constant[99]    )
          * int(constant[9_99]    )
          * int(constant[99_99]    )
          * int(constant[9_99_99]    )
          * int(constant[99_99_99]    )
      )


if __name__ == "__main__":
    print(solution())

