<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/random/random_ops.py#L34-L60) |

Generates `Tensor` consisting of `-1` or `+1`, chosen uniformly at random.

    tfp.random.rademacher(
        shape, dtype=tf.float32, seed=None, name=None
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [Learnable Distributions Zoo](https://www.tensorflow.org/probability/examples/Learnable_Distributions_Zoo) |

For more details, see [Rademacher distribution](https://en.wikipedia.org/wiki/Rademacher_distribution).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `shape` | Vector-shaped, `int` `Tensor` representing shape of output. |
| `dtype` | (Optional) TF `dtype` representing `dtype` of output. |
| `seed` | PRNG seed; see [`tfp.random.sanitize_seed`](https://www.tensorflow.org/probability/api_docs/python/tfp/random/sanitize_seed) for details. |
| `name` | Python `str` name prefixed to Ops created by this function. Default value: `None` (i.e., 'random_rademacher'). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `rademacher` | `Tensor` with specified `shape` and `dtype` consisting of `-1` or `+1` chosen uniformly-at-random. |

<br />