
    rhc                        d dl mZ d dlmZ d dlZd dlmZ d dl	m
Z
mZmZ d dl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mZ dd	lmZmZ d
dlmZ dZ dZ! G d dejD                        Z# G d dejD                        Z$ G d dejD                        Z% G d dejD                        Z& G d dejD                        Z' G d dejD                        Z( G d dejD                        Z) G d dejD                        Z* G d dejD                        Z+ G d  d!ejD                        Z, G d" d#ejD                        Z- G d$ d%e      Z. G d& d'ejD                        Z/ ed(e        G d) d*e.             Z0d+Z1 ee0e1        ee0ee,        G d- d.ejD                        Z2 ed/e        G d0 d1e.             Z3d2Z4 ee3e4        ee3ee,       g d3Z5y)4    )OptionalN)
FrozenDictfreezeunfreeze)dot_product_attention_weights)flatten_dictunflatten_dict   )FlaxBaseModelOutputFlaxBaseModelOutputWithPoolingFlaxSequenceClassifierOutput)ACT2FNFlaxPreTrainedModel append_replace_return_docstringsoverwrite_call_docstring)add_start_docstrings%add_start_docstrings_to_model_forward   )	ViTConfiga  

    This model inherits from [`FlaxPreTrainedModel`]. Check the superclass documentation for the generic methods the
    library implements for all its model (such as downloading, saving and converting weights from PyTorch models)

    This model is also a
    [flax.linen.Module](https://flax.readthedocs.io/en/latest/api_reference/flax.linen/module.html) subclass. Use it as
    a regular Flax linen Module and refer to the Flax documentation for all matter related to general usage and
    behavior.

    Finally, this model supports inherent JAX features such as:

    - [Just-In-Time (JIT) compilation](https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit)
    - [Automatic Differentiation](https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation)
    - [Vectorization](https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap)
    - [Parallelization](https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap)

    Parameters:
        config ([`ViTConfig`]): Model configuration class with all the parameters of the model.
            Initializing with a config file does not load the weights associated with the model, only the
            configuration. Check out the [`~FlaxPreTrainedModel.from_pretrained`] method to load the model weights.
        dtype (`jax.numpy.dtype`, *optional*, defaults to `jax.numpy.float32`):
            The data type of the computation. Can be one of `jax.numpy.float32`, `jax.numpy.float16` (on GPUs) and
            `jax.numpy.bfloat16` (on TPUs).

            This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
            specified all the computation will be performed with the given `dtype`.

            **Note that this only specifies the dtype of the computation and does not influence the dtype of model
            parameters.**

            If you wish to change the dtype of the model parameters, see [`~FlaxPreTrainedModel.to_fp16`] and
            [`~FlaxPreTrainedModel.to_bf16`].
a  
    Args:
        pixel_values (`numpy.ndarray` of shape `(batch_size, num_channels, height, width)`):
            Pixel values. Pixel values can be obtained using [`AutoImageProcessor`]. See [`ViTImageProcessor.__call__`]
            for details.

        output_attentions (`bool`, *optional*):
            Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
            tensors for more detail.
        output_hidden_states (`bool`, *optional*):
            Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
            more detail.
        return_dict (`bool`, *optional*):
            Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
c                   Z    e Zd ZU eed<   ej                  Zej                  ed<   d Zd Z	y)FlaxViTPatchEmbeddingsconfigdtypec                    | j                   j                  }| j                   j                  }||z  ||z  z  }|| _        | j                   j                  | _        t        j                  | j                   j                  ||f||fd| j                  t        j
                  j                  j                  | j                   j                  dz  dd            | _        y )NVALID   fan_intruncated_normal)kernel_sizestridespaddingr   kernel_init)r   
image_size
patch_sizenum_patchesnum_channelsnnConvhidden_sizer   jaxinitializersvariance_scalinginitializer_range
projection)selfr#   r$   r%   s       |/var/www/html/ai-insurance-compliance-backend/venv/lib/python3.12/site-packages/transformers/models/vit/modeling_flax_vit.pysetupzFlaxViTPatchEmbeddings.setup\   s    [[++
[[++
!Z/J*4LM& KK44''KK###Z0,**++<<--q0(<N	
    c                     |j                   d   }|| j                  k7  rt        d      | j                  |      }|j                   \  }}}}t	        j
                  ||d|f      S )NzeMake sure that the channel dimension of the pixel values match with the one set in the configuration.)shaper&   
