a
    h{                  
   @   s*  d Z ddlmZ ddlmZmZmZ ddlZddlZddlm	Z	 ddl
mZ ddlmZ dd	lmZ dd
lmZmZmZ ddlmZmZ ddlmZmZmZ ddlmZmZmZ ddlm Z  e!e"Z#G dd de	j$Z%d6e	j$ej&ej&ej&eej& e'e'eej& dddZ(G dd de	j$Z)G dd de	j$Z*G dd de	j$Z+G dd de	j$Z,G dd de	j$Z-G d d! d!eZ.G d"d# d#e	j$Z/eG d$d% d%eZ0eG d&d' d'e0Z1G d(d) d)e	j$Z2G d*d+ d+e	j$Z3eG d,d- d-e0Z4eed.d/G d0d1 d1eZ5ed2d/G d3d4 d4e0Z6g d5Z7dS )7zPyTorch Splinter model.    )	dataclass)CallableOptionalUnionN)nn)CrossEntropyLoss   )ACT2FN)GradientCheckpointingLayer)BaseModelOutputModelOutputQuestionAnsweringModelOutput)ALL_ATTENTION_FUNCTIONSPreTrainedModel)apply_chunking_to_forward find_pruneable_heads_and_indicesprune_linear_layer)auto_docstringcan_return_tuplelogging   )SplinterConfigc                       sP   e Zd ZdZ fddZdeej eej eej eej e	dddZ
  ZS )	SplinterEmbeddingszGConstruct the embeddings from word, position and token_type embeddings.c                    s   t    tj|j|j|jd| _t|j|j| _	t|j
|j| _tj|j|jd| _t|j| _| jdt|jddd t|dd| _d S )	N)padding_idxepsposition_ids)r   F)
persistentposition_embedding_typeabsolute)super__init__r   	EmbeddingZ
vocab_sizehidden_sizepad_token_idword_embeddingsZmax_position_embeddingsposition_embeddingsZtype_vocab_sizetoken_type_embeddings	LayerNormlayer_norm_epsDropouthidden_dropout_probdropoutZregister_buffertorcharangeexpandgetattrr   selfconfig	__class__ j/var/www/html/assistant/venv/lib/python3.9/site-packages/transformers/models/splinter/modeling_splinter.pyr"   ,   s    
zSplinterEmbeddings.__init__N)	input_idstoken_type_idsr   inputs_embedsreturnc           
      C   s   |d ur|  }n|  d d }|d }|d u rH| jd d d |f }|d u rftj|tj| jjd}|d u rx| |}| |}|| }| jdkr| 	|}	||	7 }| 
|}| |}|S )Nr   r   dtypedevicer    )sizer   r.   zeroslongr?   r&   r(   r   r'   r)   r-   )
r3   r9   r:   r   r;   input_shape
seq_lengthr(   
embeddingsr'   r7   r7   r8   forward=   s$    






zSplinterEmbeddings.forward)NNNN)__name__
__module____qualname____doc__r"   r   r.   
LongTensorFloatTensortuplerF   __classcell__r7   r7   r5   r8   r   )   s       r           )modulequerykeyvalueattention_maskscalingr-   	head_maskc                 K   s   t ||dd| }	|d urN|d d d d d d d |jd f }
|	|
 }	tjj|	dt jd|j	}	tjj
|	|| jd}	|d ur|	|dddd }	t |	|}|dd }||	fS )N   r   r   )dimr>   )ptrainingr   )r.   matmul	transposeshaper   Z
functionalZsoftmaxZfloat32tor>   r-   r[   view
contiguous)rP   rQ   rR   rS   rT   rU   r-   rV   kwargsattn_weightsZcausal_maskattn_outputr7   r7   r8   eager_attention_forward_   s    &re   c                       sL   e Zd Z fddZdejeej eej ee e	ej dddZ
  ZS )	SplinterSelfAttentionc                    s   t    |j|j dkr>t|ds>td|j d|j d|| _|j| _t|j|j | _| j| j | _	t
