---
title: "ClikaRT::ops::bernoulli_"
sidebar_label: "bernoulli_"
description: "In-place: overwrite self, whose values are the per-element success probabilities, with the 0/1 draws (self[i] ~ Bernoulli(self[i]))."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## bernoulli\_() {#bernoulli_}

<div class="api-signature">

`void` **`bernoulli_`**([`Tensor`](../Tensor.md)`&` `self`, [`StreamOrDevice`](../StreamOrDevice.md) `device` `=` `{}`)

</div>

In-place: overwrite `self`, whose values are the per-element success probabilities, with the 0/1 draws (`self[i] ~ Bernoulli(self[i])`).

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 4113

</div>