ValueErrorr.   jnpreshape)r/   pixel_valuesr&   
embeddings
batch_size_channelss          r0   __call__zFlaxViTPatchEmbeddings.__call__m   sl    #))"-4,,,w  __\2
%/%5%5"
Aq({{:
B'ABBr2   N
__name__
__module____qualname__r   __annotations__r7   float32r   r1   r>    r2   r0   r   r   X   s%    {{E399"
"Cr2   r   c                   `    e Zd ZU dZeed<   ej                  Zej                  ed<   d Z	ddZ
y)FlaxViTEmbeddingsz7Construct the CLS token, position and patch embeddings.r   r   c                    | j                  dt        j                  j                  j	                  | j
                  j                  dz  dd      dd| j
                  j                  f      | _        t        | j
                  | j                        | _        | j                  j                  }| j                  dt        j                  j                  j	                  | j
                  j                  dz  dd      d|dz   | j
                  j                  f      | _        t        j                  | j
                  j                        | _        y )	N	cls_tokenr   r   r   r   r   position_embeddingsrate)paramr*   r'   r+   r,   r   r-   r)   rI   r   r   patch_embeddingsr%   rK   Dropouthidden_dropout_probdropout)r/   r%   s     r0   r1   zFlaxViTEmbeddings.setup~   s    FF001N1NPQ1QS[]op4;;**+

 !7t{{$** U++77#'::!FF001N1NPQ1QS[]opa!8!89$
 
 zzt{{'F'FGr2   c                 *   |j                   d   }| j                  |      }t        j                  | j                  |d| j
                  j                  f      }t        j                  ||fd      }|| j                  z   }| j                  ||      }|S )Nr   r   )axisdeterministic)
r5   rO   r7   broadcast_torI   r   r)   concatenaterK   rR   )r/   r9   rV   r;   r:   
cls_tokenss         r0   r>   zFlaxViTEmbeddings.__call__   s    !''*
**<8
%%dnnz1dkkF]F]6^_
__j*%=AF
$":"::
\\*M\J
r2   NT)r@   rA   rB   __doc__r   rC   r7   rD   r   r1   r>   rE   r2   r0   rG   rG   x   s(    A{{E399"H	r2   rG   c                   f    e Zd ZU eed<   ej                  Zej                  ed<   d Zdde	de	fdZ
y)	FlaxViTSelfAttentionr   r   c           	         | j                   j                  | j                   j                  z  dk7  rt        d      t	        j
                  | j                   j                  | j                  t        j                  j                  j                  | j                   j                  dz  dd      | j                   j                        | _        t	        j
                  | j                   j                  | j                  t        j                  j                  j                  | j                   j                  dz  dd      | j                   j                        | _        t	        j
                  | j                   j                  | j                  t        j                  j                  j                  | j                   j                  dz  dd      | j                   j                        | _        y )Nr   z`config.hidden_size`: {self.config.hidden_size} has to be a multiple of `config.num_attention_heads`: {self.config.num_attention_heads}r   r   r   )modedistribution)r   r"   use_bias)r   r)   num_attention_headsr6   r'   Denser   r*   r+   r,   r-   qkv_biasquerykeyvaluer/   s    r0   r1   zFlaxViTSelfAttention.setup   sp   ;;""T[[%D%DDI5 
 XXKK##**++<<--q0xN` =  [[))

 88KK##**++<<--q0xN` =  [[))
 XXKK##**++<<--q0xN` =  [[))

r2   rV   output_attentionsc           
      H   | j                   j                  | j                   j                  z  }| j                  |      j	                  |j
                  d d | j                   j                  |fz         }| j                  |      j	                  |j
                  d d | j                   j                  |fz         }| j                  |      j	                  |j
                  d d | j                   j                  |fz         }d }|s*| j                   j                  dkD  r| j                  d      }t        |||| j                   j                  d|| j                  d       }	t        j                  d|	|      }
|
j	                  |
j
                  d d dz         }
