
    9i                     l    S SK JrJr  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	)
    )OptionalUnion)Tensor)constraints)Normal)TransformedDistribution)ExpTransform	LogNormalc            	       H  ^  \ rS rSr% Sr\R                  \R                  S.r\R                  r	Sr
\\S'    SS\\\4   S\\\4   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        ^/var/www/html/land-doc-ocr/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.expand0   s&    ((I>w~k~99r   c                 .    U R                   R                  $ N)r   r   r   s    r   r   LogNormal.loc4   s    ~~!!!r   c                 .    U R                   R                  $ r"   )r   r   r#   s    r   r   LogNormal.scale8   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.mode@   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.varianceD   s<    ::>>!$~~1txx<(#:"?"?"AAAr   c                 P    U R                   R                  5       U R                  -   $ r"   )r   entropyr   r#   s    r   r8   LogNormal.entropyI   s    ~~%%'$((22r    r"   )__name__
__module____qualname____firstlineno____doc__r   realpositivearg_constraintssupporthas_rsampler   __annotations__r   r   floatr   boolr   r   propertyr   r   r,   r0   r5   r8   __static_attributes____classcell__)r   s   @r   r
   r
      s    & *..9M9MNO""GK )-	Q65=!Q VU]#Q  ~	Q
 
Q Q: "V " " $v $ $ 8f 8 8 6f 6 6 B& B B3 3r   N)typingr   r   torchr   torch.distributionsr   torch.distributions.normalr   ,torch.distributions.transformed_distributionr   torch.distributions.transformsr	   __all__r
   r:   r   r   <module>rR      s-    "  + - P 7 -<3' <3r   