---
title: "ClikaRT::ops::randint_like"
sidebar_label: "randint_like"
description: "Uniform integers in [low, high) shaped and typed like reference. reference the tensor whose shape/dtype the output copies. low inclusive lower bound. high exclusive upper bound."
---

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

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

## randint\_like() {#randint_like}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`randint_like`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `reference`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`int64_t` `low`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`int64_t` `high`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`StreamOrDevice`](../StreamOrDevice.md) `device` `=` `{}`<br />
)

</div>

Uniform integers in `[low, high)` shaped and typed like `reference`.

**Parameters**

- `reference`: the tensor whose shape/dtype the output copies.
- `low`: inclusive lower bound.
- `high`: exclusive upper bound.
- `device`: stream or device; default = the default device.

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

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) when `high <= low`.

<div class="api-declared">

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

</div>