|r|
|	f}|S |
f}|S )Nr   g        rR   T)dropout_rngdropout_ratebroadcast_dropoutrV   r   	precisionz...hqk,...khd->...qhd)r4   )r   r)   rb   re   r8   r5   rg   rf   attention_probs_dropout_probmake_rngr   r   r7   einsum)r/   hidden_statesrV   ri   head_dimquery_statesvalue_states
key_statesrk   attn_weightsattn_outputoutputss               r0   r>   zFlaxViTSelfAttention.__call__   s   ;;**dkk.M.MMzz-088#t{{'F'F&QQ
 zz-088#t{{'F'F&QQ
 XXm,44#t{{'F'F&QQ

 !I!IC!O--	2K4#AA"'**	
 jj!8,U!))+*;*;BQ*?%*GH1B;- JUr2   NTFr@   rA   rB   r   rC   r7   rD   r   r1   boolr>   rE   r2   r0   r]   r]      s4    {{E399"
@ T  UY  r2   r]   c                   b    e Zd ZU eed<   ej                  Zej                  ed<   d Zdde	fdZ
y)FlaxViTSelfOutputr   r   c                 X   t        j                  | j                  j                  t        j                   j
                  j                  | j                  j                  dz  dd      | j                        | _	        t        j                  | j                  j                        | _        y Nr   r   r   r"   r   rL   r'   rc   r   r)   r*   r+   r,   r-   r   denserP   rQ   rR   rh   s    r0   r1   zFlaxViTSelfOutput.setup   s    XXKK##++<<--q0(<N **

 zzt{{'F'FGr2   rV   c                 N    | j                  |      }| j                  ||      }|S NrU   r   rR   )r/   rr   input_tensorrV   s       r0   r>   zFlaxViTSelfOutput.__call__   s(    

=1]-Pr2   NrZ   r{   rE   r2   r0   r~   r~      s,    {{E399"H4 r2   r~   c                   b    e Zd ZU eed<   ej                  Zej                  ed<   d Zdde	fdZ
y)FlaxViTAttentionr   r   c                     t        | j                  | j                        | _        t	        | j                  | j                        | _        y NrJ   )r]   r   r   	attentionr~   outputrh   s    r0   r1   zFlaxViTAttention.setup   s.    -dkkL'4::Fr2   ri   c                 |    | j                  |||      }|d   }| j                  |||      }|f}|r	||d   fz  }|S NrV   ri   r   rU   r   )r   r   )r/   rr   rV   ri   attn_outputsrx   ry   s          r0   r>   zFlaxViTAttention.__call__   sU    ~~m=du~v"1oKm\ "Q))Gr2   Nrz   r{   rE   r2   r0   r   r      s,    {{E399"G
T 
r2   r   c                   Z    e Zd ZU eed<   ej                  Zej                  ed<   d Zd Z	y)FlaxViTIntermediater   r   c                 >   t        j                  | j                  j                  t        j                   j
                  j                  | j                  j                  dz  dd      | j                        | _	        t        | j                  j                     | _        y Nr   r   r   r   )r'   rc   r   intermediate_sizer*   r+   r,   r-   r   r   r   
hidden_act
activationrh   s    r0   r1   zFlaxViTIntermediate.setup  so    XXKK))++<<--q0(<N **

 !!7!78r2   c                 J    | j                  |      }| j                  |      }|S Nr   r   )r/   rr   s     r0   r>   zFlaxViTIntermediate.__call__  s$    

=16r2   Nr?   rE   r2   r0   r   r   	  s$    {{E399"9r2   r   c                   b    e Zd ZU eed<   ej                  Zej                  ed<   d Zdde	fdZ
y)FlaxViTOutputr   r   c                 X   t        j                  | j                  j                  t        j                   j
                  j                  | j                  j                  dz  dd      | j                        | _	        t        j                  | j                  j                        | _        y r   r   rh   s    r0   r1   zFlaxViTOutput.setup!  r   r2   rV   c                 X    | j                  |      }| j                  ||      }||z   }|S r   r   )r/   rr   attention_outputrV   s       r0   r>   zFlaxViTOutput.__call__+  s3    

