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

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

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

# rand

[common]\
fun [rand](rand.md)(shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)

`rand(shape: LongArray, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the `rand` operator. Uniform random tensor on `[0, 1)`.