+
    ˜°³jÆ^  ã                   óv   € ^ RI t ^ RI Ht ^ RIHtHt ^ RIHt ^RIH	t	 RR.t
 ! R R]	4      t ! R	 R]	4      tR# )
é    N©ÚTensor)Ú
functionalÚinit)Ú	Parameter)ÚModuleÚ	EmbeddingÚEmbeddingBagc                   ó¶   a a€ ] tR t^t oRt. ROtRV3R lV 3R llltV3R lR ltV3R lR ltV3R lR	 lt	V3R
 lR lt
]RR l4       tV3R ltRtVtV ;t# )r	   as  A simple lookup table that stores embeddings of a fixed dictionary and size.

This module is often used to store word embeddings and retrieve them using indices.
The input to the module is a list of indices, and the output is the corresponding
word embeddings.

Args:
    num_embeddings (int): size of the dictionary of embeddings
    embedding_dim (int): the size of each embedding vector
    padding_idx (int, optional): If specified, the entries at :attr:`padding_idx` do not contribute to the gradient;
                                 therefore, the embedding vector at :attr:`padding_idx` is not updated during training,
                                 i.e. it remains as a fixed "pad". For a newly constructed Embedding,
                                 the embedding vector at :attr:`padding_idx` will default to all zeros,
                                 but can be updated to another value to be used as the padding vector.
    max_norm (float, optional): If given, each embedding vector with norm larger than :attr:`max_norm`
                                is renormalized to have norm :attr:`max_norm`.
    norm_type (float, optional): The p of the p-norm to compute for the :attr:`max_norm` option. Default ``2``.
    scale_grad_by_freq (bool, optional): If given, this will scale gradients by the inverse of frequency of
                                            the words in the mini-batch. Default ``False``.
    sparse (bool, optional): If ``True``, gradient w.r.t. :attr:`weight` matrix will be a sparse tensor.
                             See Notes for more details regarding sparse gradients.

Attributes:
    weight (Tensor): the learnable weights of the module of shape (num_embeddings, embedding_dim)
                     initialized from :math:`\mathcal{N}(0, 1)`

Shape:
    - Input: :math:`(*)`, IntTensor or LongTensor of arbitrary shape containing the indices to extract
    - Output: :math:`(*, H)`, where `*` is the input shape and :math:`H=\text{embedding\_dim}`

.. note::
    Keep in mind that only a limited number of optimizers support
    sparse gradients: currently it's :class:`optim.SGD` (`CUDA` and `CPU`),
    :class:`optim.SparseAdam` (`CUDA` and `CPU`) and :class:`optim.Adagrad` (`CPU`)

.. note::
    When :attr:`max_norm` is not ``None``, :class:`Embedding`'s forward method will modify the
    :attr:`weight` tensor in-place. Since tensors needed for gradient computations cannot be
    modified in-place, performing a differentiable operation on ``Embedding.weight`` before
    calling :class:`Embedding`'s forward method requires cloning ``Embedding.weight`` when
    :attr:`max_norm` is not ``None``. For example::

        n, d, m = 3, 5, 7
        embedding = nn.Embedding(n, d, max_norm=1.0)
        W = torch.randn((m, d), requires_grad=True)
        idx = torch.tensor([1, 2])
        a = (
            embedding.weight.clone() @ W.t()
        )  # weight must be cloned for this to be differentiable
        b = embedding(idx) @ W.t()  # modifies weight in-place
        out = a.unsqueeze(0) + b.unsqueeze(1)
        loss = out.sigmoid().prod()
        loss.backward()

