+
    ˜°³jÂ1  ã                   ó@  € ^ RI t ^ RIHtHtHtHt ^ RIHtHt ^ RI	t	. ROt
]! R
RR7      t ! R R]],          4      t ! R R]],          4      t ! R R]],          4      t ! R R]],          4      t ! R R	]],          4      t ! R R]]],          ,          4      tR# )é    N)ÚIterableÚIteratorÚSequenceÚSized)ÚGenericÚTypeVarÚBatchSamplerÚRandomSamplerÚSamplerÚSequentialSamplerÚSubsetRandomSamplerÚWeightedRandomSamplerÚ_T_coT)Ú	covariantc                   ó6   a € ] tR t^t o RtV 3R lR ltRtV tR# )r   a  Base class for all Samplers.

Every Sampler subclass has to provide an :meth:`__iter__` method, providing a
way to iterate over indices or lists of indices (batches) of dataset elements,
and may provide a :meth:`__len__` method that returns the length of the returned iterators.

Example:
    >>> # xdoctest: +SKIP
    >>> class AccedingSequenceLengthSampler(Sampler[int]):
    >>>     def __init__(self, data: List[str]) -> None:
    >>>         self.data = data
    >>>
    >>>     def __len__(self) -> int:
    >>>         return len(self.data)
    >>>
    >>>     def __iter__(self) -> Iterator[int]:
    >>>         sizes = torch.tensor([len(x) for x in self.data])
    >>>         yield from torch.argsort(sizes).tolist()
    >>>
    >>> class AccedingSequenceLengthBatchSampler(Sampler[List[int]]):
    >>>     def __init__(self, data: List[str], batch_size: int) -> None:
    >>>         self.data = data
    >>>         self.batch_size = batch_size
    >>>
    >>>     def __len__(self) -> int:
    >>>         return (len(self.data) + self.batch_size - 1) // self.batch_size
    >>>
    >>>     def __iter__(self) -> Iterator[List[int]]:
    >>>         sizes = torch.tensor([len(x) for x in self.data])
    >>>         for batch in torch.chunk(torch.argsort(sizes), len(self)):
    >>>             yield batch.tolist()

.. note:: The :meth:`__len__` method isn't strictly required by
          :class:`~torch.utils.data.DataLoader`, but is expected in any
          calculation involving the length of a :class:`~torch.utils.data.DataLoader`.