|j| j	| _t
|j| j	| _t
|j| j	| _t
|j| _|j| _| jd | _d S )Nr   Zembedding_sizezThe hidden size (z6) is not a multiple of the number of attention heads ()g      )r!   r"   r$   num_attention_headshasattr
ValueErrorr4   intattention_head_sizeall_head_sizer   LinearrQ   rR   rS   r+   Zattention_probs_dropout_probr-   attention_dropoutrU   r2   r5   r7   r8   r"   |   s"    

zSplinterSelfAttention.__init__NFhidden_statesrT   rV   output_attentionsr<   c                 K   s   |j d d }g |d| jR }| ||dd}| ||dd}	| ||dd}
t}| jj	dkrt
| jj	 }|| ||	|
|f| jsdn| j| j|d|\}}|jg |dR   }|r||fn|f}|S )Nr   r   rW   eagerrO   )r-   rU   rV   )r^   rl   rQ   r`   r]   rR   rS   re   r4   Z_attn_implementationr   r[   ro   rU   Zreshapera   )r3   rq   rT   rV   rr   rb   rC   Zhidden_shapeZquery_statesZ
key_statesZvalue_statesZattention_interfacerd   rc   outputsr7   r7   r8   rF      s0    	
zSplinterSelfAttention.forward)NNF)rG   rH   rI   r"   r.   Tensorr   rL   boolrM   rF   rN   r7   r7   r5   r8   rf   {   s      rf   c                       s4   e Zd Z fddZejejejdddZ  ZS )SplinterSelfOutputc                    sB   t    t|j|j| _tj|j|jd| _t|j	| _
d S Nr   )r!   r"   r   rn   r$   denser)   r*   r+   r,   r-   r2   r5   r7   r8   r"      s    
zSplinterSelfOutput.__init__rq   input_tensorr<   c                 C   s&   |  |}| |}| || }|S Nry   r-   r)   r3   rq   r{   r7   r7   r8   rF      s    

zSplinterSelfOutput.forwardrG   rH   rI   r"   r.   ru   rF   rN   r7   r7   r5   r8   rw      s   rw   c                       sT   e Zd Z fddZdd Zd
ejeej eej ee	 e
ej ddd	Z  ZS )SplinterAttentionc                    s*   t    t|| _t|| _t | _d S r|   )r!   r"   rf   r3   rw   outputsetpruned_headsr2   r5   r7   r8   r"      s    


zSplinterAttention.__init__c                 C   s   t |dkrd S t|| jj| jj| j\}}t| jj|| j_t| jj|| j_t| jj	|| j_	t| j
j|dd| j
_| jjt | | j_| jj| jj | j_| j|| _d S )Nr   r   rY   )lenr   r3   rh   rl   r   r   rQ   rR   rS   r   ry   rm   union)r3   headsindexr7   r7   r8   prune_heads   s    zSplinterAttention.prune_headsNFrp   c           	      K   s@   | j |f|||d|}| |d |}|f|dd   }|S N)rT   rV   rr   r   r   )r3   r   )	r3   rq   rT   rV   rr   rb   Zself_outputsattention_outputrt   r7   r7   r8   rF      s    zSplinterAttention.forward)NNF)rG   rH   rI   r"   r   r.   ru   r   rL   rv   rM   rF   rN   r7   r7   r5   r8   r      s      r   c                       s0   e Zd Z fddZejejdddZ  ZS )SplinterIntermediatec                    sB   t    t|j|j| _t|jt	r6t
|j | _n|j| _d S r|   )r!   r"   r   rn   r$   intermediate_sizery   
isinstance
hidden_actstrr	   intermediate_act_fnr2   r5   r7   r8   r"      s
    
zSplinterIntermediate.__init__)rq   r<   c                 C   s   |  |}| |}|S r|   )ry   r   )r3   rq   r7   r7   r8   rF      s    

zSplinterIntermediate.forwardr   r7   r7   r5   r8   r      s   r   c                       s4   e Zd Z fddZejejejdddZ  ZS )SplinterOutputc                    sB   t    t|j|j| _tj|j|jd| _t	|j
| _d S rx   )r!   r"   r   rn   r   r$   ry   r)   r*   r+   r,   r-   r2   r5   r7   r8   r"     s    
zSplinterOutput.__init__rz   c                 C   s&   |  |}| |}| || }|S r|   r}   r~   r7   r7   r8   rF   
  s    

zSplinterOutput.forwardr   r7   r7   r5   r8   r     s   r   c                       sT   e Zd Z fddZd
ejeej eej ee e	ej dddZ
dd	 Z  ZS )SplinterLayerc                    s:   t    |j| _d| _t|| _t|| _t|| _	d S )Nr   )
r!   r"   chunk_size_feed_forwardseq_len_dimr   	attentionr   intermediater   r   r2   r5   r7   r8   r"     s    


zSplinterLayer.__init__NFrp   c           
      K   sP   | j |f|||d|}|d }|dd  }t| j| j| j|}	|	f| }|S r   )r   r   feed_forward_chunkr   r   )
r3   rq   rT   rV   rr   rb   Zself_attention_outputsr   rt   layer_outputr7   r7   r8   rF     s     
zSplinterLayer.forwardc                 C   s   |  |}| ||}|S r|   )r   r   )r3   r   Zintermediate_outputr   r7   r7   r8   r   4  s    
z SplinterLayer.feed_forward_chunk)NNF)rG   rH   rI   r"   r.   ru   r   rL   rv   rM   rF   r   rN   r7   r7   r5   r8   r     s      r   c                       sd   e Zd Z fddZed	ejeej eej ee	 ee	 ee	 e
eej ef dddZ  ZS )
SplinterEncoderc                    s:   t     | _t fddt jD | _d| _d S )Nc                    s   g | ]}t  qS r7   )r   ).0ir4   r7   r8   
<listcomp>?      z,SplinterEncoder.__init__.<locals>.<listcomp>F)	r!   r"   r4   r   Z
ModuleListrangenum_hidden_layerslayerZgradient_checkpointingr2   r5   r   r8   r"   <  s    
 zSplinterEncoder.__init__NFT)rq   rT   rV   rr   output_hidden_statesreturn_dictr<   c                 K   s   |rdnd }|rdnd }	t | jD ]\\}
}|r8||f }|d urH||
 nd }|f ||||d|}|d }|r"|	|d f }	q"|r||f }t|||	dS )Nr7   )rq   rT   rV   rr   r   r   Zlast_hidden_staterq   
attentions)	enumerater   r   )r3   rq   rT   rV   rr   r   r   rb   Zall_hidden_statesZall_self_attentionsr   Zlayer_moduleZlayer_head_maskZlayer_outputsr7   r7   r8   rF   B  s0    

zSplinterEncoder.forward)NNFFT)rG   rH   rI   r"   r   r.   ru   r   rL   rv   r   rM   r   rF   rN   r7   r7   r5   r8   r   ;  s         r   c                   @   s&   e Zd ZU eed< dZdZdd ZdS )SplinterPreTrainedModelr4   splinterTc                 C   s   t |tjr:|jjjd| jjd |jdur|jj	  nft |tj
rz|jjjd| jjd |jdur|jj|j 	  n&t |tjr|jj	  |jjd dS )zInitialize the weightsrO   )meanZstdNg      ?)r   r   rn   weightdataZnormal_r4   Zinitializer_rangebiasZzero_r#   r   r)   Zfill_)r3   rP   r7   r7   r8   _init_weightsr  s    

z%SplinterPreTrainedModel._init_weightsN)rG   rH   rI   r   __annotations__Zbase_model_prefixZsupports_gradient_checkpointingr   r7   r7   r7   r8   r   l  s   
r   c                       s   e Zd ZdZ fddZdd Zdd Zdd	 Zee	de
ej e
ej e
ej e
ej e
ej e
ej e
e e
e e
e eeef d
ddZ  ZS )SplinterModela2  
    The model is an encoder (with only self-attention) following the architecture described in [Attention is all you
    need](https://huggingface.co/papers/1706.03762) by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones,
    Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.
    c                    s2   t  | || _t|| _t|| _|   d S r|   )r!   r"   r4   r   rE   r   encoder	post_initr2   r5   r7   r8   r"     s
    

zSplinterModel.__init__c                 C   s   | j jS r|   rE   r&   )r3   r7   r7   r8   get_input_embeddings  s    z"SplinterModel.get_input_embeddingsc                 C   s   || j _d S r|   r   )r3   rS   r7   r7   r8   set_input_embeddings  s    z"SplinterModel.set_input_embeddingsc                 C   s*   |  D ]\}}| jj| j| qdS )z
        Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base
        class PreTrainedModel
        N)itemsr   r   r   r   )r3   Zheads_to_pruner   r   r7   r7   r8   _prune_heads  s    zSplinterModel._prune_headsN)
r9   rT   r:   r   rV   r;   rr   r   r   r<   c
                 C   sD  |dur|n| j j}|dur |n| j j}|	dur4|	n| j j}	|durV|durVtdn@|durt| || | }
n"|dur| dd }
ntd|
\}}|dur|jn|j}|du rtj	||f|d}|du rtj
|
tj|d}| ||
}| || j j}| j||||d}| j|||||dd	}|d
 }t||j|jdS )a  
        token_type_ids (`torch.LongTensor` of shape `batch_size, sequence_length`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,
            1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.

            [What are token type IDs?](../glossary#token-type-ids)
        position_ids (`torch.LongTensor` of shape `batch_size, sequence_length`, *optional*):
            Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
            config.max_position_embeddings - 1]`.

            [What are position IDs?](../glossary#position-ids)
        NzDYou cannot specify both input_ids and inputs_embeds at the same timer   z5You have to specify either input_ids or inputs_embeds)r?   r=   )r9   r   r:   r;   T)rT   rV   rr   r   r   r   r   )r4   rr   r   use_return_dictrj   Z%warn_if_padding_and_no_attention_maskr@   r?   r.   ZonesrA   rB   Zget_extended_attention_maskZget_head_maskr   rE   r   r   rq   r   )r3   r9   rT   r:   r   rV   r;   rr   r   r   rC   