Examples::

    >>> # an Embedding module containing 10 tensors of size 3
    >>> embedding = nn.Embedding(10, 3)
    >>> # a batch of 2 samples of 4 indices each
    >>> input = torch.LongTensor([[1, 2, 4, 5], [4, 3, 2, 9]])
    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> embedding(input)
    tensor([[[-0.0251, -1.6902,  0.7172],
             [-0.6431,  0.0748,  0.6969],
             [ 1.4970,  1.3448, -0.9685],
             [-0.3677, -2.7265, -0.1685]],

            [[ 1.4970,  1.3448, -0.9685],
             [ 0.4362, -0.4004,  0.9400],
             [-0.6431,  0.0748,  0.6969],
             [ 0.9124, -2.3616,  1.1151]]])


    >>> # example with padding_idx
    >>> embedding = nn.Embedding(10, 3, padding_idx=0)
    >>> input = torch.LongTensor([[0, 2, 0, 5]])
    >>> embedding(input)
    tensor([[[ 0.0000,  0.0000,  0.0000],
             [ 0.1535, -2.0309,  0.9315],
             [ 0.0000,  0.0000,  0.0000],
             [-0.1655,  0.9897,  0.0635]]])

    >>> # example of changing `pad` vector
    >>> padding_idx = 0
    >>> embedding = nn.Embedding(3, 3, padding_idx=padding_idx)
    >>> embedding.weight
    Parameter containing:
    tensor([[ 0.0000,  0.0000,  0.0000],
            [-0.7895, -0.7089, -0.0364],
            [ 0.6778,  0.5803,  0.2678]], requires_grad=True)
    >>> with torch.no_grad():
    ...     embedding.weight[padding_idx] = torch.ones(3)
    >>> embedding.weight
    Parameter containing:
    tensor([[ 1.0000,  1.0000,  1.0000],
            [-0.7895, -0.7089, -0.0364],
            [ 0.6778,  0.5803,  0.2678]], requires_grad=True)
