---
title: "bernoulliInPlace"
sidebar_label: "bernoulliInPlace"
description: "Kotlin binding reference: bernoulliInPlace."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[bernoulliInPlace](bernoulliInPlace.md)

# bernoulliInPlace

[common]\
fun [bernoulliInPlace](bernoulliInPlace.md)(self: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)

`bernoulliInPlace(self: Tensor, device: Placement? = null)`: the `bernoulli_` operator. In-place: overwrite `self`, whose values are the per-element success probabilities, with the 0/1 draws (`self[i] ~ Bernoulli(self[i])`). Writes through `self` and returns it, so calls chain.