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

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

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

# transpose

[common]\
fun [transpose](transpose.md)(input: [Tensor](../Tensor/index.md), dim0: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dim1: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [Tensor](../Tensor/index.md)

`transpose(input: Tensor, dim0: Long, dim1: Long)`: the `transpose` operator. Swap `dim0` and `dim1`, `permute` for exactly two dims. Returns a view (no copy).