---
title: "ClikaRT::ops::rot90"
sidebar_label: "rot90"
description: "Rotate the plane spanned by dims by k x 90 degrees (k is taken mod 4; odd rotations swap the two dims' extents). Default plane {0, 1}. Copies."
---

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

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

## rot90() {#rot90}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`rot90`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`int64_t` `k` `=` `1`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`ClikaRT::Span`](../Span.md)`<const std::int64_t>` `dims` `=` `{0, 1}`<br />
)

</div>

Rotate the plane spanned by `dims` by `k` x 90 degrees (`k` is taken mod 4; odd rotations swap the two dims' extents). Default plane `{0, 1}`. Copies.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) when `dims` does not name two distinct in-range dims (`code_name()` carries the reason).

**Returns:** a new tensor with the plane rotated.

<div class="api-declared">

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

</div>
