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

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

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Tensor](index.md)/[toFloatArray](toFloatArray.md)

# toFloatArray

[common]\
fun [toFloatArray](toFloatArray.md)(): [FloatArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html)

Every element of a Float32 tensor of any rank, copied out flat in row-major order (the last dimension varies fastest: a `[2, 3]` tensor reads row 0's three values, then row 1's), after waiting for the producer. A tensor whose strides admit no flat view is packed into one for the read; the tensor itself is unchanged. Reshape the array by [shape](shape.md) on your side when you need the grid back.