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

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

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

# repeatInterleave

[common]\
fun [repeatInterleave](repeatInterleave.md)(input: [Tensor](../Tensor/index.md), repeats: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, outputSize: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)

`repeatInterleave(input: Tensor, repeats: Tensor, dim: Long? = null, outputSize: Long? = null)`: the `repeat_interleave` operator. Repeat ELEMENTS, not blocks: each element along `dim` appears `repeats` times consecutively (`[a, b]` with repeats 2 ->`[a, a, b, b]`). `repeats` is a scalar (uniform count) or a 1-D tensor matching the dim's length (per-element counts, output length = their sum). With `dim` absent the input is flattened first. `output_size` is the known result length along the dim; pass it when the caller already has it, so a tensor-valued `repeats` skips the blocking host-side count. Copies.

[common]\
fun [repeatInterleave](repeatInterleave.md)(input: [Tensor](../Tensor/index.md), repeats: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, outputSize: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)

`repeatInterleave(input: Tensor, repeats: Double, dim: Long? = null, outputSize: Long? = null)`: the number form of `repeat_interleave`, `repeats` as a scalar.