=1]-P%(88r2   NrZ   r{   rE   r2   r0   r   r     s,    {{E399"Ht r2   r   c                   f    e Zd ZU eed<   ej                  Zej                  ed<   d Zdde	de	fdZ
y)	FlaxViTLayerr   r   c                    t        | j                  | j                        | _        t	        | j                  | j                        | _        t        | j                  | j                        | _        t        j                  | j                  j                  | j                        | _        t        j                  | j                  j                  | j                        | _        y NrJ   )epsilonr   )r   r   r   r   r   intermediater   r   r'   	LayerNormlayer_norm_epslayernorm_beforelayernorm_afterrh   s    r0   r1   zFlaxViTLayer.setup6  s    )$++TZZH/4::N#DKKtzzB "T[[5O5OW[WaWa b!||DKK4N4NVZV`V`ar2   rV   ri   c                     | j                  | j                  |      ||      }|d   }||z   }| j                  |      }| j                  |      }| j	                  |||      }|f}|r	||d   fz  }|S r   )r   r   r   r   r   )r/   rr   rV   ri   attention_outputsr   layer_outputry   s           r0   r>   zFlaxViTLayer.__call__=  s     NN!!-0'/ + 
 -Q/ ,m; ++,<=)),7M3CS`a ")!,..Gr2   Nrz   r{   rE   r2   r0   r   r   2  s4    {{E399"bT UY r2   r   c            	       v    e Zd ZU eed<   ej                  Zej                  ed<   d Z	 	 	 	 d
de	de	de	de	fdZ
y	)FlaxViTLayerCollectionr   r   c           	          t        | j                  j                        D cg c]-  }t        | j                  t	        |      | j
                        / c}| _        y c c}w )N)namer   )ranger   num_hidden_layersr   strr   layers)r/   is     r0   r1   zFlaxViTLayerCollection.setupZ  sE    NSTXT_T_TqTqNr
IJL3q6D
 
s   2ArV   ri   output_hidden_statesreturn_dictc                     |rdnd }|rdnd }t        | j                        D ])  \  }}	|r||fz  } |	|||      }
|
d   }|s!||
d   fz  }+ |r||fz  }|f}|st        d |D              S t        |||      S )NrE   r   r   r   c              3   &   K   | ]	  }||  y wr   rE   ).0vs     r0   	<genexpr>z2FlaxViTLayerCollection.__call__.<locals>.<genexpr>z  s     =qq}=s   )last_hidden_staterr   
attentions)	enumerater   tupler   )r/   rr   rV   ri   r   r   all_attentionsall_hidden_statesr   layerlayer_outputsry   s               r0   r>   zFlaxViTLayerCollection.__call___  s      1d"6BD!$++. 		6HAu#!m%55!!-}`qrM)!,M =#3"55		6  -!11 "=G==="+;LYg
 	
r2   NTFFTr{   rE   r2   r0   r   r   V  sZ    {{E399"
 #"'%* 
 
  	

 #
 
r2   r   c            	       v    e Zd ZU eed<   ej                  Zej                  ed<   d Z	 	 	 	 d
de	de	de	de	fdZ
y	)FlaxViTEncoderr   r   c                 P    t        | j                  | j                        | _        y r   )r   r   r   r   rh   s    r0   r1   zFlaxViTEncoder.setup  s    +DKKtzzJ
r2   rV   ri   r   r   c                 .    | j                  |||||      S )NrV   ri   r   r   )r   )r/   rr   rV   ri   r   r   s         r0   r>   zFlaxViTEncoder.__call__  s)     zz'/!5#  
 	
r2   Nr   r{   rE   r2   r0   r   r     s[    {{E399"K #"'%* 
 
  	

 #
 
r2   r   c                   Z    e Zd ZU eed<   ej                  Zej                  ed<   d Zd Z	y)FlaxViTPoolerr   r   c                 >   t        j                  | j                  j                  t        j                   j
                  j                  | j                  j                  dz  dd      | j                        | _	        t        | j                  j                     | _        y r   )r'   rc   r   pooler_output_sizer*   r+   r,   r-   r   r   r   
pooler_actr   rh   s    r0   r1   zFlaxViTPooler.setup  so    XXKK**++<<--q0(<N **

 !!7!78r2   c                 X    |d d df   }| j                  |      }| j                  |      S )Nr   r   )r/   rr   cls_hidden_states      r0   r>   zFlaxViTPooler.__call__  s1    (A.::&67/00r2   Nr?   rE   r2   r0   r   r     s$    {{E399"91r2   r   c                   z    e Zd ZU dZeZdZdZdZe	j                  ed<   ddej                  dfded	ed
ej                  def fdZddej&                  j(                  dededefdZ eej5                  d            	 	 	 	 	 	 ddee   dej&                  j(                  dedee   dee   dee   fd       Z xZS )FlaxViTPreTrainedModelz
    An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained
    models.
    vitr9   Nmodule_classr   Tr   seedr   _do_initc                      | j                   d||d|}|$d|j                  |j                  |j                  f}t        |   ||||||       y )N)r   r   r   )input_shaper   r   r   rE   )r   r#   r&   super__init__)	r/   r   r   r   r   r   kwargsmodule	__class__s	           r0   r   zFlaxViTPreTrainedModel.__init__  sc     #""H&HHf//1B1BFDWDWXK[tSXcklr2   rngr   paramsreturnc                    t        j                  || j                        }t        j                  j                  |      \  }}||d}| j                  j                  ||d      d   }|dt        t        |            }t        t        |            }| j                  D ]
  }	||	   ||	<    t               | _
        t        t        |            S |S )NrJ   )r   rR   F)r   r   )r7   zerosr   r*   randomsplitr   initr   r   _missing_keyssetr   r	   )