batch_sizerD   r?   Zextended_attention_maskZembedding_outputZencoder_outputssequence_outputr7   r7   r8   rF     sP    

zSplinterModel.forward)	NNNNNNNNN)rG   rH   rI   rJ   r"   r   r   r   r   r   r   r.   ru   rv   r   rM   r   rF   rN   r7   r7   r5   r8   r     s8   
         
r   c                       s2   e Zd Zd fdd	ZejejdddZ  ZS )SplinterFullyConnectedLayergeluc                    sD   t    || _|| _t| j| j| _t| | _t	| j| _	d S r|   )
r!   r"   	input_dim
output_dimr   rn   ry   r	   act_fnr)   )r3   r   r   r   r5   r7   r8   r"     s    

z$SplinterFullyConnectedLayer.__init__)inputsr<   c                 C   s"   |  |}| |}| |}|S r|   )ry   r   r)   )r3   r   rq   r7   r7   r8   rF     s    


z#SplinterFullyConnectedLayer.forward)r   r   r7   r7   r5   r8   r     s   
r   c                       s(   e Zd ZdZ fddZdd Z  ZS )QuestionAwareSpanSelectionHeadzf
    Implementation of Question-Aware Span Selection (QASS) head, described in Splinter's paper:

    c                    sz   t    t|j|j| _t|j|j| _t|j|j| _t|j|j| _tj	|j|jdd| _
