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

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

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

# roll

[common]\
fun [roll](roll.md)(input: [Tensor](../Tensor/index.md), shifts: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)

`roll(input: Tensor, shifts: LongArray, dims: LongArray = longArrayOf())`: the `roll` operator. Circularly shift elements: `shifts[i]` positions along `dims[i]`; elements that fall off one end re-enter at the other. With `dims` empty (the default) the tensor is treated as flattened row-major and shifted by `shifts[0]`. Copies.