+
    NV-jt  ã                   óT   € ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	  ! R R]4      t
R# )é    N)ÚOptional)ÚModule)ÚQuantizedEmbeddingc                   ój   a a€ ] tR t^t oRtV3R lV 3R lltR tR tR tR
V3R lR llt	R	t
VtV ;t# )Ú	EmbeddingaZ  Implements a simple lookup table that maps each input integer to a
high-dimensional vector.

Typically used to embed discrete tokens for processing by neural networks.

Args:
    num_embeddings (int): How many possible discrete tokens can we embed.
       Usually called the vocabulary size.
    dims (int): The dimensionality of the embeddings.
c                ó&   <€ V ^8„  d   QhRS[ RS[ /# )é   Únum_embeddingsÚdims)Úint)ÚformatÚ__classdict__s   "€Úh/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/mlx/nn/layers/embedding.pyÚ__annotate__ÚEmbedding.__annotate__   s   ø€ ÷ Rñ R¡sð R±#ñ Ró    c                ó¬   <€ \         SV `  4        \        P                  ! ^V,          4      p\        P
                  P                  W3VR7      V n        R# )é   )ÚshapeÚscaleN)ÚsuperÚ__init__ÚmathÚsqrtÚmxÚrandomÚnormalÚweight)Úselfr
   r   r   Ú	__class__s   &&& €r   r   ÚEmbedding.__init__   s>   ø€ Ü‰ÑÔÜ—	’	˜!˜d�(Ó#ˆÜ—i‘i×&Ñ&¨nÐ-CÈ5Ð&ÓQˆŽr   c                ó|   € V P                   P                  ^ ,           RV P                   P                  ^,           2# )r   z, )r   r   )r   s   &r   Ú_extra_reprÚEmbedding._extra_repr   s3   € Ø—+‘+×#Ñ# AÕ&Ð' r¨$¯+©+×*;Ñ*;¸AÕ*>Ð)?Ð@Ð@r   c                ó(   € V P                   V,          # )N©r   ©r   Úxs   &&r   Ú__call__ÚEmbedding.__call__   s   € Ø�{‰{˜1�~Ðr   c                ó:   € WP                   P                  ,          # )z€
Call the embedding layer as a linear layer.

Use this for example when input embedding and output projection
weights are tied.
)r   ÚTr'   s   &&r   Ú	as_linearÚEmbedding.as_linear"   s   € ð —;‘;—=‘=Õ Ð r   c                óR   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          RS[RS[/# )r	   Ú
group_sizeÚbitsÚmodeÚquantize_input)r   r   ÚstrÚbool)r   r   s   "€r   r   r   +   sA   ø€ ÷ 
Oñ 
Oá™S•Mð
Oñ ‘s�mð
Oñ ð	
Oñ
 ñ
Or   c                óV   € V'       d   \        R4      h\        P                  ! WW#4      # )zPReturn a :obj:`QuantizedEmbedding` layer that approximates this embedding layer.z!Quantized input is not supported.)Ú
ValueErrorr   Úfrom_embedding)r   r0   r1   r2   r3   s   &&&&&r   Úto_quantizedÚEmbedding.to_quantized+   s&   € ÷ ÜÐ@ÓAÐAÜ!×0Ò0°À4ÓNÐNr   r&   )NNÚaffineF)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r#   r)   r-   r9   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r    r   s   @@r   r   r      s8   ù‡ € ñ	÷Ró Rò
Aòò!÷
O÷ 
Oò 
Or   r   )r   Útypingr   Úmlx.coreÚcorer   Úmlx.nn.layers.baser   Úmlx.nn.layers.quantizedr   r   © r   r   Ú<module>rJ      s$   ðó Ý å Ý %Ý 6ô*O�ö *Or   