Skip to main content

//clika-runtime/io.clika.runtime/Ops/to

to

[common]
fun to(src: Tensor, target: Placement? = null): Tensor

to(src: Tensor, target: Placement? = null): the to operator. Moves a tensor to a device or stream. Already-resident inputs pass through (no transfer). The result is produced on target's stream; downstream ops on that stream order after the transfer automatically.

[common]
fun to(tensors: List<Tensor>, target: Placement? = null): List<Tensor>

to(tensors: List<Tensor>, target: Placement? = null): the to operator. Multi-tensor to: moves a batch in ONE call; the batched transfer beats N single moves when several tensors cross together (one submission, one ordering point).

[common]
fun to(src: Tensor, deviceStr: String): Tensor

to(src: Tensor, deviceStr: String): the to operator. String-addressed to: the device is named by string: "cpu", "cuda", "cuda:1", ….