Distribution is the abstract base class for probability distributions. Note: in Python, adding torch.Size objects works as concatenation Try for example: torch.Size((2, 1)) + torch.Size((1,))

## Public fields

.validate_args

whether to validate arguments

has_rsample

whether has an rsample

has_enumerate_support

whether has enumerate support

## Active bindings

batch_shape

Returns the shape over which parameters are batched.

event_shape

Returns the shape of a single sample (without batching). Returns a dictionary from argument names to torch_Constraint objects that should be satisfied by each argument of this distribution. Args that are not tensors need not appear in this dict.

support

Returns a torch_Constraint object representing this distribution's support.

mean

Returns the mean on of the distribution

variance

Returns the variance of the distribution

stddev

Returns the standard deviation of the distribution TODO: consider different message

## Methods

### Method new()

Initializes a distribution class.

#### Arguments

batch_shape

the desired expanded size.

.instance

new instance provided by subclasses that need to override expand.

### Method sample()

Generates a sample_shape shaped sample or sample_shape shaped batch of samples if the distribution parameters are batched.

#### Arguments

sample_shape

the shape you want to sample.

### Method log_prob()

Returns the log of the probability density/mass function evaluated at value.

#### Arguments

value

values to evaluate the density on.

### Method icdf()

Returns the inverse cumulative density/mass function evaluated at value.

@description Returns tensor containing all values supported by a discrete distribution. The result will enumerate over dimension 0, so the shape of the result will be (cardinality,) + batch_shape + event_shape (where event_shape = ()for univariate distributions). Note that this enumerates over all batched tensors in lock-steplist(c(0, 0), c(1, 1), ...). With expand=FALSE, enumeration happens along dim 0, but with the remaining batch dimensions being singleton dimensions, list(c(0), c(1), ...).

#### Arguments

expand

(bool): whether to expand the support over the batch dims to match the distribution's batch_shape.

#### Returns

Tensor iterating over dimension 0.

### Method entropy()

Returns entropy of distribution, batched over batch_shape.

#### Returns

Tensor of shape batch_shape.

### Method .extended_shape()

Returns the size of the sample returned by the distribution, given a sample_shape. Note, that the batch and event shapes of a distribution instance are fixed at the time of construction. If this is empty, the returned shape is upcast to (1,).

#### Arguments

value

(Tensor): the tensor whose log probability is to be computed by the log_prob method.

### Method print()

Prints the distribution instance.

#### Arguments

deep`

Whether to make a deep clone.