
    ȅi                     \    S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S/r
 " S S\5      rg)	    )Tensor)constraints)Normal)TransformedDistribution)ExpTransform	LogNormalc            	       @  ^  \ rS rSr% Sr\R                  \R                  S.r\R                  r	Sr
\\S'    SS\\-  S\\-  S	\S-  S
S4U 4S jjjrSU 4S jjr\S
\4S j5       r\S
\4S j5       r\S
\4S j5       r\S
\4S j5       r\S
\4S j5       rS rSrU =r$ )r      a  
Creates a log-normal distribution parameterized by
:attr:`loc` and :attr:`scale` where::

    X ~ Normal(loc, scale)
    Y = exp(X) ~ LogNormal(loc, scale)

Example::

    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> m = LogNormal(torch.tensor([0.0]), torch.tensor([1.0]))
    >>> m.sample()  # log-normal distributed with mean=0 and stddev=1
    tensor([ 0.1046])

Args:
    loc (float or Tensor): mean of log of distribution
    scale (float or Tensor): standard deviation of log of the distribution
)locscaleT	base_distNr   r   validate_argsreturnc                 H   > [        XUS9n[        TU ]	  U[        5       US9  g )N)r   )r   super__init__r   )selfr   r   r   r   	__class__s        X/home/james-whalen/.local/lib/python3.13/site-packages/torch/distributions/log_normal.pyr   LogNormal.__init__(   s'     3]C	LN-P    c                 J   > U R                  [        U5      n[        TU ]  XS9$ )N)	_instance)_get_checked_instancer   r   expand)r   batch_shaper   newr   s       r   r   LogNormal.expand1   s&    ((I>w~k~99r   c                 .    U R                   R                  $ N)r   r   r   s    r   r   LogNormal.loc5   s    ~~!!!r   c                 .    U R                   R                  $ r    )r   r   r!   s    r   r   LogNormal.scale9   s    ~~###r   c                 t    U R                   U R                  R                  S5      S-  -   R                  5       $ N   )r   r   powexpr!   s    r   meanLogNormal.mean=   s,    4::>>!,q005577r   c                 l    U R                   U R                  R                  5       -
  R                  5       $ r    )r   r   squarer)   r!   s    r   modeLogNormal.modeA   s'    4::,,..3355r   c                     U R                   R                  S5      nUR                  5       SU R                  -  U-   R	                  5       -  $ r&   )r   r(   expm1r   r)   )r   scale_sqs     r   varianceLogNormal.varianceE   s<    ::>>!$~~1txx<(#:"?"?"AAAr   c                 P    U R                   R                  5       U R                  -   $ r    )r   entropyr   r!   s    r   r6   LogNormal.entropyJ   s    ~~%%'$((22r    r    )__name__
__module____qualname____firstlineno____doc__r   realpositivearg_constraintssupporthas_rsampler   __annotations__r   floatboolr   r   propertyr   r   r*   r.   r3   r6   __static_attributes____classcell__)r   s   @r   r   r      s   & *..9M9MNO""GK &*	Qe^Q ~Q d{	Q
 
Q Q: "V " " $v $ $ 8f 8 8 6f 6 6 B& B B3 3r   N)torchr   torch.distributionsr   torch.distributions.normalr   ,torch.distributions.transformed_distributionr   torch.distributions.transformsr   __all__r   r8   r   r   <module>rO      s,     + - P 7 ->3' >3r   