c                ó~   <€ V ^8„  d   QhRS[ RS[ RS[ R,          RS[R,          RS[RS[RS[R	S[R,          R
S[RR/
# )é   Únum_embeddingsÚembedding_dimÚpadding_idxNÚmax_normÚ	norm_typeÚscale_grad_by_freqÚsparseÚ_weightÚ_freezeÚreturn©ÚintÚfloatÚboolr   )ÚformatÚ__classdict__s   "€ÚX/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/nn/modules/sparse.pyÚ__annotate__ÚEmbedding.__annotate__†   s{   ø€ ÷ +ñ +áð+ñ ð+ñ ˜4•Zð	+ñ
 ˜$•,ð+ñ ð+ñ !ð+ñ ð+ñ ˜$•ð+ñ ð+ð 
ñ+ó    c                ó:  <€ R V
RV/p\         SV `  4        Wn        W n        VeZ   V^ 8”  d   W0P                  8¼  d   \	        R4      hM6V^ 8  d0   W0P                  ) 8  d   \	        R4      hV P                  V,           pW0n        W@n        WPn        W`n        Vf?   \        \        P                  ! W33/ VB V	'       * R7      V n        V P                  4        M<\        VP                  4      W.8w  d   \	        R4      h\        W‰'       * R7      V n        Wpn        R# )ÚdeviceÚdtypeNz)Padding_idx must be within num_embeddings)Úrequires_gradú?Shape of weight does not match num_embeddings and embedding_dim)ÚsuperÚ__init__r   r   ÚAssertionErrorr   r   r   r   r   ÚtorchÚemptyÚweightÚreset_parametersÚlistÚshaper   )Úselfr   r   r   r   r   r   r   r   r   r#   r$   Úfactory_kwargsÚ	__class__s   &&&&&&&&&&&& €r   r(   ÚEmbedding.__init__†   s  ø€ ð # F¨G°UÐ;ˆÜ‰ÑÔØ,ÔØ*ÔØÒ"Ø˜QŒØ×"5Ñ"5Ô5Ü(Ð)TÓUÐUð 6à˜q”Ø×"5Ñ"5Ð!5Ô5Ü(Ð)TÓUÐUØ"×1Ñ1°KÕ?�Ø&ÔØ ŒØ"ŒØ"4ÔØŠ?Ü#Ü—’˜^Ð;ÑN¸~ÑNØ")œkôˆDŒKð ×!Ñ!Õ#ä�G—M‘MÓ" ~Ð&EÔEÜ$ØUóð ô $ G¼;ÔGˆDŒKàŽr!   c                ó   <€ V ^8„  d   QhRR/# ©r   r   N© )r   r   s   "€r   r   r    ³   ó   ø€ ÷ +ñ + $ñ +r!   c                óf   € \         P                  ! V P                  4       V P                  4        R # ©N©r   Únormal_r,   Ú_fill_padding_idx_with_zero©r0   s   &r   r-   ÚEmbedding.reset_parameters³   ó   € Ü�Š�T—[‘[Ô!Ø×(Ñ(Ö*r!   c                ó   <€ V ^8„  d   QhRR/# r5   r6   )r   r   s   "€r   r   r    ·   ó   ø€ ÷ 7ñ 7¨Tñ 7r!   c                óò   € V P                   eU   \        P                  ! 4       ;_uu_ 4        V P                  V P                   ,          P	                  ^ 4       R R R 4       R # R #   + '       g   i     R # ; ir9   ©r   r*   Úno_gradr,   Úfill_r=   s   &r   r<   Ú%Embedding._fill_padding_idx_with_zero·   óJ   € Ø×ÑÒ'Ü—’—•Ø—‘˜D×,Ñ,Õ-×3Ñ3°AÔ6÷ !‘ñ (ß —�úó   ¬-A%Á%A6	c                ó&   <€ V ^8„  d   QhRS[ RS[ /# )r   Úinputr   r   )r   r   s   "€r   r   r    ¼   s   ø€ ÷ 	
ñ 	
™Vð 	
©ñ 	
r!   c           	     ó²   € \         P                  ! VV P                  V P                  V P                  V P
                  V P                  V P                  4      # r9   )ÚFÚ	embeddingr,   r   r   r   r   r   )r0   rJ   s   &&r   ÚforwardÚEmbedding.forward¼   sD   € Ü�{Š{ØØ�K‰KØ×ÑØ�M‰MØ�N‰NØ×#Ñ#Ø�K‰Kó
ð 	
r!   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r   ©Ústr)r   r   s   "€r   r   r    Ç   s   ø€ ÷ )ñ )™Cñ )r!   c                ó2  € R pV P                   e
   VR,          pV P                  e
   VR,          pV P                  ^8w  d
   VR,          pV P                  RJd
   VR,          pV P                  RJd
   VR,          pVP
                  ! R/ V P                  B # )ú!{num_embeddings}, {embedding_dim}ú, padding_idx={padding_idx}ú, max_norm={max_norm}ú, norm_type={norm_type}Fú), scale_grad_by_freq={scale_grad_by_freq}z, sparse=Truer6   )r   r   r   r   r   r   Ú__dict__)r0   Úss   & r   Ú
extra_reprÚEmbedding.extra_reprÇ   s�   € Ø/ˆØ×ÑÒ'ØÐ.Õ.ˆAØ�=‰=Ò$ØÐ(Õ(ˆAØ�>‰>˜QÔØÐ*Õ*ˆAØ×"Ñ"¨%Ó/ØÐ<Õ<ˆAØ�;‰;˜eÓ#Ø�Õ ˆAØ�xŠxÑ(˜$Ÿ-™-Ñ(Ð(r!   c                ó„   € VP                  4       ^8w  d   \        R4      hVP                  w  r‰V ! VV	VVVVVVVR7	      p
V
# )a®  Create Embedding instance from given 2-dimensional FloatTensor.

Args:
    embeddings (Tensor): FloatTensor containing weights for the Embedding.
        First dimension is being passed to Embedding as ``num_embeddings``, second as ``embedding_dim``.
    freeze (bool, optional): If ``True``, the tensor does not get updated in the learning process.
        Equivalent to ``embedding.weight.requires_grad = False``. Default: ``True``
    padding_idx (int, optional): If specified, the entries at :attr:`padding_idx` do not contribute to the gradient;
                                 therefore, the embedding vector at :attr:`padding_idx` is not updated during training,
                                 i.e. it remains as a fixed "pad".
    max_norm (float, optional): See module initialization documentation.
    norm_type (float, optional): See module initialization documentation. Default ``2``.
    scale_grad_by_freq (bool, optional): See module initialization documentation. Default ``False``.
    sparse (bool, optional): See module initialization documentation.

Examples::

    >>> # FloatTensor containing pretrained weights
    >>> weight = torch.FloatTensor([[1, 2.3, 3], [4, 5.1, 6.3]])
    >>> embedding = nn.Embedding.from_pretrained(weight)
    >>> # Get embeddings for index 1
    >>> input = torch.LongTensor([1])
    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> embedding(input)
    tensor([[ 4.0000,  5.1000,  6.3000]])
ú4Embeddings parameter is expected to be 2-dimensional)	r   r   r   r   r   r   r   r   r   )Údimr)   r/   )ÚclsÚ
embeddingsÚfreezer   r   r   r   r   ÚrowsÚcolsrM   s   &&&&&&&&   r   Úfrom_pretrainedÚEmbedding.from_pretrainedÕ   sZ   € ðJ �>‰>Ó˜qÔ Ü Ð!WÓXÐXØ×%Ñ%‰
ˆÙØØØØØ#ØØØ1Øô

ˆ	ð Ðr!   c                ó¢   <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[ R,          ;R&   S[R,          ;R&   S[;R&   S[;R&   S[;R&   S[;R	&   S[;R
&   # )r   r   r   Nr   r   r   r   r,   rc   r   r   )r   r   s   "€r   r   r       s‘   ø‡ ‚ ñ\ Ññ] ñ^ Ññ_ ñ` �t•Ñña ñb �d�lÑñc ñd Ññe ñf Ññg ñh �Nñi ñj �Lñk ñl �Lòm r!   )r   r   r   r   r   r   r   r,   )r   r   r   r   r   r   r   )	NNç       @FFNFNN)TNNri   FF©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__constants__r(   r-   r<   rN   r\   Úclassmethodrf   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r2   r   s   @@r   r	   r	      sb   ù‡ € ñaòF€M÷(+õ +÷Z+ð +÷7ð 7÷
	
ð 	
÷)ð )ð ó2ó ð2÷Q … r!   c                   óÆ   a a€ ] tR tRt oRt. ROtRV3R lV 3R llltV3R lR ltV3R lR ltRV3R	 lR
 llt	V3R lR lt
]RV3R lR ll4       tV3R ltRtVtV ;t# )r
   i  a  Compute sums or means of 'bags' of embeddings, without instantiating the intermediate embeddings.

For bags of constant length, no :attr:`per_sample_weights`, no indices equal to :attr:`padding_idx`,
and with 2D inputs, this class

    * with ``mode="sum"`` is equivalent to :class:`~torch.nn.Embedding` followed by ``torch.sum(dim=1)``,
    * with ``mode="mean"`` is equivalent to :class:`~torch.nn.Embedding` followed by ``torch.mean(dim=1)``,
    * with ``mode="max"`` is equivalent to :class:`~torch.nn.Embedding` followed by ``torch.max(dim=1)``.

However, :class:`~torch.nn.EmbeddingBag` is much more time and memory efficient than using a chain of these
operations.

EmbeddingBag also supports per-sample weights as an argument to the forward
pass. This scales the output of the Embedding before performing a weighted
reduction as specified by ``mode``. If :attr:`per_sample_weights` is passed, the
only supported ``mode`` is ``"sum"``, which computes a weighted sum according to
:attr:`per_sample_weights`.

Args:
    num_embeddings (int): size of the dictionary of embeddings
    embedding_dim (int): the size of each embedding vector
    max_norm (float, optional): If given, each embedding vector with norm larger than :attr:`max_norm`
                                is renormalized to have norm :attr:`max_norm`.
    norm_type (float, optional): The p of the p-norm to compute for the :attr:`max_norm` option. Default ``2``.
    scale_grad_by_freq (bool, optional): if given, this will scale gradients by the inverse of frequency of
                                            the words in the mini-batch. Default ``False``.
                                            Note: this option is not supported when ``mode="max"``.
    mode (str, optional): ``"sum"``, ``"mean"`` or ``"max"``. Specifies the way to reduce the bag.
                             ``"sum"`` computes the weighted sum, taking :attr:`per_sample_weights`
                             into consideration. ``"mean"`` computes the average of the values
                             in the bag, ``"max"`` computes the max value over each bag.
                             Default: ``"mean"``
    sparse (bool, optional): if ``True``, gradient w.r.t. :attr:`weight` matrix will be a sparse tensor. See
                             Notes for more details regarding sparse gradients. Note: this option is not
                             supported when ``mode="max"``.
    include_last_offset (bool, optional): if ``True``, the size of offsets is equal to the number of bags + 1.
                                          The last element is the size of the input, or the ending index position
                                          of the last bag (sequence). This matches the CSR format. Ignored when
                                          input is 2D. Default ``False``.
    padding_idx (int, optional): If specified, the entries at :attr:`padding_idx` do not contribute to the
                                 gradient; therefore, the embedding vector at :attr:`padding_idx` is not updated
                                 during training, i.e. it remains as a fixed "pad". For a newly constructed
                                 EmbeddingBag, the embedding vector at :attr:`padding_idx` will default to all
                                 zeros, but can be updated to another value to be used as the padding vector.
                                 Note that the embedding vector at :attr:`padding_idx` is excluded from the
                                 reduction.

Attributes:
    weight (Tensor): the learnable weights of the module of shape `(num_embeddings, embedding_dim)`
                     initialized from :math:`\mathcal{N}(0, 1)`.

Examples::

    >>> # an EmbeddingBag module containing 10 tensors of size 3
    >>> embedding_sum = nn.EmbeddingBag(10, 3, mode='sum')
    >>> # a batch of 2 samples of 4 indices each
    >>> input = torch.tensor([1, 2, 4, 5, 4, 3, 2, 9], dtype=torch.long)
    >>> offsets = torch.tensor([0, 4], dtype=torch.long)
    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> embedding_sum(input, offsets)
    tensor([[-0.8861, -5.4350, -0.0523],
            [ 1.1306, -2.5798, -1.0044]])

    >>> # Example with padding_idx
    >>> embedding_sum = nn.EmbeddingBag(10, 3, mode='sum', padding_idx=2)
    >>> input = torch.tensor([2, 2, 2, 2, 4, 3, 2, 9], dtype=torch.long)
    >>> offsets = torch.tensor([0, 4], dtype=torch.long)
    >>> embedding_sum(input, offsets)
    tensor([[ 0.0000,  0.0000,  0.0000],
            [-0.7082,  3.2145, -2.6251]])

    >>> # An EmbeddingBag can be loaded from an Embedding like so
    >>> embedding = nn.Embedding(10, 3, padding_idx=2)
    >>> embedding_sum = nn.EmbeddingBag.from_pretrained(
            embedding.weight,
            padding_idx=embedding.padding_idx,
            mode='sum')
c                ó„   <€ V ^8„  d   QhRS[ RS[ RS[R,          RS[RS[RS[RS[R	S[R,          R
S[RS[ R,          RR/# )r   r   r   r   Nr   r   Úmoder   r   Úinclude_last_offsetr   r   )r   r   r   rS   r   )r   r   s   "€r   r   ÚEmbeddingBag.__annotate__r  s…   ø€ ÷ ,7ñ ,7áð,7ñ ð,7ñ ˜$•,ð	,7ñ
 ð,7ñ !ð,7ñ ð,7ñ ð,7ñ ˜$•ð,7ñ "ð,7ñ ˜4•Zð,7ð 
ñ,7r!   c                ó8  <€ R VRV/p\         SV `  4        Wn        W n        W0n        W@n        WPn        V
eZ   V
^ 8”  d   W P                  8¼  d   \        R4      hM6V
^ 8  d0   W P                  ) 8  d   \        R4      hV P                  V
,           p
W n        Vf8   \        \        P                  ! W33/ VB 4      V n        V P                  4        M6\        VP                  4      W.8w  d   \        R4      h\        V4      V n        W`n        Wpn        W�n        R# )r#   r$   Nz)padding_idx must be within num_embeddingsr&   )r'   r(   r   r   r   r   r   r)   r   r   r*   r+   r,   r-   r.   r/   ry   r   rz   )r0   r   r   r   r   r   ry   r   r   rz   r   r#   r$   r1   r2   s   &&&&&&&&&&&&& €r   r(   ÚEmbeddingBag.__init__r  s  ø€ ð # F¨G°UÐ;ˆÜ‰ÑÔØ,ÔØ*ÔØ ŒØ"ŒØ"4ÔØÒ"Ø˜QŒØ×"5Ñ"5Ô5Ü(Ð)TÓUÐUð 6à˜q”Ø×"5Ñ"5Ð!5Ô5Ü(Ð)TÓUÐUØ"×1Ñ1°KÕ?�Ø&ÔØŠ?Ü#Ü—’˜^Ð;ÑN¸~ÑNóˆDŒKð ×!Ñ!Õ#ä�G—M‘MÓ" ~Ð&EÔEÜ$ØUóð ô $ GÓ,ˆDŒKØŒ	ØŒØ#6Ö r!   c                ó   <€ V ^8„  d   QhRR/# r5   r6   )r   r   s   "€r   r   r{      r7   r!   c                óf   € \         P                  ! V P                  4       V P                  4        R # r9   r:   r=   s   &r   r-   ÚEmbeddingBag.reset_parameters   r?   r!   c                ó   <€ V ^8„  d   QhRR/# r5   r6   )r   r   s   "€r   r   r{   ¤  rA   r!   c                óò   € V P                   eU   \        P                  ! 4       ;_uu_ 4        V P                  V P                   ,          P	                  ^ 4       R R R 4       R # R #   + '       g   i     R # ; ir9   rC   r=   s   &r   r<   Ú(EmbeddingBag._fill_padding_idx_with_zero¤  rG   rH   c                óN   <€ V ^8„  d   QhRS[ RS[ R,          RS[ R,          RS[ /# )r   rJ   ÚoffsetsNÚper_sample_weightsr   r   )r   r   s   "€r   r   r{   ©  s;   ø€ ÷ 0
ñ 0
áð0
ñ ˜$•ð0
ñ # T�Mð	0
ñ
 
ñ0
r!   c                óâ   € \         P                  ! VV P                  VV P                  V P                  V P
                  V P                  V P                  VV P                  V P                  4      # )a+  Forward pass of EmbeddingBag.

Args:
    input (Tensor): Tensor containing bags of indices into the embedding matrix.
    offsets (Tensor, optional): Only used when :attr:`input` is 1D. :attr:`offsets` determines
        the starting index position of each bag (sequence) in :attr:`input`.
    per_sample_weights (Tensor, optional): a tensor of float / double weights, or None
        to indicate all weights should be taken to be ``1``. If specified, :attr:`per_sample_weights`
        must have exactly the same shape as input and is treated as having the same
        :attr:`offsets`, if those are not ``None``. Only supported for ``mode='sum'``.

Returns:
    Tensor output shape of `(B, embedding_dim)`.

.. note::

    A few notes about ``input`` and ``offsets``:

    - :attr:`input` and :attr:`offsets` have to be of the same type, either int or long

    - If :attr:`input` is 2D of shape `(B, N)`, it will be treated as ``B`` bags (sequences)
      each of fixed length ``N``, and this will return ``B`` values aggregated in a way
      depending on the :attr:`mode`. :attr:`offsets` is ignored and required to be ``None`` in this case.

    - If :attr:`input` is 1D of shape `(N)`, it will be treated as a concatenation of
      multiple bags (sequences).  :attr:`offsets` is required to be a 1D tensor containing the
      starting index positions of each bag in :attr:`input`. Therefore, for :attr:`offsets` of shape `(B)`,
      :attr:`input` will be viewed as having ``B`` bags. Empty bags (i.e., having 0-length) will have
      returned vectors filled by zeros.
)
rL   Úembedding_bagr,   r   r   r   ry   r   rz   r   )r0   rJ   r…   r†   s   &&&&r   rN   ÚEmbeddingBag.forward©  s]   € ôH �ŠØØ�K‰KØØ�M‰MØ�N‰NØ×#Ñ#Ø�I‰IØ�K‰KØØ×$Ñ$Ø×Ñó
ð 	
r!   c                ó    <€ V ^8„  d   QhRS[ /# rQ   rR   )r   r   s   "€r   r   r{   Û  s   ø€ ÷ Jñ J™Cñ Jr!   c                óv  € R pV P                   e
   VR,          pV P                  ^8w  d
   VR,          pV P                  RJd
   VR,          pVR,          pV P                  e
   VR,          pVP                  ! R/ V P
                  P                  4        UUu/ uF  w  r#V\        V4      bK  	  uppB # u uppi )rU   rW   rX   FrY   z, mode={mode}rV   r6   )r   r   r   r   r   rZ   ÚitemsÚrepr)r0   r[   ÚkÚvs   &   r   r\   ÚEmbeddingBag.extra_reprÛ  sª   € Ø/ˆØ�=‰=Ò$ØÐ(Õ(ˆAØ�>‰>˜QÔØÐ*Õ*ˆAØ×"Ñ"¨%Ó/ØÐ<Õ<ˆAØ	ˆ_ÕˆØ×ÑÒ'ØÐ.Õ.ˆAØ�xŠxÑI°$·-±-×2EÑ2EÔ2GÔHÑ2G©$¨!˜1œd 1›gš:Ñ2GÒHÑIÐIùÓHs   ÂB5c                óp   <€ V ^8„  d   QhRS[ RS[RS[R,          RS[RS[RS[RS[R	S[R
S[R,          RR/
# )r   rb   rc   r   Nr   r   ry   r   rz   r   r   r
   )r   r   r   rS   r   )r   r   s   "€r   r   r{   é  sw   ø€ ÷ 6ñ 6áð6ñ ð6ñ ˜$•,ð	6ñ
 ð6ñ !ð6ñ ð6ñ ð6ñ "ð6ñ ˜4•Zð6ð 
ñ6r!   c
                ó²   € VP                  4       ^8w  d   \        R4      hVP                  w  r«V ! V
VVVVVVVVV	R7
      pV'       * VP                  n        V# )aÕ  Create EmbeddingBag instance from given 2-dimensional FloatTensor.

Args:
    embeddings (Tensor): FloatTensor containing weights for the EmbeddingBag.
        First dimension is being passed to EmbeddingBag as 'num_embeddings', second as 'embedding_dim'.
    freeze (bool, optional): If ``True``, the tensor does not get updated in the learning process.
        Equivalent to ``embeddingbag.weight.requires_grad = False``. Default: ``True``
    max_norm (float, optional): See module initialization documentation. Default: ``None``
    norm_type (float, optional): See module initialization documentation. Default ``2``.
    scale_grad_by_freq (bool, optional): See module initialization documentation. Default ``False``.
    mode (str, optional): See module initialization documentation. Default: ``"mean"``
    sparse (bool, optional): See module initialization documentation. Default: ``False``.
    include_last_offset (bool, optional): See module initialization documentation. Default: ``False``.
    padding_idx (int, optional): See module initialization documentation. Default: ``None``.

Examples::

    >>> # FloatTensor containing pretrained weights
    >>> weight = torch.FloatTensor([[1, 2.3, 3], [4, 5.1, 6.3]])
    >>> embeddingbag = nn.EmbeddingBag.from_pretrained(weight)
    >>> # Get embeddings for index 1
    >>> input = torch.LongTensor([[1, 0]])
    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> embeddingbag(input)
    tensor([[ 2.5000,  3.7000,  4.6500]])
r_   )
r   r   r   r   r   r   ry   r   rz   r   )r`   r)   r/   r,   r%   )ra   rb   rc   r   r   r   ry   r   rz   r   rd   re   Úembeddingbags   &&&&&&&&&&   r   rf   ÚEmbeddingBag.from_pretrainedè  sm   € ðN �>‰>Ó˜qÔ Ü Ð!WÓXÐXØ×%Ñ%‰
ˆÙØØØØØØ1ØØØ 3Ø#ô
ˆð 17¬Jˆ×ÑÔ)ØÐr!   c                ó®   <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[R,          ;R&   S[;R&   S[;R&   S[;R&   S[;R&   S[;R	&   S[;R
&   S[ R,          ;R&   # )r   r   r   Nr   r   r   r,   ry   r   rz   r   )r   r   r   r   rS   )r   r   s   "€r   r   r{     s    ø‡ ‚ ñx Ññy ñz Ññ{ ñ| �d�lÑñ} ñ~ Ññ ñ@ ÑñA ñB �NñC ñD �IñE ñF �LñG ñH ÑñI ñJ �t•ÑòK r!   )
r   rz   r   ry   r   r   r   r   r   r,   )	r   r   r   r   r   ry   r   rz   r   )
Nri   FÚmeanFNFNNN)NN)TNri   Fr–   FFNrj   rv   s   @@r   r
   r
     sj   ù‡ € ñMò^
€M÷.,7õ ,7÷\+ð +÷7ð 7÷
0
ò 0
÷dJð Jð ÷6ñ 6ó ð6÷} … r!   )r*   r   Útorch.nnr   rL   r   Útorch.nn.parameterr   Úmoduler   Ú__all__r	   r
   r6   r!   r   Ú<module>r›      s?   ðó Ý ß *Ý (å ð ˜Ð
'€ôz�ô zôzT�6ö Tr!   