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

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

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

# generateRotaryCache

[common]\
fun [generateRotaryCache](generateRotaryCache.md)(rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), maxPositions: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, lowFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, highFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, originalMaxPos: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, betaFast: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, betaSlow: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, freqFactors: [Tensor](../Tensor/index.md)? = null, device: [Placement](../Placement/index.md)? = null, yarnTruncate: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;

`generateRotaryCache(rotaryDim: Long, maxPositions: Long, theta: Double? = null, scaling: RopeScaling? = null, scale: Double? = null, lowFreqFactor: Double? = null, highFreqFactor: Double? = null, originalMaxPos: Long? = null, betaFast: Double? = null, betaSlow: Double? = null, freqFactors: Tensor? = null, device: Placement? = null, yarnTruncate: Boolean? = null)`: the `generate_rotary_cache` operator. The rotary angle tables of one context-scaling family: `cos` and `sin`, each `[max_positions, rotary_dim / 2]` Float32.