View source on GitHub

Create a random variable for Empirical.

See Empirical for more details.


Original Docstring for Distribution

Initialize Empirical distributions.

samples Numeric Tensor of shape [B1, ..., Bk, S, E1, ..., En],k, n >= 0. Samples or batches of samples on which the distribution is based. The firstkdimensions index into a batch of independent distributions. Length ofSdimension determines number of samples in each multiset. The lastndimension represents samples for each distribution. n is specified by argument event_ndims. </td> </tr><tr> <td>event_ndims</td> <td> Pythonint32, default0. number of dimensions for each event. When0this distribution has scalar samples. When1this distribution has vector-like samples. </td> </tr><tr> <td>validate_args</td> <td> Pythonbool, defaultFalse. WhenTruedistribution parameters are checked for validity despite possibly degrading runtime performance. WhenFalseinvalid inputs may silently render incorrect outputs. </td> </tr><tr> <td>allow_nan_stats</td> <td> Pythonbool, defaultTrue. WhenTrue, statistics (e.g., mean, mode, variance) use the valueNaNto indicate the result is undefined. WhenFalse, an exception is raised if one or more of the statistic's batch members are undefined. </td> </tr><tr> <td>name</td> <td> Pythonstr` name prefixed to Ops created by this class.

ValueError if the rank of samples is statically known and less than event_ndims + 1.