# tf_privacy.tree_aggregation.StatelessValueGenerator

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/privacy/blob/v0.9.0/privacy/privacy/dp_query/tree_aggregation.py#L141-L170) |

A wrapper for stateless value generator that calls a no-arg function.

Inherits From: [`ValueGenerator`](https://www.tensorflow.org/responsible_ai/privacy/api_docs/python/tf_privacy/tree_aggregation/ValueGenerator)

    tf_privacy.tree_aggregation.StatelessValueGenerator(
        value_fn
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `value_fn` | The function to call to generate values. |

<br />

## Methods

### `initialize`

[View source](https://github.com/tensorflow/privacy/blob/v0.9.0/privacy/privacy/dp_query/tree_aggregation.py#L152-L158)

    initialize()

Makes an initialized state for the StatelessValueGenerator.

<br />

<br />

<br />

| Returns ||
|---|---|
| An initial state (empty, because stateless). ||

<br />

### `next`

[View source](https://github.com/tensorflow/privacy/blob/v0.9.0/privacy/privacy/dp_query/tree_aggregation.py#L160-L170)

    next(
        state
    )

Gets next value.

<br />

<br />

<br />

| Args ||
|---|---|
| `state` | The current state (simply passed through). |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A pair (value, new_state) where value is the next value and new_state is the advanced state. ||

<br />