e)
    Y = |X| ~ HalfNormal(scale)
    

Example:

    
    
    >>> m = HalfNormal(torch.tensor([1.0]))
    >>> m.sample()  # half-normal distributed with scale=1
    tensor([ 0.1046])
    

Parameters

    

**scale** ( [ _float_ ](https://docs.python.org/3/library/functions.html#float
"\(in Python v3.8\)") _or_ [ _Tensor_ ](tensors.html#torch.Tensor
"torch.Tensor") ) – scale of the full Normal distribution

` arg_constraints ` _= {'scale': GreaterThan(lower_bound=0.0)}_ ¶

    

` cdf ` (  _value_ )  [ [source]
](_modules/torch/distributions/half_normal.html#HalfNormal.cdf) ¶

    

` entropy ` (  )  [ [source]
](_modules/torch/distributions/half_normal.html#HalfNormal.entropy) ¶

    

` expand ` (  _batch_shape_ , __instance=None_ )  [ [source]
](_modules/torch/distributions/half_normal.html#HalfNormal.expand) ¶

    

` has_rsample ` _= True_ ¶

    

` icdf ` (  _prob_ )  [ [source]
](_modules/torch/distributions/half_normal.html#HalfNormal.icdf) ¶

    

` log_prob ` (  _value_ )  [ [source]
](_modules/torch/distributions/half_normal.html#HalfNormal.log_prob) ¶

    

_property_ ` mean ` ¶

    

_property_ ` scale ` ¶

    

` support ` _= GreaterThan(lower_bound=0.0)_ ¶

    

_property_ ` variance ` ¶

    

##  Independent  ¶

_class_ ` torch.distributions.independent. ` ` Independent ` (
_base_distribution_ , _reinterpreted_batch_ndims_ , _validate_args=None_ )  [
[source]  ](_modules/torch/distributions/independent.html#Independent) ¶

    

Bases:  ` torch.distributions.distribution.Distribution  `

Reinterprets some of the batch dims of a distribution as event dims.

This is mainly useful for changing the shape of the result of  ` log_prob()  `
. For example to create a diagonal Normal distribution with the same shape as
a Multivariate Normal distribution (so they are interchangeable), you can:

    
    
    >>> loc = torch.zeros(3)
    >>> scale = torch.ones(3)
    >>> mvn = MultivariateNormal(loc, scale_tril=torch.diag(scale))
    >>> [mvn.batch_shape, mvn.event_shape]
    [torch.Size(()), torch.Size((3,))]
    >>> normal = Normal(loc, scale)
    >>> [normal.batch_shape, normal.event_shape]
    [torch.Size((3,)), torch.Size(())]
    >>> diagn = Independent(normal, 1)
    >>> [diagn.batch_shape, diagn.event_shape]
    [torch.Size(()), torch.Size((3,))]
    

Parameters

    

  * **base_distribution** (  _torch.distributions.distribution.Distribution_ ) – a base distribution 

  * **reinterpreted_batch_ndims** ( [ _int_ ](https://docs.python.org/3/library/functions.html#int "\(in Python v3.8\)") ) – the number of batch dims to reinterpret as event dims 

` arg_constraints ` _= {}_ ¶

    

` entropy ` (  )  [ [source]
](_modules/torch/distributions/independent.html#Independent.entropy) ¶

    

` enumerate_support ` (  _expand=True_ )  [ [source]
](_modules/torch/distributions/independent.html#Independent.enumerate_support)
¶

    

` expand ` (  _batch_shape_ , __instance=None_ )  [ [source]
](_modules/torch/distributions/independent.html#Independent.expand) ¶

    

_property_ ` has_enumerate_support ` ¶

    

_property_ ` has_rsample ` ¶

    

` log_prob ` (  _value_ )  [ [source]
](_modules/torch/distributions/independent.html#Independent.log_prob) ¶

    

_property_ ` mean ` ¶

    

` rsample ` (  _sample_shape=torch.Size([])_ )  [ [source]
](_modules/torch/distributions/independent.html#Independent.rsample) ¶

    

` sample ` (  _sample_shape=torch.Size([])_ )  [ [source]
](_modules/torch/distributions/independent.html#Independent.sample) ¶

    

_property_ ` support ` ¶

    

_property_ ` variance ` ¶

    

##  Laplace  ¶

_class_ ` torch.distributions.laplace. ` ` Laplace ` (  _loc_ , _scale_ ,
_validate_args=None_ )  [ [source]
](_modules/torch/distributions/laplace.html#Laplace) ¶

    

Bases:  ` torch.distributions.distribution.Distribution  `

Creates a Laplace distribution parameterized by ` loc  ` and ` scale  ` .

Example:

    
    
    >>> m = Laplace(torch.tensor([0.0]), torch.tenso