Skip to main content

//clika-runtime/io.clika.runtime/Ops/copyInPlace

copyInPlace

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

copyInPlace(self: Tensor, src: Tensor, target: Placement? = null): the copy_ operator. Copies src INTO self's existing storage, converting per element to self's dtype in the same single pass (never cast first; the copy IS the cast). Shapes must match after broadcasting src. Raises ClikaRT::Error where the shapes/dtypes cannot be served; returns self under the value surface, Result<void> under the Result surface; CLIKART_CHECK is the mode-stable spelling. Writes through self and returns it, so calls chain.