+
    &j1                     l    ^ RI t ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 R.t ! R R4      tR# )	    N)
deprecatedTensor)constraints)lazy_property_sizeDistributionc                     a a ] tR t^t oRtRtRtRt]V3R lR l4       t	]
P                  ! 4       ]
P                  ! 4       R3V3R lV 3R llltR7V3R	 l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]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]R 7      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R( ltR8V3R) lR* lltV3R+ lR, lt V3R- lR. lt!]
P                  ! 4       3V3R/ lR0 llt"V3R1 lR2 lt#R7R3 lt$V3R4 lR5 lt%R6t&Vt'V ;t(# )9r
   a;  
Distribution is the abstract base class for probability distributions.

Args:
    batch_shape (torch.Size): The shape over which parameters are batched.
    event_shape (torch.Size): The shape of a single sample (without batching).
    validate_args (bool, optional): Whether to validate arguments. Default: None.
FTc                $   < V ^8  d   QhRS[ RR/#    valuereturnN)bool)format__classdict__s   "x/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/distributions/distribution.py__annotate__Distribution.__annotate__   s     , , ,$ ,    c                6    V R9  d   \         hV \        n        R# )a]  
Sets whether validation is enabled or disabled.

The default behavior mimics Python's ``assert`` statement: validation
is on by default, but is disabled if Python is run in optimized mode
(via ``python -O``). Validation may be expensive, so you may want to
disable it once a model is working.

Args:
    value (bool): Whether to enable validation.
N)TF)
ValueErrorr
   _validate_args)r   s   &r   set_default_validate_args&Distribution.set_default_validate_args   s     %&+#r   Nc                f   < V ^8  d   QhRS[ P                  RS[ P                  RS[R,          RR/# )r   batch_shapeevent_shapevalidate_argsNr   )torchSizer   )r   r   s   "r   r   r   .   s?     & &ZZ& ZZ& d{	&
 
