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

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

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

# take

[common]\
fun [take](take.md)(self: [Tensor](../Tensor/index.md), index: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)

`take(self: Tensor, index: Tensor)`: the `take` operator. Read elements of `self` at FLAT (row-major linearized) positions. `self` is treated as flattened 1-D: `out[..] = self.flat[index[..]]`. The output takes `index`'s shape and `self`'s dtype. Index dtype law as `gather`.