


'''simple docstring'''



from dataclasses import dataclass
from typing import Optional, Tuple

import torch
from torch import nn
from transformers import RobertaPreTrainedModel, XLMRobertaConfig, XLMRobertaModel
from transformers.utils import ModelOutput


@dataclass
class 						_snake_case   (       a__		):
					lowerCAmelCase :Optional[torch.FloatTensor]						=   None
					lowerCAmelCase :torch.FloatTensor						=   None
					lowerCAmelCase :Optional[Tuple[torch.FloatTensor]]						=   None
					lowerCAmelCase :Optional[Tuple[torch.FloatTensor]]						=   None


class 						_snake_case   (       a__		):




					def __init__( self							,							_lowerCamelCase=1							,							_lowerCamelCase=0							,							_lowerCamelCase=2							,							_lowerCamelCase=512							,							_lowerCamelCase="cls"							,							_lowerCamelCase=False							,							_lowerCamelCase=True							,							**_lowerCamelCase							,							):
								super().__init__(pad_token_id=_lowerCamelCase							,							bos_token_id=_lowerCamelCase							,							eos_token_id=_lowerCamelCase							,							**_lowerCamelCase)
								UpperCAmelCase__					:   List[Any]       				=       project_dim
								UpperCAmelCase__					:   str       				=       pooler_fn
								UpperCAmelCase__					:   Optional[int]       				=       learn_encoder
								UpperCAmelCase__					:   Optional[Any]       				=       use_attention_mask


class 						_snake_case   (       a__		):
					lowerCAmelCase :Any						=   [R'''pooler''', R'''logit_scale''']
					lowerCAmelCase :Tuple						=   [R'''position_ids''', R'''predictions.decoder.bias''']
					lowerCAmelCase :List[str]						=   '''roberta'''
					lowerCAmelCase :Optional[int]						=   RobertaSeriesConfig




					def __init__( self							,							_lowerCamelCase):
								super().__init__(_lowerCamelCase)
								UpperCAmelCase__					:   str       				=       XLMRobertaModel(_lowerCamelCase)
								UpperCAmelCase__					:   Optional[Any]       				=       nn.Linear(config.hidden_size							,							config.project_dim)
								UpperCAmelCase__					:   Dict       				=       getattr(_lowerCamelCase							,							"""has_pre_transformation"""							,							_lowerCamelCase)
								if self.has_pre_transformation:
											UpperCAmelCase__					:   List[Any]       				=       nn.Linear(config.hidden_size							,							config.project_dim)
											UpperCAmelCase__					:   List[str]       				=       nn.LayerNorm(config.hidden_size							,							eps=config.layer_norm_eps)
								self.post_init()




					def 			snake_case__  ( self							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							_lowerCamelCase = None							,							):
								UpperCAmelCase__					:   Union[str, Any]       				=       return_dict if return_dict is not None else self.config.use_return_dict

								UpperCAmelCase__					:   Optional[Any]       				=       self.base_model(
								    input_ids=_lowerCamelCase							,							attention_mask=_lowerCamelCase							,							token_type_ids=_lowerCamelCase							,							position_ids=_lowerCamelCase							,							head_mask=_lowerCamelCase							,							inputs_embeds=_lowerCamelCase							,							encoder_hidden_states=_lowerCamelCase							,							encoder_attention_mask=_lowerCamelCase							,							output_attentions=_lowerCamelCase							,							output_hidden_states=True if self.has_pre_transformation else output_hidden_states							,							return_dict=_lowerCamelCase							,							)

								if self.has_pre_transformation:
											UpperCAmelCase__					:   List[str]       				=       outputs["""hidden_states"""][-2]
											UpperCAmelCase__					:   List[str]       				=       self.pre_LN(_lowerCamelCase)
											UpperCAmelCase__					:   Optional[int]       				=       self.transformation_pre(_lowerCamelCase)

											return TransformationModelOutput(
											    projection_state=_lowerCamelCase							,							last_hidden_state=outputs.last_hidden_state							,							hidden_states=outputs.hidden_states							,							attentions=outputs.attentions							,							)
								else:
											UpperCAmelCase__					:   List[str]       				=       self.transformation(outputs.last_hidden_state)
											return TransformationModelOutput(
											    projection_state=_lowerCamelCase							,							last_hidden_state=outputs.last_hidden_state							,							hidden_states=outputs.hidden_states							,							attentions=outputs.attentions							,							)



'''simple docstring'''



def       _UpperCamelCase (						UpperCamelCase__ = 4_0_0_0_0_0_0   ):
			UpperCAmelCase__					:   List[str]       				=       [0, 1]
			UpperCAmelCase__					:   Any       				=       0
			while fib[i] <= n:
						fib.append(fib[i] + fib[i + 1]   )
						if fib[i + 2] > n:
									break
						i += 1
			UpperCAmelCase__					:   str       				=       0
			for j in range(len(UpperCamelCase__   ) - 1   ):
						if fib[j] % 2 == 0:
									total += fib[j]

			return total


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