tj	|j|jdd| _d S )NF)r   )r!   r"   r   r$   query_start_transformquery_end_transformstart_transformend_transformr   rn   start_classifierend_classifierr2   r5   r7   r8   r"     s    
z'QuestionAwareSpanSelectionHead.__init__c                 C   s   |  \}}}|ddd|}tj|d|d}| |}| |}| |}	| |}
| 	|}|	
ddd}	t||	}| |}|

ddd}
t||
}||fS )Nr   r   )rY   r   r   rW   )r@   	unsqueezerepeatr.   Zgatherr   r   r   r   r   Zpermuter\   r   )r3   r   	positions_rY   r   Zgathered_repsZquery_start_repsZquery_end_repsZ
start_repsZend_repsrq   start_logits
end_logitsr7   r7   r8   rF     s    





z&QuestionAwareSpanSelectionHead.forward)rG   rH   rI   rJ   r"   rF   rN   r7   r7   r5   r8   r     s   r   c                       s   e Zd Z fddZedeej eej eej eej eej eej eej eej ee	 ee	 ee	 eej e
eef dddZ  ZS )SplinterForQuestionAnsweringc                    s4   t  | t|| _t|| _|j| _|   d S r|   r!   r"   r   r   r   splinter_qassquestion_token_idr   r2   r5   r7   r8   r"   4  s
    

