+
    –°³j:,  ã                   ó„   € ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	 ^ RI
Ht R.tR tR	 tR
 t ! R R]4      tR# )é    N©ÚTensor)Úconstraints)ÚDistribution)Ú_standard_normalÚlazy_property)Ú_sizeÚMultivariateNormalc                ój   € \         P                  ! WP                  R4      4      P                  R4      # )aŸ  
Performs a batched matrix-vector product, with compatible but different batch shapes.

This function takes as input `bmat`, containing :math:`n \times n` matrices, and
`bvec`, containing length :math:`n` vectors.

Both `bmat` and `bvec` may have any number of leading dimensions, which correspond
to a batch shape. They are not necessarily assumed to have the same batch shape,
just ones which can be broadcasted.
éÿÿÿÿ)ÚtorchÚmatmulÚ	unsqueezeÚsqueeze)ÚbmatÚbvecs   &&Úh/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributions/multivariate_normal.pyÚ	_batch_mvr      s'   € ô �<Š<˜Ÿn™n¨RÓ0Ó1×9Ñ9¸"Ó=Ð=ó    c                ó”  € VP                  R4      pVP                  RR p\        V4      pV P                  4       ^,
          pWE,
          pWe,           pV^V,          ,           pVP                  RV p	\	        V P                  RR VP                  VR 4       F  w  r«W›V
,          V
3,          p	K  	  W’3,          p	VP                  V	4      p\        \        V4      4      \        \        Wh^4      4      ,           \        \        V^,           V^4      4      ,           V.,           pVP                  V4      pV P                  RW"4      pVP                  RVP                  ^ 4      V4      pVP                  ^^^ 4      p\        P                  P                  WßRR7      P                  ^4      P                  R4      pVP                  4       pVP                  VP                  RR 4      p\        \        V4      4      p\        V4       F  pVVV,           VV,           .,          pK  	  VP                  V4      pVP                  V4      # )a:  
Computes the squared Mahalanobis distance :math:`\mathbf{x}^\top\mathbf{M}^{-1}\mathbf{x}`
for a factored :math:`\mathbf{M} = \mathbf{L}\mathbf{L}^\top`.

Accepts batches for both bL and bx. They are not necessarily assumed to have the same batch
shape, but `bL` one should be able to be broadcasted to `bx` one.
NF©Úupperr   éþÿÿÿ)ÚsizeÚshapeÚlenÚdimÚzipÚreshapeÚlistÚrangeÚpermuter   ÚlinalgÚsolve_triangularÚpowÚsumÚt)ÚbLÚbxÚnÚbx_batch_shapeÚbx_batch_dimsÚbL_batch_dimsÚouter_batch_dimsÚold_batch_dimsÚnew_batch_dimsÚbx_new_shapeÚsLÚsxÚpermute_dimsÚflat_LÚflat_xÚflat_x_swapÚM_swapÚMÚ
permuted_MÚpermute_inv_dimsÚiÚ
reshaped_Ms   &&                    r   Ú_batch_mahalanobisr>      s  € ð 	�‰�‹€AØ—X‘X˜c˜r�]€Nô ˜Ó'€MØ—F‘F“H˜q•L€MØ$Õ4ÐØ%Õ5€NØ%¨¨MÕ(9Õ9€Nà—8‘8Ð-Ð-Ð.€LÜ�b—h‘h˜s �m R§X¡XÐ.>¸rÐ%BÖC‰ˆØ˜r� 2˜Õ&Šñ Dà�DÕ€LØ	�‰�LÓ	!€Bô 	ŒUÐ#Ó$Ó%Ü
ŒuÐ%°qÓ9Ó
:õ	;ä
ŒuÐ%¨Õ)¨>¸1Ó=Ó
>õ	?ð Ð
õ	ð ð 
�‰�LÓ	!€Bà�Z‰Z˜˜AÓ!€FØ�Z‰Z˜˜FŸK™K¨›N¨AÓ.€FØ—.‘.  A qÓ)€Kä�‰×%Ñ% fÀÐ%ÓG×KÑKÈAÓN×RÑRÐSUÓVð ð 	�‰‹
€Að —‘˜2Ÿ8™8 C R˜=Ó)€JÜœEÐ"2Ó3Ó4ÐÜ�=Ö!ˆØÐ-°Õ1°>ÀAÕ3EÐFÕFÒñ "à×#Ñ#Ð$4Ó5€JØ×Ñ˜nÓ-Ð-r   c                 ó†  € \         P                  P                  \         P                  ! V R4      4      p\         P                  ! \         P                  ! VR4      RR4      p\         P
                  ! V P                  R,          V P                  V P                  R7      p\         P                  P                  W#RR7      pV# )é   ©ÚdtypeÚdeviceFr   r   r   )r   r   )