r/   r   r   r   r9   
params_rngrk   rngsrandom_paramsmissing_keys
             r0   init_weightsz#FlaxViTPreTrainedModel.init_weights  s    yyDJJ?"%**"2"23"7
K$=((|(OPXY(-)@AM!(6"23F#11 A&3K&@{#A!$D.011  r2   zbatch_size, sequence_lengthrk   trainri   r   r   c           	         ||n| j                   j                  }||n| j                   j                  }||n| j                   j                  }t	        j
                  |d      }i }|||d<   | j                  j                  d|xs | j                  it	        j                  |t        j                        | ||||      S )N)r   r   r
   r   rR   r   rJ   )r   )r   ri   r   r   r7   	transposer   applyr   arrayrD   )	r/   r9   r   rk   r   ri   r   r   r   s	            r0   r>   zFlaxViTPreTrainedModel.__call__  s     2C1N-TXT_T_TqTq$8$D $++JjJj 	 &1%<k$++BYBY}}\<@")DO{{  v,-IIl#++6I  ! 
 	
r2   r   )NNFNNN)r@   rA   rB   r[   r   config_classbase_model_prefixmain_input_namer   r'   ModulerC   r7   rD   intr   r|   r   r*   r   PRNGKeyr   r   r   r   VIT_INPUTS_DOCSTRINGformatr   dictr>   __classcell__)r   s   @r0   r   r     s,   
 L$O"L"))"
 ;;mm 	m
 yym m!

 2 2 ! !PZ !fp !& ++?+F+FGd+ef "&*.,0/3&*
 
 ZZ''	

 
 $D>
 'tn
 d^
 g
r2   r   c            	           e Zd ZU eed<   ej                  Zej                  ed<   dZe	ed<   d Z
	 	 	 	 dde	de	de	d	e	fd
Zy)FlaxViTModuler   r   Tadd_pooling_layerc                    t        | j                  | j                        | _        t	        | j                  | j                        | _        t        j                  | j                  j                  | j                        | _	        | j                  r't        | j                  | j                        | _        y d | _        y r   )rG   r   r   r:   r   encoderr'   r   r   	layernormr  r   poolerrh   s    r0   r1   zFlaxViTModule.setup   sv    +DKKtzzJ%dkkDdkk.H.HPTPZPZ[FJF\F\mDKKtzzBbfr2   rV   ri   r   r   c                 2   | j                  ||      }| j                  |||||      }|d   }| j                  |      }| j                  r| j	                  |      nd }|s|	|f|dd  z   S ||f|dd  z   S t        |||j                  |j                        S )NrU   r   r   r   )r   pooler_outputrr   r   )r:   r  r  r  r  r   rr   r   )	r/   r9   rV   ri   r   r   rr   ry   pooleds	            r0   r>   zFlaxViTModule.__call__  s     MR,,'/!5#  
  
}5/3/E/E]+4~%''!"+55!6*WQR[88-+ !//))	
 	