z%SplinterForQuestionAnswering.__init__Nr9   rT   r:   r   rV   r;   start_positionsend_positionsrr   r   r   question_positionsr<   c                 C   s  |dur|n| j j}d}|du rr|durFtjt|| j dd}ntj|dtj	|j
|jd}|d}d}| j|||||||	|
|d	}|d }| ||\}}|r|d	|d	 }}|dur|d	| t|jj  }|d	| t|jj  }d}|dur|durt| d	kr0|d}t| d	krL|d}|d	}|d| |d| t|d
}|||}|||}|| d }|s||f|d	d  }|dur|f| S |S t||||j|jdS )a  
        token_type_ids (`torch.LongTensor` of shape `batch_size, sequence_length`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,
            1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.

            [What are token type IDs?](../glossary#token-type-ids)
        position_ids (`torch.LongTensor` of shape `batch_size, sequence_length`, *optional*):
            Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
            config.max_position_embeddings - 1]`.

            [What are position IDs?](../glossary#position-ids)
        question_positions (`torch.LongTensor` of shape `(batch_size, num_questions)`, *optional*):
            The positions of all question tokens. If given, start_logits and end_logits will be of shape `(batch_size,
            num_questions, sequence_length)`. If None, the first question token in each sequence in the batch will be
            the only one for which start_logits and end_logits are calculated and they will be of shape `(batch_size,
            sequence_length)`.
        NFr   r   r   )r>   layoutr?   TrT   r:   r   rV   r;   rr   r   r   r   Zignore_indexrW   lossr   r   rq   r   )r4   r   r.   Zargmaxeqr   rk   rA   r@   rB   r   r?   r   r   r   Zsqueezefinfor>   minr   clamp_r   r   rq   r   )r3   r9   rT   r:   r   rV   r;   r   r   rr   r   r   r   Zquestion_positions_were_noneZ"question_position_for_each_examplert   r   r   r   
total_lossZignored_indexloss_fct
start_lossend_lossr   r7   r7   r8   rF   >  sj    $






z$SplinterForQuestionAnswering.forward)NNNNNNNNNNNN)rG   rH   rI   r"   r   r   r.   ru   rK   rv   r   rM   r   rF   rN   r7   r7   r5   r8   r   2  s:   
            
r   zB
    Class for outputs of Splinter as a span selection model.
    )Zcustom_introc                   @   st   e Zd ZU dZdZeej ed< dZ	eej ed< dZ
eej ed< dZeeej  ed< dZeeej  ed< dS )SplinterForPreTrainingOutputa  
    loss (`torch.FloatTensor` of shape `(1,)`, *optional*, returned when start and end positions are provided):
        Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.
    start_logits (`torch.FloatTensor` of shape `(batch_size, num_questions, sequence_length)`):
        Span-start scores (before SoftMax).
    end_logits (`torch.FloatTensor` of shape `(batch_size, num_questions, sequence_length)`):
        Span-end scores (before SoftMax).
    Nr   r   r   rq   r   )rG   rH   rI   rJ   r   r   r.   rL   r   r   r   rq   rM   r   r7   r7   r7   r8   r     s   
	r   z
    Splinter Model for the recurring span selection task as done during the pretraining. The difference to the QA task
    is that we do not have a question, but multiple question tokens that replace the occurrences of recurring spans
    instead.
    c                       s   e Zd Z fddZed
eej eej eej eej eej eej eej eej ee	 ee	 ee	 eej e
eef dddZejejddd	Z  ZS )SplinterForPreTrainingc                    s4   t  | t|| _t|| _|j| _|   d S r|   r   r2   r5   r7   r8   r"     s
    

zSplinterForPreTraining.__init__Nr   c                 C   s  |dur|n| j j}|du r6|dur6|dur6tdn,|du rP|du rPtdn|du rb| |}| j|||||||	|
|d	}|d }| \}}}| ||\}}|d}|dur|d|||}|d| t	
|jj  }|d| t	
|jj  }d}|dur|dur|dtd|d  |dtd|d  t| j jd}|||| |||| }|||| |||| }|| d }|s||f|dd  }|dur|f| S |S t||||j|jd	S )
a  
        input_ids (`torch.LongTensor` of shape `(batch_size, num_questions, sequence_length)`):
            Indices of input sequence tokens in the vocabulary.

            Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
            [`PreTrainedTokenizer.__call__`] for details.

            [What are input IDs?](../glossary#input-ids)
        token_type_ids (`torch.LongTensor` of shape `batch_size, num_questions, sequence_length`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,
            1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.

            [What are token type IDs?](../glossary#token-type-ids)
        position_ids (`torch.LongTensor` of shape `batch_size, num_questions, sequence_length`, *optional*):
            Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
            config.max_position_embeddings - 1]`.

            [What are position IDs?](../glossary#position-ids)
        inputs_embeds (`torch.FloatTensor` of shape `(batch_size, num_questions, sequence_length, hidden_size)`, *optional*):
            Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
            is useful if you want more control over how to convert *input_ids* indices into associated vectors than the
            model's internal embedding lookup matrix.
        start_positions (`torch.LongTensor` of shape `(batch_size, num_questions)`, *optional*):
            Labels for position (index) of the start of the labelled span for computing the token classification loss.
            Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
            are not taken into account for computing the loss.
        end_positions (`torch.LongTensor` of shape `(batch_size, num_questions)`, *optional*):
            Labels for position (index) of the end of the labelled span for computing the token classification loss.
            Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
            are not taken into account for computing the loss.
        question_positions (`torch.LongTensor` of shape `(batch_size, num_questions)`, *optional*):
            The positions of all question tokens. If given, start_logits and end_logits will be of shape `(batch_size,
            num_questions, sequence_length)`. If None, the first question token in each sequence in the batch will be
            the only one for which start_logits and end_logits are calculated and they will be of shape `(batch_size,
            sequence_length)`.
        NzCquestion_positions must be specified in order to calculate the lossz>question_positions must be specified when input_embeds is usedr   r   r   r   rW   r   )r4   r   	TypeError_prepare_question_positionsr   r@   r   r   r0   r.   r   r>   r   r   maxr   r%   r`   r   rq   r   )r3   r9   rT   r:   r   rV   r;   r   r   rr   r   r   r   rt   r   r   Zsequence_lengthrY   r   r   num_questionsZ attention_mask_for_each_questionr   r   r   r   r   r7   r7   r8   rF     sh    7




zSplinterForPreTraining.forward)r9   r<   c                 C   sl   t || jjk\}}t |}t j|d| f| jjt j	|j
d}t dd |D }||||f< |S )Nr   r=   c                 S   s   g | ]}t |qS r7   )r.   r/   )r   nr7   r7   r8   r   T  r   zFSplinterForPreTraining._prepare_question_positions.<locals>.<listcomp>)r.   wherer4   r   Zbincountfullr@   r   r%   rB   r?   cat)r3   r9   rowsZflat_positionsr   r   colsr7   r7   r8   r   K  s    
z2SplinterForPreTraining._prepare_question_positions)NNNNNNNNNNNN)rG   rH   rI   r"   r   r   r.   ru   rK   rv   r   rM   r   rF   r   rN   r7   r7   r5   r8   r     s<   
            
|r   )r   r   r   r   r   )rO   N)8rJ   dataclassesr   typingr   r   r   r.   Ztorch.utils.checkpointr   Ztorch.nnr   Zactivationsr	   Zmodeling_layersr
   Zmodeling_outputsr   r   r   Zmodeling_utilsr   r   Zpytorch_utilsr   r   r   utilsr   r   r   Zconfiguration_splinterr   Z
get_loggerrG   loggerModuler   ru   floatre   rf   rw   r   r   r   r   r   r   r   r   r   r   r   r   __all__r7   r7   r7   r8   <module>   sj   
=  ;.)1v&r 