+
    &jk                         ^ RI t ^ 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.tR t. ROt. ROt. ROt. ROt]].t]].tRR lt]P(                  P*                  R	 4       t ! R
 R]4      tR# )    NTensor)constraints)Distribution)broadcast_alllazy_propertyVonMisesc                     \        V4      pVP                  4       pV'       d    VP                  4       W,          ,           pK'  V# N)listpop)ycoefresults   && u/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/distributions/von_mises.py
_eval_polyr      s0    :DXXZF
aj(M    c                   V^ 8w  d   V^8w  d   \        RV 24      hV R,          pW",          p\        V\        V,          4      pV^8X  d   V P                  4       V,          pVP	                  4       pRV ,          pV RV P	                  4       ,          ,
          \        V\
        V,          4      P	                  4       ,           p\        P                  ! V R8  W44      pV# )zL
Returns ``log(I_order(x))`` for ``x > 0``,
where `order` is either 0 or 1.
zorder must be 0 or 1, got g      @      ?)AssertionErrorr   _COEF_SMALLabslog_COEF_LARGEtorchwhere)xorderr   smalllarger   s   &&    r   _log_modified_bessel_fnr!   D   s    
 zeqj9%ABB 	
DA	Aq+e,-Ez%IIKE 	qAaeeg
1k%.@ A E E GGE[[T50FMr   c                    \         P                  ! VP                  \         P                  V P                  R 7      pVP                  4       '       EgS   \         P                  ! RVP                  ,           V P                  V P                  R 7      pVP                  4       w  rgp\         P                  ! \        P                  V,          4      p	^W),          ,           W),           ,          p
WV
,
          ,          pV^V,
          ,          V,
          ^ 8  W,          P                  4       ^,           V,
          ^ 8  ,          pVP                  4       '       g   EK  \         P                  ! WR,
          P                  4       V
P!                  4       ,          V4      pWL,          pEKi  V\        P                  ,           V ,           ^\        P                  ,          ,          \        P                  ,
          # )dtypedevicer   )   )r   zerosshapeboolr%   allrandr$   unbindcosmathpir   anyr   signacos)locconcentration
proposal_rr   doneuu1u2u3zfcaccepts   &&&&         r   _rejection_sampler?   \   s%   ;;qwwejjDDhhjjJJtagg~SYYszzJXXZ
IIdggl#JN3!^,A;#q(af\\^a-?!-Cq-HI::<<F#XOO$5$@!DA=DK#!dgg+.88r   c                     a a ] tR t^nt oRtR]P                  R]P                  /t]P                  t	Rt
RV3R lV 3R llltR 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       ]P&                  ! 4       3R l4       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RtVtV ;t# )r	   a(  
A circular von Mises distribution.

This implementation uses polar coordinates. The ``loc`` and ``value`` args
can be any real number (to facilitate unconstrained optimization), but are
interpreted as angles modulo 2 pi.

Example::
    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> m = VonMises(torch.tensor([1.0]), torch.tensor([1.0]))
    >>> m.sample()  # von Mises distributed with loc=1 and concentration=1
    tensor([1.9777])

:param torch.Tensor loc: an angle in radians.
:param torch.Tensor concentration: concentration parameter
r3   r4   Fc                >   < V ^8  d   QhRS[ RS[ RS[R,          RR/# )   r3   r4   validate_argsNreturn)r   r)   )format__classdict__s   "r   __annotate__VonMises.__annotate__   s=     	B 	B	B 	B d{		B
 
	Br   c                   < \        W4      w  V n        V n        V P                  P                  p\        P
                  ! 4       p\        SV `  WEV4       R # r   )r   r3   r4   r(   r   Sizesuper__init__)selfr3   r4   rC   batch_shapeevent_shape	__class__s   &&&&  r   rL   VonMises.__init__   s@     (5S'H$$$hhnnjjl=Ar   c                V   V P                   '       d   V P                  V4       V P                  \        P                  ! WP
                  ,
          4      ,          pV\        P                  ! ^\        P                  ,          4      ,
          \        V P                  ^ R7      ,
          pV# )rB   r   )
_validate_args_validate_sampler4   r   r-   r3   r.   r   r/   r!   )rM   valuelog_probs   && r   rW   VonMises.log_prob   sz    !!%(%%		%((2B(CChhq477{#$%d&8&8BC 	
 r   c                    < V ^8  d   QhRS[ /# rB   rD   r   )rE   rF   s   "r   rG   rH      s     ) )f )r   c                T    V P                   P                  \        P                  4      # r   )r3   tor   doublerM   s   &r   _locVonMises._loc   s    xx{{5<<((r   c                    < V ^8  d   QhRS[ /# rZ   r   )rE   rF   s   "r   rG   rH      s     3 3 3r   c                T    V P                   P                  \        P                  4      # r   )r4   r\   r   r]   r^   s   &r   _concentrationVonMises._concentration   s    !!$$U\\22r   c                    < V ^8  d   QhRS[ /# rZ   r   )rE   rF   s   "r   rG   rH      s     J JV Jr   c                Z   V P                   p^^^V^,          ,          ,           P                  4       ,           pV^V,          P                  4       ,
          ^V,          ,          p^V^,          ,           ^V,          ,          p^V,          V,           p\        P                  ! VR8  WT4      # )   gh㈵>)rc   sqrtr   r   )rM   kappataurho_proposal_r_proposal_r_taylors   &     r   rl   VonMises._proposal_r   s    ##1q5!8|#))++a#g^^%%!e)436za#g.Y.{{54<);IIr   c                B   V P                  V4      p\        P                  ! W P                  P                  V P
                  P                  R7      p\        V P                  V P                  V P                  V4      P                  V P
                  P                  4      # )a  
The sampling algorithm for the von Mises distribution is based on the
following paper: D.J. Best and N.I. Fisher, "Efficient simulation of the
von Mises distribution." Applied Statistics (1979): 152-157.

Sampling is always done in double precision internally to avoid a hang
in _rejection_sample() for small values of the concentration, which
starts to happen for single precision around 1e-4 (see issue #88443).
r#   )_extended_shaper   emptyr_   r$   r3   r%   r?   rc   rl   r\   )rM   sample_shaper(   r   s   &&  r   sampleVonMises.sample   sl     $$\2KKYY__TXX__M IIt**D,<,<a

"TXX^^
	r   c                  <  \         SV `  V4      #   \         dh    T P                  P	                  R 4      pT P
                  P                  T4      pT P                  P                  T4      p\        T 4      ! YETR7      u # i ; i)rT   )rC   )rK   expandNotImplementedError__dict__getr3   r4   type)rM   rN   	_instancerC   r3   r4   rP   s   &&&   r   rv   VonMises.expand   sw    	O7>+.." 	O MM--.>?M((//+.C ..55kBM:cNN		Os    A/BBc                    < V ^8  d   QhRS[ /# rZ   r   )rE   rF   s   "r   rG   rH      s      f r   c                    V P                   # )z(
The provided mean is the circular one.
r3   r^   s   &r   meanVonMises.mean   s    
 xxr   c                    < V ^8  d   QhRS[ /# rZ   r   )rE   rF   s   "r   rG   rH      s      f r   c                    V P                   # r   r   r^   s   &r   modeVonMises.mode   s    xxr   c                    < V ^8  d   QhRS[ /# rZ   r   )rE   rF   s   "r   rG   rH      s     

 

& 

r   c                    ^\        V P                  ^R7      \        V P                  ^ R7      ,
          P                  4       ,
          # )z,
The provided variance is the circular one.
rS   )r!   r4   expr^   s   &r   varianceVonMises.variance   s>     '(:(:!D)$*<*<AFGce		
r   )r4   r3   r   )__name__
__module____qualname____firstlineno____doc__r   realpositivearg_constraintssupporthas_rsamplerL   rW   r   r_   rc   rl   r   no_gradrJ   rs   rv   propertyr   r   r   __static_attributes____classdictcell____classcell__)rP   rF   s   @@r   r	   r	   n   s     $ k..AUAUVOGK	B 	B	 ) ) 3 3 J J ]]_"'**,   O     

 

 

r   )g      ?g$@g03@g,?N?g2t?gIx?gtHZr?)	 e3E?g-5?gՒ+Hub?gJNYgTPÂ?g'gZ?gUL+ߐg;^p?)r   gY?g(z?g*O?gZ9?g.h?gӰ٩=5?)	r   g.kg?VmgtZOZ?g<Q g'8`?gP⥝gqJ:N?g;PJ4q)r   )r.   r   	torch.jitr   torch.distributionsr    torch.distributions.distributionr   torch.distributions.utilsr   r   __all__r   _I0_COEF_SMALL_I0_COEF_LARGE_I1_COEF_SMALL_I1_COEF_LARGEr   r   r!   jitscript_if_tracingr?   r	    r   r   <module>r      s        + 9 B ,

 ~.~.0 9 9"o
| o
r   