---
title: "ClikaRT::ops::randn_like"
sidebar_label: "randn_like"
description: "N(0, 1) draws shaped and typed like reference. reference the tensor whose shape/dtype the output copies. device stream or device; default = the default device."
---

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

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

## randn\_like() {#randn_like}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`randn_like`**([`Tensor`](../Tensor.md) `reference`, [`StreamOrDevice`](../StreamOrDevice.md) `device` `=` `{}`)

</div>

`N(0, 1)` draws shaped and typed like `reference`.

**Parameters**

- `reference`: the tensor whose shape/dtype the output copies.
- `device`: stream or device; default = the default device.

**Returns:** normal draws, `reference`'s shape and dtype.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) on a non-float reference dtype.

<div class="api-declared">

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

</div>