r2   Nr   )r@   rA   rB   r   rC   r7   rD   r   r  r|   r1   r>   rE   r2   r0   r   r     sf    {{E399""t"g #"'%*  
  
  	 

 # 
  
r2   r   z]The bare ViT Model transformer outputting raw hidden-states without any specific head on top.c                       e Zd ZeZy)FlaxViTModelN)r@   rA   rB   r   r   rE   r2   r0   r
  r
  )  s	    
 !Lr2   r
  a  
    Returns:

    Examples:

    ```python
    >>> from transformers import AutoImageProcessor, FlaxViTModel
    >>> from PIL import Image
    >>> import requests

    >>> url = "http://images.cocodataset.org/val2017/000000039769.jpg"
    >>> image = Image.open(requests.get(url, stream=True).raw)

    >>> image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224-in21k")
    >>> model = FlaxViTModel.from_pretrained("google/vit-base-patch16-224-in21k")

    >>> inputs = image_processor(images=image, return_tensors="np")
    >>> outputs = model(**inputs)
    >>> last_hidden_states = outputs.last_hidden_state
    ```
)output_typer   c                   l    e Zd ZU eed<   ej                  Zej                  ed<   d Z	 	 	 	 	 dde	fdZ
y)#FlaxViTForImageClassificationModuler   r   c           	      H   t        | j                  | j                  d      | _        t	        j
                  | j                  j                  | j                  t        j                  j                  j                  | j                  j                  dz  dd            | _        y )NF)r   r   r  r   r   r   )r   r"   )r   r   r   r   r'   rc   
num_labelsr*   r+   r,   r-   
classifierrh   s    r0   r1   z)FlaxViTForImageClassificationModule.setupO  sn     4::Y^_((KK""**++<<--q0(<N
r2   NrV   c                     ||n| j                   j                  }| j                  |||||      }|d   }| j                  |d d dd d f         }|s|f|dd  z   }	|	S t	        ||j
                  |j                        S )Nr   r   r   )logitsrr   r   )r   use_return_dictr   r  r   rr   r   )
r/   r9   rV   ri   r   r   ry   rr   r  r   s
             r0   r>   z,FlaxViTForImageClassificationModule.__call__Y  s     &1%<k$++B]B](('/!5#  
  
q!Qw!78Y,FM+!//))
 	
r2   )NTNNNr{   rE   r2   r0   r  r  K  s?    {{E399"
 "!
 
r2   r  z
    ViT Model transformer with an image classification head on top (a linear layer on top of the final hidden state of
    the [CLS] token) e.g. for ImageNet.
    c                       e Zd ZeZy)FlaxViTForImageClassificationN)r@   rA   rB   r  r   rE   r2   r0   r  r  y  s	     7Lr2   r  ag  
    Returns:

    Example:

    ```python
    >>> from transformers import AutoImageProcessor, FlaxViTForImageClassification
    >>> from PIL import Image
    >>> import jax
    >>> import requests

    >>> url = "http://images.cocodataset.org/val2017/000000039769.jpg"
    >>> image = Image.open(requests.get(url, stream=True).raw)

    >>> image_processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224")
    >>> model = FlaxViTForImageClassification.from_pretrained("google/vit-base-patch16-224")

    >>> inputs = image_processor(images=image, return_tensors="np")
    >>> outputs = model(**inputs)
    >>> logits = outputs.logits

    >>> # model predicts one of the 1000 ImageNet classes
    >>> predicted_class_idx = jax.numpy.argmax(logits, axis=-1)
    >>> print("Predicted class:", model.config.id2label[predicted_class_idx.item()])
    ```
)r  r
  r   )6typingr   
flax.linenlinenr'   r*   	jax.numpynumpyr7   flax.core.frozen_dictr   r   r   flax.linen.attentionr   flax.traverse_utilr   r	   modeling_flax_outputsr   r   r   modeling_flax_utilsr   r   r   r   utilsr   r   configuration_vitr   VIT_START_DOCSTRINGr   r   r   rG   r]   r~   r   r   r   r   r   r   r   r   r   r
  FLAX_VISION_MODEL_DOCSTRINGr  r  FLAX_VISION_CLASSIF_DOCSTRING__all__rE   r2   r0   <module>r&     s      
  > > > ; v v  Q (! F "CRYY C@		 BD299 DN		 (ryy *")) (BII *!299 !H(
RYY (
V
RYY 
01BII 1(K
0 K
\+
BII +
\ c!) !	! , 'B C  ;Yhq r+
")) +
\  7$: 77! 6 68U V  !/KZc
 Vr2   