
    IЦi                     P    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)    )constraints)Normal)TransformedDistribution)ExpTransform	LogNormalc                      ^  \ rS rSrSr\R                  \R                  S.r\R                  r	Sr
SU 4S jjrSU 4S jjr\S 5       r\S 5       r\S	 5       r\S
 5       r\S 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scaleTc                 H   > [        XUS9n[        TU ]	  U[        5       US9  g )N)validate_args)r   super__init__r   )selfr
   r   r   	base_dist	__class__s        ]/var/www/html/ai-image-ml/venv/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.expand&   s&    ((I>w~k~99r   c                 .    U R                   R                  $ N)r   r
   r   s    r   r
   LogNormal.loc*   s    ~~!!!r   c                 .    U R                   R                  $ r   )r   r   r   s    r   r   LogNormal.scale.   s    ~~###r   c                 t    U R                   U R                  R                  S5      S-  -   R                  5       $ N   )r
   r   powexpr   s    r   meanLogNormal.mean2   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.mode6   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.variance:   s<    ::>>!$~~1txx<(#:"?"?"AAAr   c                 P    U R                   R                  5       U R                  -   $ r   )r   entropyr
   r   s    r   r4   LogNormal.entropy?   s    ~~%%'$((22r    r   )__name__
__module____qualname____firstlineno____doc__r   realpositivearg_constraintssupporthas_rsampler   r   propertyr
   r   r(   r,   r1   r4   __static_attributes____classcell__)r   s   @r   r   r      s    $ *..9M9MNO""GKQ: " " $ $ 8 8 6 6 B B3 3r   N)
torch.distributionsr   torch.distributions.normalr   ,torch.distributions.transformed_distributionr   torch.distributions.transformsr   __all__r   r6   r   r   <module>rI      s'    + - P 7 -53' 53r   