r   r#   ÚcholeskyÚflipÚ	transposeÚeyer   rB   rC   r$   )ÚPÚLfÚL_invÚIdÚLs   &    r   Ú_precision_to_scale_trilrM   O   s~   € ä	�‰×	Ñ	œuŸzšz¨!¨XÓ6Ó	7€BÜ�OŠOœEŸJšJ r¨8Ó4°b¸"Ó=€EÜ	�Š�1—7‘7˜2•; a§g¡g°a·h±hÔ	?€BÜ�‰×%Ñ% e°uÐ%Ó=€AØ€Hr   c                   óÀ  a a€ ] tR t^Xt oRtR]P                  R]P                  R]P                  R]P                  /t	]P                  t
R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]V3R lR l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R tR tRtVtV ;t# )r
   a)  
Creates a multivariate normal (also called Gaussian) distribution
parameterized by a mean vector and a covariance matrix.

The multivariate normal distribution can be parameterized either
in terms of a positive definite covariance matrix :math:`\mathbf{\Sigma}`
or a positive definite precision matrix :math:`\mathbf{\Sigma}^{-1}`
or a lower-triangular matrix :math:`\mathbf{L}` with positive-valued
diagonal entries, such that
:math:`\mathbf{\Sigma} = \mathbf{L}\mathbf{L}^\top`. This triangular matrix
can be obtained via e.g. Cholesky decomposition of the covariance.

Example:

    >>> # xdoctest: +REQUIRES(env:TORCH_DOCTEST_LAPACK)
    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> m = MultivariateNormal(torch.zeros(2), torch.eye(2))
    >>> m.sample()  # normally distributed with mean=`[0,0]` and covariance_matrix=`I`
    tensor([-0.2102, -0.5429])

Args:
    loc (Tensor): mean of the distribution
    covariance_matrix (Tensor): positive-definite covariance matrix
    precision_matrix (Tensor): positive-definite precision matrix
    scale_tril (Tensor): lower-triangular factor of covariance, with positive-valued diagonal

Note:
    Only one of :attr:`covariance_matrix` or :attr:`precision_matrix` or
    :attr:`scale_tril` can be specified.

    Using :attr:`scale_tril` will be more efficient: all computations internally
    are based on :attr:`scale_tril`. If :attr:`covariance_matrix` or
    :attr:`precision_matrix` is passed instead, it is only used to compute
    the corresponding lower triangular matrices using a Cholesky decomposition.