c                ó0   <€ V ^8„  d   QhRS[ S[,          /# ©é   Úreturn)r   r   )ÚformatÚ__classdict__s   "€ÚY/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/utils/data/sampler.pyÚ__annotate__ÚSampler.__annotate__B   s   ø€ ÷ "ñ "™(¡5�/ñ "ó    c                ó   € \         h©N)ÚNotImplementedError©Úselfs   &r   Ú__iter__ÚSampler.__iter__B   s   € Ü!Ð!r   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r!   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r      s   ø‡ € ñ#÷J"ö "r   c                   óf   a € ] tR t^at o R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tR	t	V t
R
# )r   z�Samples elements sequentially, always in the same order.

Args:
    data_source (Sized): data source to sample from. Must implement __len__.
c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Údata_sourcer   N©r   )r   r   s   "€r   r   ÚSequentialSampler.__annotate__j   s   ø€ ÷ 'ñ '¡Eð '¨dñ 'r   c                ó   € Wn         R # r   ©r.   )r    r.   s   &&r   Ú__init__ÚSequentialSampler.__init__j   s   € Ø&Ör   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# r   ©r   Úint)r   r   s   "€r   r   r0   m   s   ø€ ÷ 2ñ 2™(¡3�-ñ 2r   c                óP   € \        \        \        V P                  4      4      4      # r   )ÚiterÚrangeÚlenr.   r   s   &r   r!   ÚSequentialSampler.__iter__m   s   € Ü”Eœ#˜d×.Ñ.Ó/Ó0Ó1Ð1r   c                ó    <€ V ^8„  d   QhRS[ /# r   ©r7   )r   r   s   "€r   r   r0   p   s   ø€ ÷ %ñ %™ñ %r   c                ó,   € \        V P                  4      # r   )r;   r.   r   s   &r   Ú__len__ÚSequentialSampler.__len__p   s   € Ü�4×#Ñ#Ó$Ð$r   c                ó&   <€ V ^8„  d   Qh/ S[ ;R&   # )r   r.   r/   )r   r   s   "€r   r   r0   a   s   ø‡ ‚ ñ Ñò r   r2   N©r$   r%   r&   r'   r(   r3   r!   r@   Ú__annotate_func__r)   r*   r+   s   @r   r   r   a   s/   ø‡ € ñ÷'ð '÷2ð 2÷%ð %÷ ƒ r   c                   ó†   a € ] tR t^tt o RtRV 3R lR llt]V 3R lR l4       tV 3R lR ltV 3R	 lR
 lt	V 3R lt
RtV tR# )r
   aÚ  Samples elements randomly. If without replacement, then sample from a shuffled dataset.

If with replacement, then user can specify :attr:`num_samples` to draw.

Args:
    data_source (Sized): data source to sample from. Must implement __len__.
    replacement (bool): samples are drawn on-demand with replacement if ``True``, default=``False``
    num_samples (int): number of samples to draw, default=`len(dataset)`.
    generator (Generator): Generator used in sampling.
Nc                ó>   <€ V ^8„  d   QhRS[ RS[RS[R,          RR/# )r   r.   ÚreplacementÚnum_samplesNr   )r   Úboolr7   )r   r   s   "€r   r   ÚRandomSampler.__annotate__ƒ   s7   ø€ ÷ ñ áðñ ðñ ˜4•Zð	ð 
ñr   c                ó8  € Wn         W n        W0n        W@n        \	        V P                  \
        4      '       g   \        R V P                   24      h\	        V P                  \        4      '       d   V P                  ^ 8:  d   \        RV P                   24      hR# )ú;replacement should be a boolean value, but got replacement=úDnum_samples should be a positive integer value, but got num_samples=N)
r.   rG   Ú_num_samplesÚ	generatorÚ
isinstancerI   Ú	TypeErrorrH   r7   Ú
ValueError)r    r.   rG   rH   rO   s   &&&&&r   r3   ÚRandomSampler.__init__ƒ   s“   € ð 'ÔØ&ÔØ'ÔØ"Œä˜$×*Ñ*¬D×1Ò1ÜØMÈd×N^ÑN^ÐM_Ð`óð ô ˜$×*Ñ*¬C×0Ò0°D×4DÑ4DÈÔ4IÜØVÐW[×WgÑWgÐVhÐióð ñ 5Jr   c                ó    <€ V ^8„  d   QhRS[ /# r   r>   )r   r   s   "€r   r   rJ   š   s   ø€ ÷ !ñ !™Sñ !r   c                ó`   € V P                   f   \        V P                  4      # V P                   # r   )rN   r;   r.   r   s   &r   rH   ÚRandomSampler.num_samples™   s-   € ð ×ÑÒ$Ü�t×'Ñ'Ó(Ð(Ø× Ñ Ð r   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# r   r6   )r   r   s   "€r   r   rJ       s   ø€ ÷ ñ ™(¡3�-ñ r   c              #  ó  "  € \        V P                  4      pV P                  fs   \        \        P
                  ! R\        P                  R7      P                  4       P                  4       4      p\        P                  ! 4       pVP                  V4       MV P                  pV P                  '       d´   \        V P                  ^ ,          4       FA  p\        P                  ! VR\        P                  VR7      P                  4        R j  x€L
  KC  	  \        P                  ! VV P                  ^ ,          3\        P                  VR7      P                  4        R j  x€L
  R # \        V P                  V,          4       F0  p\        P                   ! WR7      P                  4        R j  x€L
  K2  	  \        P                   ! WR7      P                  4       R V P                  V,            R j  x€L
  R #  Lí L› LO L5i)N©Údtype)ÚhighÚsizerZ   rO   ©rO   r#   )é    )r;   r.   rO   r7   ÚtorchÚemptyÚint64Úrandom_ÚitemÚ	GeneratorÚmanual_seedrG   r:   rH   ÚrandintÚtolistÚrandperm)r    ÚnÚseedrO   Ú_s   &    r   r!   ÚRandomSampler.__iter__    s|  é € Ü�× Ñ Ó!ˆØ�>‰>Ò!Ü”u—{’{ 2¬U¯[©[Ô9×AÑAÓC×HÑHÓJÓKˆDÜŸšÓ)ˆIØ×!Ñ! $Õ'àŸ™ˆIà××ÐÜ˜4×+Ñ+¨rÕ1Ö2�Ü Ÿ=š=Ø ¬e¯k©kÀYôç‘&“(÷ò ñ 3ô —}’}ØØ×&Ñ&¨Õ+Ð-Ü—k‘kØ#ô	÷
 ‰f‹h÷ò ô ˜4×+Ñ+¨qÕ0Ö1�Ü Ÿ>š>¨!ÔA×HÑHÓJ×JÒJñ 2ä—~’~ aÔ=×DÑDÓFØ&�$×"Ñ" QÕ&ð÷ ò ñññ KñùsR   ‚B3HÂ6AHÄG<ÄAHÅ"G>Å#AHÆ0H Æ1AHÇ5HÇ6HÇ>HÈ HÈHc                ó    <€ V ^8„  d   QhRS[ /# r   r>   )r   r   s   "€r   r   rJ   »   ó   ø€ ÷  ñ  ™ñ  r   c                ó   € V P                   # r   ©rH   r   s   &r   r@   ÚRandomSampler.__len__»   ó   € Ø×ÑÐr   c                ó2   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   # )r   r.   rG   )r   rI   )r   r   s   "€r   r   rJ   t   s   ø‡ ‚ ñ Ññ ñ Ñò r   )rN   r.   rO   rG   )FNN)r$   r%   r&   r'   r(   r3   ÚpropertyrH   r!   r@   rD   r)   r*   r+   s   @r   r
   r
   t   sD   ø‡ € ñ	÷ò ð, ÷!ó ð!÷ð ÷6 ð  ÷O ƒ r   c                   ój   a € ] tR t^¿t o RtRV 3R lR lltV 3R lR ltV 3R lR ltV 3R	 ltR
t	V t
R# )r   z¹Samples elements randomly from a given list of indices, without replacement.

Args:
    indices (sequence): a sequence of indices
    generator (Generator): Generator used in sampling.
Nc                ó4   <€ V ^8„  d   QhRS[ S[,          RR/# )r   Úindicesr   N©r   r7   )r   r   s   "€r   r   Ú SubsetRandomSampler.__annotate__É   s   ø€ ÷ #ñ #¡©¥ð #À$ñ #r   c                ó   € Wn         W n        R # r   )rw   rO   )r    rw   rO   s   &&&r   r3   ÚSubsetRandomSampler.__init__É   s   € ØŒØ"Žr   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# r   r6   )r   r   s   "€r   r   ry   Í   s   ø€ ÷ "ñ "™(¡3�-ñ "r   c              #  óÌ   "  € \         P                  ! \        V P                  4      V P                  R 7      P                  4        F  pV P                  V,          x € K  	  R# 5i©r]   N)r_   rh   r;   rw   rO   rg   )r    Úis   & r   r!   ÚSubsetRandomSampler.__iter__Í   s?   é € Ü—’¤ D§L¡LÓ 1¸T¿^¹^ÔL×SÑSÖUˆAØ—,‘,˜q•/Ô!ó Vùs   ‚A"A$c                ó    <€ V ^8„  d   QhRS[ /# r   r>   )r   r   s   "€r   r   ry   Ñ   s   ø€ ÷ !ñ !™ñ !r   c                ó,   € \        V P                  4      # r   )r;   rw   r   s   &r   r@   ÚSubsetRandomSampler.__len__Ñ   s   € Ü�4—<‘<Ó Ð r   c                ó6   <€ V ^8„  d   Qh/ S[ S[,          ;R&   # )r   rw   rx   )r   r   s   "€r   r   ry   ¿   s   ø‡ ‚ ñ ‘c�]Ñò r   )rO   rw   r   rC   r+   s   @r   r   r   ¿   s/   ø‡ € ñ÷#ò #÷"ð "÷!ð !÷% ƒ r   c                   ój   a € ] tR t^Õt o RtRV 3R lR lltV 3R lR ltV 3R lR ltV 3R	 ltR
t	V t
R# )r   a~  Samples elements from ``[0,..,len(weights)-1]`` with given probabilities (weights).

Args:
    weights (sequence)   : a sequence of weights, not necessary summing up to one
    num_samples (int): number of samples to draw
    replacement (bool): if ``True``, samples are drawn with replacement.
        If not, they are drawn without replacement, which means that when a
        sample index is drawn for a row, it cannot be drawn again for that row.
    generator (Generator): Generator used in sampling.

Example:
    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> list(
    ...     WeightedRandomSampler(
    ...         [0.1, 0.9, 0.4, 0.7, 3.0, 0.6], 5, replacement=True
    ...     )
    ... )
    [4, 4, 1, 4, 5]
    >>> list(
    ...     WeightedRandomSampler(
    ...         [0.9, 0.4, 0.05, 0.2, 0.3, 0.1], 5, replacement=False
    ...     )
    ... )
    [0, 1, 4, 3, 2]
Nc                ó@   <€ V ^8„  d   QhRS[ S[,          RS[RS[RR/# )r   ÚweightsrH   rG   r   N)r   Úfloatr7   rI   )r   r   s   "€r   r   Ú"WeightedRandomSampler.__annotate__ô   s7   ø€ ÷ #ñ #á™%•ð#ñ ð#ñ ð	#ð 
ñ#r   c                óÂ  € \        V\        4      '       d   \        V\        4      '       g   V^ 8:  d   \        RV 24      h\        V\        4      '       g   \        RV 24      h\        P
                  ! V\        P                  R7      p\        VP                  4      ^8w  d"   \        R\        VP                  4       24      hWPn
        W n        W0n        W@n        R# )r   rM   rL   rY   z=weights should be a 1d sequence but given weights have shape N)rP   r7   rI   rR   r_   Ú	as_tensorÚdoubler;   ÚshapeÚtupler‡   rH   rG   rO   )r    r‡   rH   rG   rO   Úweights_tensors   &&&&& r   r3   ÚWeightedRandomSampler.__init__ô   sÏ   € ô ˜;¬×,Ò,Ü˜+¤t×,Ò,Ø˜aÔäØVÐWbÐVcÐdóð ô ˜+¤t×,Ò,ÜØMÈkÈ]Ð[óð ô Ÿš¨¼¿¹ÔEˆÜˆ~×#Ñ#Ó$¨Ô)Üð&Ü&+¨N×,@Ñ,@Ó&AÐ%BðDóð ð
 &ŒØ&ÔØ&ÔØ"Žr   c                ó0   <€ V ^8„  d   QhRS[ S[,          /# r   r6   )r   r   s   "€r   r   r‰     s   ø€ ÷ .ñ .™(¡3�-ñ .r   c              #  óØ   "  € \         P                  ! V P                  V P                  V P                  V P
                  R 7      p\        VP                  4       4       Rj  x€L
  R#  L5ir~   )r_   Úmultinomialr‡   rH   rG   rO   r9   rg   )r    Úrand_tensors   & r   r!   ÚWeightedRandomSampler.__iter__  sK   é € Ü×'Ò'Ø�L‰L˜$×*Ñ*¨D×,<Ñ,<ÈÏÉô
ˆô ˜×*Ñ*Ó,Ó-×-Ô-ùs   ‚AA*Á!A(Á"A*c                ó    <€ V ^8„  d   QhRS[ /# r   r>   )r   r   s   "€r   r   r‰     rn   r   c                ó   € V P                   # r   rp   r   s   &r   r@   ÚWeightedRandomSampler.__len__  rr   r   c                óR   <€ V ^8„  d   Qh/ S[ P                  ;R&   S[;R&   S[;R&   # )r   r‡   rH   rG   )r_   ÚTensorr7   rI   )r   r   s   "€r   r   r‰   Õ   s0   ø‡ ‚ ñ6 �\‰\Ññ7 ñ8 Ññ9 ñ: Ñò; r   )rO   rH   rG   r‡   )TNrC   r+   s   @r   r   r   Õ   s1   ø‡ € ñ÷<#ò #÷@.ð .÷ ð  ÷K ƒ r   c                   óZ   a € ] tR tRt o RtV 3R lR ltV 3R lR ltV 3R lR ltR	tV t	R
# )r	   i  a‡  Wraps another sampler to yield a mini-batch of indices.

Args:
    sampler (Sampler or Iterable): Base sampler. Can be any iterable object
    batch_size (int): Size of mini-batch.
    drop_last (bool): If ``True``, the sampler will drop the last batch if
        its size would be less than ``batch_size``

Example:
    >>> list(
    ...     BatchSampler(
    ...         SequentialSampler(range(10)), batch_size=3, drop_last=False
    ...     )
    ... )
    [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]
    >>> list(
    ...     BatchSampler(SequentialSampler(range(10)), batch_size=3, drop_last=True)
    ... )
    [[0, 1, 2], [3, 4, 5], [6, 7, 8]]
c                ó`   <€ V ^8„  d   QhRS[ S[,          S[S[,          ,          RS[RS[RR/# )r   ÚsamplerÚ
batch_sizeÚ	drop_lastr   N)r   r7   r   rI   )r   r   s   "€r   r   ÚBatchSampler.__annotate__4  s@   ø€ ÷ #ñ #á™•¡©¥Õ-ð#ñ ð#ñ ð	#ð
 
ñ#r   c                óô   € \        V\        4      '       d   \        V\        4      '       g   V^ 8:  d   \        RV 24      h\        V\        4      '       g   \        RV 24      hWn        W n        W0n        R# )r   zBbatch_size should be a positive integer value, but got batch_size=z7drop_last should be a boolean value, but got drop_last=N)rP   r7   rI   rR   r�   rž   rŸ   )r    r�   rž   rŸ   s   &&&&r   r3   ÚBatchSampler.__init__4  su   € ô ˜:¤s×+Ò+Ü˜*¤d×+Ò+Ø˜QŒäØTÐU_ÐT`Ðaóð ô ˜)¤T×*Ò*ÜØIÈ)ÈÐUóð ð ŒØ$ŒØ"Žr   c                ó@   <€ V ^8„  d   QhRS[ S[S[,          ,          /# r   )r   Úlistr7   )r   r   s   "€r   r   r    M  s    ø€ ÷ Kñ K™(¡4©¥9Õ-ñ Kr   c              #  ó\  "  € \        V P                  4      pV P                  '       d/   V.V P                  ,          p\	        VR R/  F	  p. VOx € K  	  R# . \
        P                  ! WP                  4      OpV'       d)   Vx € . \
        P                  ! WP                  4      OpK0  R# 5i)ÚstrictFN)r9   r�   rŸ   rž   ÚzipÚ	itertoolsÚislice)r    Úsampler_iterÚargsÚbatch_droplastÚbatchs   &    r   r!   ÚBatchSampler.__iter__M  s�   é € Ü˜DŸL™LÓ)ˆØ�>�>ˆ>à �> D§O¡OÕ3ˆDÜ"% tÐ":°EÔ":�Ø'˜Ð'Ô'ó #;ð G”i×&Ò& |·_±_ÓEÐFˆEßØ’ØJœ)×*Ò*¨<¿¹ÓIÐJ’ñ ùs   ‚A?B,Â*B,c                ó    <€ V ^8„  d   QhRS[ /# r   r>   )r   r   s   "€r   r   r    Z  s   ø€ ÷ Pñ P™ñ Pr   c                óî   € V P                   '       d'   \        V P                  4      V P                  ,          # \        V P                  4      V P                  ,           ^,
          V P                  ,          # )é   )rŸ   r;   r�   rž   r   s   &r   r@   ÚBatchSampler.__len__Z  sK   € ð
 �>�>ˆ>Ü�t—|‘|Ó$¨¯©Õ7Ð7ä˜Ÿ™Ó%¨¯©Õ7¸!Õ;ÀÇÁÕOÐOr   )rž   rŸ   r�   N)
r$   r%   r&   r'   r(   r3   r!   r@   r)   r*   r+   s   @r   r	   r	     s,   ø‡ € ñ÷*#ð #÷2Kð K÷Pö Pr   )r	   r
   r   r   r   r   )r¨   Úcollections.abcr   r   r   r   Útypingr   r   r_   Ú__all__r   r   r7   r   r
   r   r   r¤   r	   r#   r   r   Ú<module>r¶      s™   ðã ß ?Ó ?ß #ã ò€ñ 	� 4Ô(€ô'"ˆg�e�nô '"ôJ%˜ �ô %ô&H �G˜C•Lô H ôV!˜' #�,ô !ô,F ˜G C�Lô F ôRDP�7˜4 �9Õ%ö DPr   