&r   c                  < Wn         W n        Ve   W0n        V P                  '       Ed    V P                  pVP                  4        F  w  rV\        P                  ! V4      '       d   K#  WPP                  9  d,   \        \        \        V 4      V4      \        4      '       d   K^  \        W4      pVP!                  V4      p\"        P$                  ! V4      '       d   K  \'        RV R\        V4      P(                   R\+        VP,                  4       R\/        V 4       R	\/        V4       R
V 24      h	  \0        S	V `e  4        R #   \         d:    / p\
        P                  ! T P                   R2R,           R,           ^R7        ELRi ; i)Nz$ does not define `arg_constraints`. zAPlease set `arg_constraints = {}` or initialize the distribution z2with `validate_args=False` to turn off validation.
stacklevelzExpected parameter z (
 of shape z) of distribution z to satisfy the constraint , but found invalid values:
)_batch_shape_event_shaper   arg_constraintsNotImplementedErrorwarningswarn	__class__itemsr   is_dependent__dict__
isinstancegetattrtyper   checkr!   _is_all_truer   __name__tupleshapereprsuper__init__)
selfr   r   r    r*   param
constraintr   validr.   s
   &&&&     r   r<   Distribution.__init__.   s~    ('$"/	"&"6"6 &5%:%:%<!++J77-*DJ.3 3 ,"((/))%00$-eW 5 K001E%++<N;O P++/:, 7559*5E4F G66;W	>  &=" 	3 ' "$~~&&JKYZJK  !	 s   E A F
Fc                    < V ^8  d   QhRS[ /# )r   r   r   )r   r   s   "r   r   r   V   s     " "% "r   c                    \         h)a  
Returns a new distribution instance (or populates an existing instance
provided by a derived class) with batch dimensions expanded to
`batch_shape`. This method calls :class:`~torch.Tensor.expand` on
the distribution's parameters. As such, this does not allocate new
memory for the expanded distribution instance. Additionally,
this does not repeat any args checking or parameter broadcasting in
`__init__.py`, when an instance is first created.

Args:
    batch_shape (torch.Size): the desired expanded size.
    _instance: new instance provided by subclasses that
        need to override `.expand`.

Returns:
    New distribution instance with batch dimensions expanded to
    `batch_size`.
r+   )r=   r   	_instances   &&&r   expandDistribution.expandV   s
    & "!r   c                4   < V ^8  d   QhRS[ P                  /# r   r   r!   r"   )r   r   s   "r   r   r   l        ! !UZZ !r   c                    V P                   # )z6
Returns the shape over which parameters are batched.
)r(   r=   s   &r   r   Distribution.batch_shapek       
    r   c                4   < V ^8  d   QhRS[ P                  /# rI   rJ   )r   r   s   "r   r   r   s   rK   r   c                    V P                   # )z:
Returns the shape of a single sample (without batching).
)r)   rM   s   &r   r   Distribution.event_shaper   rO   r   c                J   < V ^8  d   QhRS[ S[S[P                  3,          /# rI   )dictstrr   
Constraint)r   r   s   "r   r   r   z   s$     " "c;+A+A&A!B "r   c                    \         h)z
Returns a dictionary from argument names to
:class:`~torch.distributions.constraints.Constraint` objects that
should be satisfied by each argument of this distribution. Args that
are not tensors need not appear in this dict.
rD   rM   s   &r   r*   Distribution.arg_constraintsy   
     "!r   c                B   < V ^8  d   QhRS[ P                  R,          /# )r   r   N)r   rV   )r   r   s   "r   r   r      s     " "//$6 "r   c                    \         h)zq
Returns a :class:`~torch.distributions.constraints.Constraint` object
representing this distribution's support.
rD   rM   s   &r   supportDistribution.support   
     "!r   c                    < V ^8  d   QhRS[ /# rI   r   )r   r   s   "r   r   r      s     " "f "r   c                    \         h)z'
Returns the mean of the distribution.
rD   rM   s   &r   meanDistribution.mean   
    
 "!r   c                    < V ^8  d   QhRS[ /# rI   r   )r   r   s   "r   r   r      s     O Of Or   c                2    \        V P                   R24      h)z'
Returns the mode of the distribution.
z does not implement mode)r+   r.   rM   s   &r   modeDistribution.mode   s    
 "T^^$44L"MNNr   c                    < V ^8  d   QhRS[ /# rI   r   )r   r   s   "r   r   r      s     " "& "r   c                    \         h)z+
Returns the variance of the distribution.
rD   rM   s   &r   varianceDistribution.variance   rc   r   c                    < V ^8  d   QhRS[ /# rI   r   )r   r   s   "r   r   r      s     $ $ $r   c                6    V P                   P                  4       # )z5
Returns the standard deviation of the distribution.
)rj   sqrtrM   s   &r   stddevDistribution.stddev   s    
 }}!!##r   c                &   < V ^8  d   QhRS[ RS[/# r   sample_shaper   r	   r   )r   r   s   "r   r   r      s     . .5 .F .r   c                    \         P                  ! 4       ;_uu_ 4        V P                  V4      uuRRR4       #   + '       g   i     R# ; i)z|
Generates a sample_shape shaped sample or sample_shape shaped batch of
samples if the distribution parameters are batched.
N)r!   no_gradrsampler=   rs   s   &&r   sampleDistribution.sample   s'    
 ]]__<<- ___s	   :A	c                &   < V ^8  d   QhRS[ RS[/# rr   rt   )r   r   s   "r   r   r      s     " "E "V "r   c                    \         h)z
Generates a sample_shape shaped reparameterized sample or sample_shape
shaped batch of reparameterized samples if the distribution parameters
are batched.
rD   rx   s   &&r   rw   Distribution.rsample   r^   r   z=`sample_n(n)` will be deprecated. Use `sample((n,))` instead.)categoryc                &   < V ^8  d   QhRS[ RS[/# )r   nr   )intr   )r   r   s   "r   r   r      s     - -# -& -r   c                N    V P                  \        P                  ! V34      4      # )zY
Generates n samples or n batches of samples if the distribution
parameters are batched.
)ry   r!   r"   )r=   r   s   &&r   sample_nDistribution.sample_n   s     {{5::qd+,,r   c                &   < V ^8  d   QhRS[ RS[ /# r   r   r   r   )r   r   s   "r   r   r      s     " "f " "r   c                    \         h)zk
Returns the log of the probability density/mass function evaluated at
`value`.

Args:
    value (Tensor):
rD   r=   r   s   &&r   log_probDistribution.log_prob   rY   r   c                &   < V ^8  d   QhRS[ RS[ /# r   r   )r   r   s   "r   r   r      s     " " "F "r   c                    \         h)z_
Returns the cumulative density/mass function evaluated at
`value`.

Args:
    value (Tensor):
rD   r   s   &&r   cdfDistribution.cdf   rY   r   c                &   < V ^8  d   QhRS[ RS[ /# r   r   )r   r   s   "r   r   r      s     " "& "V "r   c                    \         h)zg
Returns the inverse cumulative density/mass function evaluated at
`value`.

Args:
    value (Tensor):
rD   r   s   &&r   icdfDistribution.icdf   rY   r   c                &   < V ^8  d   QhRS[ RS[/# )r   rF   r   )r   r   )r   r   s   "r   r   r      s     " " " "r   c                    \         h)a  
Returns tensor containing all values supported by a discrete
distribution. The result will enumerate over dimension 0, so the shape
of the result will be `(cardinality,) + batch_shape + event_shape`
(where `event_shape = ()` for univariate distributions).

Note that this enumerates over all batched tensors in lock-step
`[[0, 0], [1, 1], ...]`. With `expand=False`, enumeration happens
along dim 0, but with the remaining batch dimensions being
singleton dimensions, `[[0], [1], ..`.

To iterate over the full Cartesian product use
`itertools.product(m.enumerate_support())`.

Args:
    expand (bool): whether to expand the support over the
        batch dims to match the distribution's `batch_shape`.

Returns:
    Tensor iterating over dimension 0.
rD   )r=   rF   s   &&r   enumerate_supportDistribution.enumerate_support   s
    , "!r   c                    < V ^8  d   QhRS[ /# rI   r   )r   r   s   "r   r   r      s     " " "r   c                    \         h)zg
Returns entropy of distribution, batched over batch_shape.

Returns:
    Tensor of shape batch_shape.
rD   rM   s   &r   entropyDistribution.entropy   s
     "!r   c                    < V ^8  d   QhRS[ /# rI   r   )r   r   s   "r   r   r     s     ) )F )r   c                J    \         P                  ! V P                  4       4      # )zj
Returns perplexity of distribution, batched over batch_shape.

Returns:
    Tensor of shape batch_shape.
)r!   expr   rM   s   &r   
perplexityDistribution.perplexity  s     yy((r   c                :   < V ^8  d   QhRS[ RS[P                  /# rr   )r	   r!   r"   )r   r   s   "r   r   r   
  s#     P PE PUZZ Pr   c                    \        V\        P                  4      '       g   \        P                  ! V4      p\        P                  ! WP                  ,           V P                  ,           4      # )a@  
Returns the size of the sample returned by the distribution, given
a `sample_shape`. Note, that the batch and event shapes of a distribution
instance are fixed at the time of construction. If this is empty, the
returned shape is upcast to (1,).

Args:
    sample_shape (torch.Size): the size of the sample to be drawn.
)r2   r!   r"   r(   r)   rx   s   &&r   _extended_shapeDistribution._extended_shape
  sF     ,

33 ::l3Lzz,):)::T=N=NNOOr   c                $   < V ^8  d   QhRS[ RR/# r   r   )r   r   s   "r   r   r     s     2 2f 2 2r   c                   \        V\        P                  4      '       g   \        R4      h\	        VP                  4       4      \	        V P                  4      ,
          pVP                  4       VR V P                  8w  d+   \        RVP                  4        RV P                   R24      hVP                  4       pV P                  V P                  ,           p\        \        V4      \        V4      4       F/  w  rVV^8w  g   K  V^8w  g   K  WV8w  g   K  \        RV RV R24      h	   V P                  pTf   \        R4      hTP!                  T4      p\        P"                  ! T4      '       gS   \        R\%        T4      P&                   R\)        TP*                  4       R\-        T4       R\-        T 4       RT 2
4      hR#   \         d8    \        P                  ! T P                   R2R,           R	,           ^R
7        R# i ; i)a  
Argument validation for distribution methods such as `log_prob`,
`cdf` and `icdf`. The rightmost dimensions of a value to be
scored via these methods must agree with the distribution's batch
and event shapes.

Args:
    value (Tensor): the tensor whose log probability is to be
        computed by the `log_prob` method.
Raises
    ValueError: when the rightmost dimensions of `value` do not match the
        distribution's batch and event shapes.
z/The value argument to log_prob must be a TensorNz5The right-most size of value must match event_shape: z vs .z9Value is not broadcastable with batch_shape+event_shape: z% does not define `support` to enable z;sample validation. Please initialize the distribution with z-`validate_args=False` to turn off validation.r$   zsupport is unexpectedly NonezExpected value argument (r&   z) to be within the support (z) of the distribution r'   )r2   r!   r   r   lensizer)   r(   zipreversedr\   r+   r,   r-   r.   AssertionErrorr5   r6   r4   r7   r8   r9   r:   )	r=   r   event_dim_startactual_shapeexpected_shapeijr\   r@   s	   &&       r   _validate_sampleDistribution._validate_sample  s    %..NOOejjl+c$2C2C.DD::<()T->->>G

~UYZ^ZkZkYllmn  zz|**T->->>.0HIDAAv!q&QV OP\~]abpaqqrs  J
		llG ? !?@@e$!!%((K(()E%++4F3G H--1']O <''+Dzl 3..3W	6  ) # 	MM>>""GHOPAB 	 	s   *G >HHc                    VfU   \        V 4      P                  VP                  8w  d1   \        RV P                  P                   RVP                   R24      hVf   V P                  \        V 4      4      # T# )Nz	Subclass z of zR that defines a custom __init__ method must also define a custom .expand() method.)r4   r<   r+   r.   r7   __new__)r=   clsrE   s   &&&r   _get_checked_instance"Distribution._get_checked_instanceL  sp    d!4!4!D%DNN334D G> >  ,5+<t||DJ'K)Kr   c                    < V ^8  d   QhRS[ /# rI   )rU   )r   r   s   "r   r   r   T  s     A A# Ar   c           	        V P                   P                  4        UUu. uF  w  rWP                  9   g   K  VNK  	  pppR P                  V Uu. uFb  pT RV P                  V,          P	                  4       ^8X  d   V P                  V,          M V P                  V,          P                  4        2NKd  	  up4      pV P                  P                  R,           V,           R,           # u uppi u upi )z, z: ())r*   r/   r1   joinnumelr   r.   r7   )r=   k_param_namespargs_strings   &     r   __repr__Distribution.__repr__T  s    %)%9%9%?%?%AX%ATQQ--EWqq%AXii %$A #RDMM!,<,B,B,D,Ia(t}}]^O_OdOdOfgh$
 ~~&&,{:S@@ Ys   C)C)A(C/)r(   r)   r   )N)T))r7   
__module____qualname____firstlineno____doc__has_rsamplehas_enumerate_supportr   staticmethodr   r!   r"   r<   rF   propertyr   r   r*   r\   ra   rf   rj   ro   ry   rw   r   FutureWarningr   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell____classcell__)r.   r   s   @@r   r
   r
      s     K!N, ,$ #(**,"'**,%)	& &P" "* ! ! ! ! " " " " " " O O " " $ $ ,1::< . . -2JJL " " G-	-" "" "" "" "0" ") ) 5:JJL P P2 2hLA A Ar   )r,   typing_extensionsr   r!   r   torch.distributionsr   torch.distributions.utilsr   torch.typesr	   __all__r
    r   r   <module>r      s2     (   + 3  
MA MAr   