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

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

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

# to

[common]\
fun [to](to.md)(device: [Device](../Device/index.md)): [Tensor](index.md)

Move to [device](to.md); a tensor already there passes through.

[common]\
fun [to](to.md)(dtype: [DType](../DType/index.md)): [Tensor](index.md)

Cast to [dtype](to.md) through the runtime (never host-side float math).

[common]\
fun [to](to.md)(device: [Device](../Device/index.md), dtype: [DType](../DType/index.md)): [Tensor](index.md)

Move to [device](to.md) and cast to [dtype](to.md).