/usr/local/lib64/python3.6/site-packages/torch/distributions/__pycache__
Edit: /usr/local/lib64/python3.6/site-packages/torch/distributions/__pycache__/laplace.cpython-36.pyc (3442B)
3
Eg @ sL d dl mZ d dlZd dlmZ d dlmZ d dlmZ G dd deZ dS ) )NumberN)constraints)Distribution)
broadcast_allc s e Zd ZdZejejdZejZdZ e
dd Ze
dd Ze
dd Z
d fdd Zd fd
d Zej fddZdd Zdd Zdd Zdd Z ZS )Laplacea
Creates a Laplace distribution parameterized by :attr:`loc` and :attr:`scale`.
Example::
>>> m = Laplace(torch.tensor([0.0]), torch.tensor([1.0]))
>>> m.sample() # Laplace distributed with loc=0, scale=1
tensor([ 0.1046])
Args:
loc (float or Tensor): mean of the distribution
scale (float or Tensor): scale of the distribution
)locscaleTc C s | j S )N)r )self r
G/usr/local/lib64/python3.6/site-packages/torch/distributions/laplace.pymean s zLaplace.meanc C s d| j jd S )N )r pow)r r
r
r variance s zLaplace.variancec C s
d| j S )Nr
g ?g;f?)r )r r
r
r stddev" s zLaplace.stddevNc sR t ||\| _| _t|tr0t|tr0tj }n
| jj }tt | j
||d d S )N)
validate_args)r r r
isinstancer torchSizesizesuperr __init__)r r r r batch_shape) __class__r
r r &