+
    –°³j¼  ã                   óž   € ^ RI HtHt ^ RIt^ RIHtHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt R.t]! R	]	R
7      t ! R R]	]],          4      tR# )é    )ÚGenericÚTypeVarN)ÚSizeÚTensor)Úconstraints)ÚDistribution)Ú_sum_rightmost)Ú_sizeÚIndependentÚD)Úboundc                   óž  a a€ ] tR t^t oRt/ tRV3R lV 3R llltRV 3R llt]V3R lR l4       t	]V3R lR l4       t
]P                  R	 4       t]V3R
 lR l4       t]V3R lR l4       t]V3R lR l4       t]P$                  ! 4       3V3R lR llt]P$                  ! 4       3V3R lR lltR tR tRR ltR tV3R ltRtVtV ;t# )r   aI  
Reinterprets some of the batch dims of a distribution as event dims.

This is mainly useful for changing the shape of the result of
:meth:`log_prob`. For example to create a diagonal Normal distribution with
the same shape as a Multivariate Normal distribution (so they are
interchangeable), you can::

    >>> from torch.distributions.multivariate_normal import MultivariateNormal
    >>> from torch.distributions.normal import Normal
    >>> loc = torch.zeros(3)
    >>> scale = torch.ones(3)
    >>> mvn = MultivariateNormal(loc, scale_tril=torch.diag(scale))
    >>> [mvn.batch_shape, mvn.event_shape]
    [torch.Size([]), torch.Size([3])]
    >>> normal = Normal(loc, scale)
    >>> [normal.batch_shape, normal.event_shape]
    [torch.Size([3]), torch.Size([])]
    >>> diagn = Independent(normal, 1)
    >>> [diagn.batch_shape, diagn.event_shape]
    [torch.Size([]), torch.Size([3])]

Args:
    base_distribution (torch.distributions.distribution.Distribution): a
        base distribution
    reinterpreted_batch_ndims (int): the number of batch dims to
        reinterpret as event dims