ÚlocÚcovariance_matrixÚprecision_matrixÚ
scale_trilTc                ót   <€ V ^8„  d   QhRS[ RS[ R,          RS[ R,          RS[ R,          RS[R,          RR/# )r@   rO   rP   NrQ   rR   Úvalidate_argsÚreturn)r   Úbool)ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚMultivariateNormal.__annotate__‡   s_   ø€ ÷ =Xñ =Xáð=Xñ " D�=ð=Xñ ! 4�-ð	=Xñ
 ˜T•Mð=Xñ ˜d•{ð=Xð 
ñ=Xr   c                ót  <€ VP                  4       ^8  d   \        R4      hVRJVRJ,           VRJ,           ^8w  d   \        R4      hVep   VP                  4       ^8  d   \        R4      h\        P                  ! VP                  RR	 VP                  RR
 4      pVP                  VR,           4      V n        MðVep   VP                  4       ^8  d   \        R4      h\        P                  ! VP                  RR	 VP                  RR
 4      pVP                  VR,           4      V n        M}Vf   \        R4      hVP                  4       ^8  d   \        R4      h\        P                  ! VP                  RR	 VP                  RR
 4      pVP                  VR,           4      V n	        VP                  VR,           4      V n
        V P                  P                  R
R p\        SV `1  WgVR7       Ve	   W@n        R# Ve'   \        P                  P                  V4      V n        R# \!        V4      V n        R# )é   z%loc must be at least one-dimensional.NzTExactly one of covariance_matrix or precision_matrix or scale_tril may be specified.zZscale_tril matrix must be at least two-dimensional, with optional leading batch dimensionszZcovariance_matrix must be at least two-dimensional, with optional leading batch dimensionsz%precision_matrix is unexpectedly NonezYprecision_matrix must be at least two-dimensional, with optional leading batch dimensions©rT   r   r   )r   r   )r   )r   Ú
ValueErrorr   Úbroadcast_shapesr   ÚexpandrR   rP   ÚAssertionErrorrQ   rO   ÚsuperÚ__init__Ú_unbroadcasted_scale_trilr#   rD   rM   )	ÚselfrO   rP   rQ   rR   rT   Úbatch_shapeÚevent_shapeÚ	__class__s	   &&&&&&  €r   rc   ÚMultivariateNormal.__init__‡   s%  ø€ ð �7‰7‹9�qŒ=ÜÐDÓEÐEØ TÐ)¨jÀÐ.DÕEØ DÐ(õ
àôô Øfóð ð Ò!Ø�~‰~Ó !Ô#Ü ð=óð ô  ×0Ò0°×1AÑ1AÀ#À2Ð1FÈÏ	É	ÐRUÐSUÈÓWˆKà(×/Ñ/°¸hÕ0FÓGˆD�OØÒ*Ø ×$Ñ$Ó&¨Ô*Ü ð=óð ô  ×0Ò0Ø!×'Ñ'¨¨Ð,¨c¯i©i¸¸¨nóˆKð &7×%=Ñ%=¸kÈHÕ>TÓ%UˆDÕ"àÒ'Ü$Ð%LÓMÐMØ×#Ñ#Ó%¨Ô)Ü ð=óð ô  ×0Ò0Ø ×&Ñ& s¨Ð+¨S¯Y©Y°s¸¨^óˆKð %5×$;Ñ$;¸KÈ(Õ<RÓ$SˆDÔ!Ø—:‘:˜k¨EÕ1Ó2ˆŒà—h‘h—n‘n R SÐ)ˆä‰Ñ˜ÀÐÔOàÒ!Ø-7Ö*ØÒ*Ü-2¯\©\×-BÑ-BÐCTÓ-UˆDÖ*ä-EÐFVÓ-WˆDÖ*r   c                ó²  <€ V P                  \        V4      p\        P                  ! V4      pWP                  ,           pWP                  ,           V P                  ,           pV P
                  P                  V4      Vn        V P                  Vn        R V P                  9   d!   V P                  P                  V4      Vn	        RV P                  9   d!   V P                  P                  V4      Vn
        RV P                  9   d!   V P                  P                  V4      Vn        \        \        V`7  WP                  RR7       V P                  Vn        V# )rP   rR   rQ   Fr]   )Ú_get_checked_instancer
   r   ÚSizerg   rO   r`   rd   Ú__dict__rP   rR   rQ   rb   rc   Ú_validate_args)re   rf   Ú	_instanceÚnewÚ	loc_shapeÚ	cov_shaperh   s   &&&   €r   r`   ÚMultivariateNormal.expandÆ   s  ø€ Ø×(Ñ(Ô);¸YÓGˆÜ—j’j Ó-ˆØ×"2Ñ"2Õ2ˆ	Ø×"2Ñ"2Õ2°T×5EÑ5EÕEˆ	Ø—(‘(—/‘/ )Ó,ˆŒØ(,×(FÑ(FˆÔ%Ø $§-¡-Ô/Ø$(×$:Ñ$:×$AÑ$AÀ)Ó$LˆCÔ!Ø˜4Ÿ=™=Ô(Ø!Ÿ_™_×3Ñ3°IÓ>ˆCŒNØ §¡Ô.Ø#'×#8Ñ#8×#?Ñ#?À	Ó#JˆCÔ ÜÔ  #Ñ/Ø×)Ñ)¸ð 	0ô 	
ð "×0Ñ0ˆÔØˆ
r   c                ó    <€ V ^8„  d   QhRS[ /# ©r@   rU   r   )rW   rX   s   "€r   rY   rZ   Ú   s   ø€ ÷ 
ñ 
™Fñ 
r   c                ó�   € V P                   P                  V P                  V P                  ,           V P                  ,           4      # ©N)rd   r`   Ú_batch_shapeÚ_event_shape©re   s   &r   rR   ÚMultivariateNormal.scale_trilÙ   s:   € à×-Ñ-×4Ñ4Ø×Ñ × 1Ñ 1Õ1°D×4EÑ4EÕEó
ð 	
r   c                ó    <€ V ^8„  d   QhRS[ /# ru   r   )rW   rX   s   "€r   rY   rZ   à   s   ø€ ÷ Lñ L¡6ñ Lr   c                óâ   € \         P                  ! V P                  V P                  P                  4      P	                  V P
                  V P                  ,           V P                  ,           4      # rw   )r   r   rd   ÚmTr`   rx   ry   rz   s   &r   rP   Ú$MultivariateNormal.covariance_matrixß   sQ   € ä�|Š|Ø×*Ñ*¨D×,JÑ,J×,MÑ,Mó
ç
‰&�×"Ñ" T×%6Ñ%6Õ6¸×9JÑ9JÕJÓ
Kð	Lr   c                ó    <€ V ^8„  d   QhRS[ /# ru   r   )rW   rX   s   "€r   rY   rZ   æ   s   ø€ ÷ 
ñ 
¡&ñ 
r   c                ó¸   € \         P                  ! V P                  4      P                  V P                  V P
                  ,           V P
                  ,           4      # rw   )r   Úcholesky_inverserd   r`   rx   ry   rz   s   &r   rQ   Ú#MultivariateNormal.precision_matrixå   sE   € ä×%Ò% d×&DÑ&DÓE×LÑLØ×Ñ × 1Ñ 1Õ1°D×4EÑ4EÕEó
ð 	
r   c                ó    <€ V ^8„  d   QhRS[ /# ru   r   )rW   rX   s   "€r   rY   rZ   ì   ó   ø€ ÷ ñ ‘fñ r   c                ó   € V P                   # rw   ©rO   rz   s   &r   ÚmeanÚMultivariateNormal.meanë   ó   € à�x‰xˆr   c                ó    <€ V ^8„  d   QhRS[ /# ru   r   )rW   rX   s   "€r   rY   rZ   ð   r…   r   c                ó   € V P                   # rw   r‡   rz   s   &r   ÚmodeÚMultivariateNormal.modeï   rŠ   r   c                ó    <€ V ^8„  d   QhRS[ /# ru   r   )rW   rX   s   "€r   rY   rZ   ô   s   ø€ ÷ 
ñ 
™&ñ 
r   c                óª   € V P                   P                  ^4      P                  R4      P                  V P                  V P
                  ,           4      # )r@   r   )rd   r%   r&   r`   rx   ry   rz   s   &r   ÚvarianceÚMultivariateNormal.varianceó   sA   € ð ×*Ñ*×.Ñ.¨qÓ1ß‰S�‹Wß‰V�D×%Ñ%¨×(9Ñ(9Õ9Ó:ð	
r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r@   Úsample_shaperU   )r	   r   )rW   rX   s   "€r   rY   rZ   û   s   ø€ ÷ Iñ I¡Eð I¹Vñ Ir   c                óÜ   € V P                  V4      p\        W P                  P                  V P                  P                  R 7      pV P                  \        V P                  V4      ,           # )rA   )Ú_extended_shaper   rO   rB   rC   r   rd   )re   r”   r   Úepss   &&  r   ÚrsampleÚMultivariateNormal.rsampleû   sJ   € Ø×$Ñ$ \Ó2ˆÜ˜u¯H©H¯N©NÀ4Ç8Á8Ç?Á?ÔSˆØ�x‰xœ) D×$BÑ$BÀCÓHÕHÐHr   c                ó¼  € V P                   '       d   V P                  V4       WP                  ,
          p\        V P                  V4      pV P                  P                  RRR7      P                  4       P                  R4      pRV P                  ^ ,          \        P                  ! ^\        P                  ,          4      ,          V,           ,          V,
          # )r@   ©Údim1Údim2r   r   g      à¿)rn   Ú_validate_samplerO   r>   rd   ÚdiagonalÚlogr&   ry   ÚmathÚpi)re   ÚvalueÚdiffr9   Úhalf_log_dets   &&   r   Úlog_probÚMultivariateNormal.log_prob   s¥   € Ø××ÐØ×!Ñ! %Ô(Ø—x‘xÕˆÜ˜t×=Ñ=¸tÓDˆà×*Ñ*×3Ñ3¸À"Ð3ÓE×IÑIÓK×OÑOÐPRÓSð 	ð �t×(Ñ(¨Õ+¬d¯hªh°q¼4¿7¹7µ{Ó.CÕCÀaÕGÕHÈ<ÕWÐWr   c                ó”  € V P                   P                  RRR7      P                  4       P                  R4      pRV P                  ^ ,          ,          R\
        P                  ! ^\
        P                  ,          4      ,           ,          V,           p\        V P                  4      ^ 8X  d   V# VP                  V P                  4      # )r@   r›   g      à?g      ð?r   r   )
rd   rŸ   r    r&   ry   r¡   r¢   r   rx   r`   )re   r¥   ÚHs   &  r   ÚentropyÚMultivariateNormal.entropy
  s™   € à×*Ñ*×3Ñ3¸À"Ð3ÓE×IÑIÓK×OÑOÐPRÓSð 	ð �$×#Ñ# AÕ&Õ&¨#´·²¸¼T¿W¹W½Ó0EÕ*EÕFÈÕUˆÜˆt× Ñ Ó! QÔ&ØˆHà—8‘8˜D×-Ñ-Ó.Ð.r   )rd   rP   rO   rQ   rR   )NNNNrw   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úreal_vectorÚpositive_definiteÚlower_choleskyÚarg_constraintsÚsupportÚhas_rsamplerc   r`   r   rR   rP   rQ   Úpropertyrˆ   r�   r‘   r   rl   r˜   r¦   rª   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)rh   rX   s   @@r   r
   r
   X   s  ù‡ € ñ"ðL 	ˆ{×&Ñ&Ø˜[×:Ñ:Ø˜K×9Ñ9Ø�k×0Ñ0ð	€Oð ×%Ñ%€GØ€K÷=Xõ =X÷~ð& ÷
ó ð
ð
 ÷Ló ðLð
 ÷
ó ð
ð
 ÷ó ðð ÷ó ðð ÷
ó ð
ð -2¯JªJ«L÷ Iò Iò
X÷/ò /r   )r¡   r   r   Útorch.distributionsr   Ú torch.distributions.distributionr   Útorch.distributions.utilsr   r   Útorch.typesr	   Ú__all__r   r>   rM   r
   © r   r   Ú<module>rÁ      sB   ðã ã Ý Ý +Ý 9ß EÝ ð  Ð
 €ò>ò/.òdôz/˜ö z/r   