# tf_agents.specs.distribution_spec.DistributionSpec

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/specs/distribution_spec.py#L29-L96) |

Describes a tfp.distribution.Distribution.

    tf_agents.specs.distribution_spec.DistributionSpec(
        builder, input_params_spec, sample_spec, **distribution_parameters
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `builder` | Callable function(**params) which returns a Distribution following the spec.** |
| `input_params_spec` | Nest of tensor_specs describing the tensor parameters required for building the described distribution. |
| `sample_spec` | Data type of the output samples of the described distribution. |
| `**distribution_parameters`\<a id="distribution_parameters"\> | Extra parameters for building the distribution. |

<br />

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `builder` | Returns the `distribution_builder` of the spec. |
| `distribution_parameters` | Returns the `distribution_parameters` of the spec. |
| `input_params_spec` | Returns the `input_params_spec` of the spec. |
| `sample_spec` | Returns the `sample_spec` of the spec. |

<br />

## Methods

### `build_distribution`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/specs/distribution_spec.py#L78-L91)

    build_distribution(
        **distribution_parameters
    )

Creates an instance of the described distribution.

The spec's paramers are updated with the given ones.
Args:
\*\*distribution_parameters: Kwargs update the spec's distribution
parameters.

<br />

<br />

<br />

| Returns ||
|---|---|
| Distribution instance. ||

<br />