# tf.keras.initializers.RandomUniform

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 2 version](https://www.tensorflow.org/api_docs/python/tf/keras/initializers/RandomUniform) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/initializers.py#L100-L119) |

Initializer that generates tensors with a uniform distribution.

Inherits From: [`random_uniform_initializer`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/random_uniform_initializer)

#### View aliases


**Main aliases**

[`tf.keras.initializers.random_uniform`](https://www.tensorflow.org/api_docs/python/tf/keras/initializers/RandomUniform), \`tf.keras.initializers.uniform\`
**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.initializers.RandomUniform`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/keras/initializers/RandomUniform), [`tf.compat.v1.keras.initializers.random_uniform`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/keras/initializers/RandomUniform), [`tf.compat.v1.keras.initializers.uniform`](https://www.tensorflow.org/api_docs/python/tf/compat/v1/keras/initializers/RandomUniform)

<br />

    tf.keras.initializers.RandomUniform(
        minval=-0.05, maxval=0.05, seed=None, dtype=tf.dtypes.float32
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `minval` | A python scalar or a scalar tensor. Lower bound of the range of random values to generate. Defaults to -0.05. |
| `maxval` | A python scalar or a scalar tensor. Upper bound of the range of random values to generate. Defaults to 0.05. |
| `seed` | A Python integer. Used to create random seeds. See [`tf.compat.v1.set_random_seed`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/random/set_random_seed) for behavior. |
| `dtype` | The data type. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A RandomUniform instance. ||

<br />

## Methods

### `from_config`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/init_ops.py#L78-L97)

    @classmethod
    from_config(
        config
    )

Instantiates an initializer from a configuration dictionary.

#### Example:

    initializer = RandomUniform(-1, 1)
    config = initializer.get_config()
    initializer = RandomUniform.from_config(config)

<br />

<br />

<br />

| Args ||
|---|---|
| `config` | A Python dictionary. It will typically be the output of `get_config`. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| An Initializer instance. ||

<br />

### `get_config`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/init_ops.py#L285-L291)

    get_config()

Returns the configuration of the initializer as a JSON-serializable dict.

<br />

<br />

<br />

| Returns ||
|---|---|
| A JSON-serializable Python dict. ||

<br />

### `__call__`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/init_ops.py#L279-L283)

    __call__(
        shape, dtype=None, partition_info=None
    )

Returns a tensor object initialized as specified by the initializer.

<br />

<br />

<br />

| Args ||
|---|---|
| `shape` | Shape of the tensor. |
| `dtype` | Optional dtype of the tensor. If not provided use the initializer dtype. |
| `partition_info` | Optional information about the possible partitioning of a tensor. |

<br />