---
title: "ClikaRT::ops::validate_rotary_dim"
sidebar_label: "validate_rotary_dim"
description: "Checks a rotary-embedding configuration up front: rotary_dim must be positive, even, and (when head_dim is given) no larger than head_dim. rotary_dim the rotated prefix of the head dimension."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## validate\_rotary\_dim() {#validate_rotary_dim}

<div class="api-signature">

`void` **`validate_rotary_dim`**(`int64_t` `rotary_dim`, `int64_t` `head_dim` `=` `-1`)

</div>

Checks a rotary-embedding configuration up front: `rotary_dim` must be positive, even, and (when `head_dim` is given) no larger than `head_dim`.

**Parameters**

- `rotary_dim`: the rotated prefix of the head dimension.
- `head_dim`: the full head size; `-1` (default) skips that check.

**Throws**

- `ClikaRT::Error`: when the configuration is invalid (`code_name()` carries the reason). Returns nothing on success.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 2173

</div>