c                ó>   <€ V ^8„  d   QhRS[ RS[RS[R,          RR/# )é   Úbase_distributionÚreinterpreted_batch_ndimsÚvalidate_argsNÚreturn)r   ÚintÚbool)ÚformatÚ__classdict__s   "€Ú`/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributions/independent.pyÚ__annotate__ÚIndependent.__annotate__3   s=   ø€ ÷ Pñ PáðPñ $'ðPñ ˜d•{ð	Pð
 
ñPó    c                ó„  <€ V\        VP                  4      8”  d%   \        R V R\        VP                  4       24      hVP                  VP                  ,           pV\        VP                  4      ,           pVR\        V4      V,
           pV\        V4      V,
          R pWn        W n        \        SV `  WgVR7       R# )zQExpected reinterpreted_batch_ndims <= len(base_distribution.batch_shape), actual z vs N©r   )ÚlenÚbatch_shapeÚ
ValueErrorÚevent_shapeÚ	base_distr   ÚsuperÚ__init__)	Úselfr   r   r   ÚshapeÚ	event_dimr    r"   Ú	__class__s	   &&&&    €r   r%   ÚIndependent.__init__3   sÂ   ø€ ð %¤sÐ+<×+HÑ+HÓ'IÔIÜðØ3Ð4°D¼Ð=N×=ZÑ=ZÓ9[Ð8\ð^óð ð (×3Ñ3Ð6G×6SÑ6SÕSˆØ2´SÐ9J×9VÑ9VÓ5WÕWˆ	ØÐ4œc %›j¨9Õ4Ð5ˆØœC ›J¨Õ2Ð4Ð5ˆØ*ŒØ)BÔ&ä‰Ñ˜ÀÐÖOr   c                ó\  <€ V P                  \        V4      p\        P                  ! V4      pV P                  P                  WP                  R V P                   ,           4      Vn        V P                  Vn        \        \        V`'  WP                  RR7       V P                  Vn
        V# )NFr   )Ú_get_checked_instancer   Útorchr   r#   Úexpandr"   r   r$   r%   Ú_validate_args)r&   r    Ú	_instanceÚnewr)   s   &&& €r   r.   ÚIndependent.expandG   s—   ø€ Ø×(Ñ(¬°iÓ@ˆÜ—j’j Ó-ˆØŸ™×-Ñ-Ø×*Ñ*Ð+K¨T×-KÑ-KÐLÕLó
ˆŒð )-×(FÑ(FˆÔ%ÜŒk˜3Ñ(Ø×)Ñ)¸ð 	)ô 	
ð "×0Ñ0ˆÔØˆ
r   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r   ©r   )r   r   s   "€r   r   r   U   s   ø€ ÷ *ñ *™Tñ *r   c                ó.   € V P                   P                  # ©N)r#   Úhas_rsample©r&   s   &r   r8   ÚIndependent.has_rsampleT   s   € à�~‰~×)Ñ)Ð)r   c                ó    <€ V ^8„  d   QhRS[ /# r4   r5   )r   r   s   "€r   r   r   Y   s   ø€ ÷ 4ñ 4¡tñ 4r   c                óT   € V P                   ^ 8”  d   R# V P                  P                  # )r   F)r   r#   Úhas_enumerate_supportr9   s   &r   r=   Ú!Independent.has_enumerate_supportX   s#   € à×)Ñ)¨AÔ-ÙØ�~‰~×3Ñ3Ð3r   c                ó–   € V P                   P                  pV P                  '       d!   \        P                  ! WP                  4      pV# r7   )r#   Úsupportr   r   Úindependent)r&   Úresults   & r   r@   ÚIndependent.support^   s:   € ð —‘×'Ñ'ˆØ×)×)Ð)Ü ×,Ò,¨V×5SÑ5SÓTˆFØˆr   c                ó    <€ V ^8„  d   QhRS[ /# r4   ©r   )r   r   s   "€r   r   r   g   ó   ø€ ÷ #ñ #‘fñ #r   c                ó.   € V P                   P                  # r7   )r#   Úmeanr9   s   &r   rH   ÚIndependent.meanf   ó   € à�~‰~×"Ñ"Ð"r   c                ó    <€ V ^8„  d   QhRS[ /# r4   rE   )r   r   s   "€r   r   r   k   rF   r   c                ó.   € V P                   P                  # r7   )r#   Úmoder9   s   &r   rM   ÚIndependent.modej   rJ   r   c                ó    <€ V ^8„  d   QhRS[ /# r4   rE   )r   r   s   "€r   r   r   o   s   ø€ ÷ 'ñ '™&ñ 'r   c                ó.   € V P                   P                  # r7   )r#   Úvariancer9   s   &r   rQ   ÚIndependent.variancen   s   € à�~‰~×&Ñ&Ð&r   c                ó    <€ V ^8„  d   QhRS[ /# r4   rE   )r   r   s   "€r   r   r   r   s   ø€ ÷ 3ñ 3±6ñ 3r   c                ó8   € V P                   P                  V4      # r7   )r#   Úsample©r&   Úsample_shapes   &&r   rU   ÚIndependent.sampler   s   € Ø�~‰~×$Ñ$ \Ó2Ð2r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r   rW   r   )r
   r   )r   r   s   "€r   r   r   u   s   ø€ ÷ 4ñ 4¡Eð 4¹Vñ 4r   c                ó8   € V P                   P                  V4      # r7   )r#   ÚrsamplerV   s   &&r   r[   ÚIndependent.rsampleu   s   € Ø�~‰~×%Ñ% lÓ3Ð3r   c                ób   € V P                   P                  V4      p\        W P                  4      # r7   )r#   Úlog_probr	   r   )r&   Úvaluer^   s   && r   r^   ÚIndependent.log_probx   s'   € Ø—>‘>×*Ñ*¨5Ó1ˆÜ˜h×(FÑ(FÓGÐGr   c                ó`   € V P                   P                  4       p\        WP                  4      # r7   )r#   Úentropyr	   r   )r&   rb   s   & r   rb   ÚIndependent.entropy|   s%   € Ø—.‘.×(Ñ(Ó*ˆÜ˜g×'EÑ'EÓFÐFr   c                ór   € V P                   ^ 8”  d   \        R4      hV P                  P                  VR7      # )r   z5Enumeration over cartesian product is not implemented)r.   )r   ÚNotImplementedErrorr#   Úenumerate_support)r&   r.   s   &&r   rf   ÚIndependent.enumerate_support€   s:   € Ø×)Ñ)¨AÔ-Ü%ØGóð ð �~‰~×/Ñ/°vÐ/Ó>Ð>r   c                ór   € V P                   P                  R V P                   RV P                   R2,           # )Ú(z, Ú))r)   Ú__name__r#   r   r9   s   &r   Ú__repr__ÚIndependent.__repr__‡   s8   € à�N‰N×#Ñ#Ø�$—.‘.Ð!  D×$BÑ$BÐ#CÀ1ÐEõFð	
r   c                ó\   <€ V ^8„  d   Qh/ S[ S[S[P                  3,          ;R&   S[;R&   # )r   Úarg_constraintsr#   )ÚdictÚstrr   Ú
Constraintr   )r   r   s   "€r   r   r      s.   ø‡ ‚ ñ< ™#™{×5Ñ5Ð5Õ6Ñ;ñ= ñ> �Lò? r   )r#   r   r7   )T)rk   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ro   r%   r.   Úpropertyr8   r=   r   Údependent_propertyr@   rH   rM   rQ   r-   r   rU   r[   r^   rb   rf   rl   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r)   r   s   @@r   r   r      sè   ù‡ € ñð: :<€O÷Põ P÷(ð ÷*ó ð*ð ÷4ó ð4ð
 ×#Ñ#ñó $ðð ÷#ó ð#ð ÷#ó ð#ð ÷'ó ð'ð #(§*¢*£,÷ 3ò 3ð -2¯JªJ«L÷ 4ò 4òHòGô?ò
÷k … r   )Útypingr   r   r-   r   r   Útorch.distributionsr   Ú torch.distributions.distributionr   Útorch.distributions.utilsr	   Útorch.typesr
   Ú__all__r   r   © r   r   Ú<module>r„      sE   ðç #ã ß Ý +Ý 9Ý 4Ý ð ˆ/€ñ ˆC�|Ô$€ôy
�, ¨¥
ö y
r   