





import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel



class    _SCREAMING_SNAKE_CASE						(	__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			"M-CLIP"

 def __init__(self				:   Optional[Any]       , UpperCAmelCase_				:   List[Any]=1_024       , UpperCAmelCase_				:   int=768       , **UpperCAmelCase_				:   Dict)       ->List[str]:



   '''simple docstring'''



   lowerCamelCase__:      Optional[Any]			  =transformerDimSize
   lowerCamelCase__:      Tuple			  =imageDimSize
   super().__init__(**UpperCAmelCase_)



class    _SCREAMING_SNAKE_CASE						(	__SCREAMING_SNAKE_CASE    ):







 '''simple docstring'''
 lowercase_		=			MCLIPConfig

 def __init__(self				:   List[str]       , UpperCAmelCase_				:   Union[str, Any]       , *UpperCAmelCase_				:   int       , **UpperCAmelCase_				:   Dict)       ->Dict:



   '''simple docstring'''



   super().__init__(UpperCAmelCase_       , *UpperCAmelCase_       , **UpperCAmelCase_)
   lowerCamelCase__:      str			  =XLMRobertaModel(UpperCAmelCase_)
   lowerCamelCase__:      Any			  =torch.nn.Linear(
       in_features=config.transformerDimensions       , out_features=config.numDims)







 def 							SCREAMING_SNAKE_CASE_					(self				:   List[str]       , UpperCAmelCase_				:   Any       , UpperCAmelCase_				:   Union[str, Any])       ->str:



   '''simple docstring'''



   lowerCamelCase__:      str			  =self.transformer(input_ids=UpperCAmelCase_       , attention_mask=UpperCAmelCase_)[0]
   lowerCamelCase__:      Optional[int]			  =(embs * attention_mask.unsqueeze(2)).sum(dim=1) / attention_mask.sum(dim=1)[:, None]
   return self.LinearTransformation(UpperCAmelCase_), embs








from math import ceil, sqrt





def      lowerCAmelCase_ (       __a = 1000000		)     ->		int:







  """simple docstring"""





  lowerCamelCase__:      Optional[int]			  =0

  for outer_width in range(3	,    (limit // 4) + 2		):
    if outer_width**2 > limit:
      lowerCamelCase__:      Dict			  =max(ceil(sqrt(outer_width**2 - limit		)		)	,    1		)
    else:
      lowerCamelCase__:      str			  =1
    if (outer_width - hole_width_lower_bound) % 2:
      hole_width_lower_bound += 1

    answer += (outer_width - hole_width_lower_bound - 2) // 2 + 1

  return answer


if __name__ == "__main__":
     print(f'{solution() = }')

