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

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

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

# Encoded

[common]\
class [Encoded](index.md)(val ids: [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)&lt;[IntArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html)&gt;, val inputIds: [Tensor](../Tensor/index.md)?, val attentionMask: [Tensor](../Tensor/index.md)?, val seqLengths: [Tensor](../Tensor/index.md)?, val cuSeqlens: [Tensor](../Tensor/index.md)?)

A tensor-shaped encode: [ids](ids.md) always carries one id row per input text; the tensor columns are present only when [EncodeOptions.returnTensors](../EncodeOptions/returnTensors.md) was set: [inputIds](inputIds.md)`[B, S]` padded Int32 (or one flat row with [varlen](../EncodeOptions/varlen.md)), [attentionMask](attentionMask.md)`[B, S]` Int32 with 1 for a token and 0 for pad (padded layout only), [seqLengths](seqLengths.md)`[B]` Int32, the real token count per sequence, and [cuSeqlens](cuSeqlens.md)`[B + 1]` Int32, the exclusive prefix sums an attention over the flat row takes. Release the tensors you were given when done.

## Constructors

| | |
|---|---|
| [Encoded](Encoded.md) | [common]<br>constructor(ids: [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)&lt;[IntArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html)&gt;, inputIds: [Tensor](../Tensor/index.md)?, attentionMask: [Tensor](../Tensor/index.md)?, seqLengths: [Tensor](../Tensor/index.md)?, cuSeqlens: [Tensor](../Tensor/index.md)?) |

## Properties

| Name | Summary |
|---|---|
| [attentionMask](attentionMask.md) | [common]<br>val [attentionMask](attentionMask.md): [Tensor](../Tensor/index.md)? |
| [cuSeqlens](cuSeqlens.md) | [common]<br>val [cuSeqlens](cuSeqlens.md): [Tensor](../Tensor/index.md)? |
| [ids](ids.md) | [common]<br>val [ids](ids.md): [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)&lt;[IntArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html)&gt; |
| [inputIds](inputIds.md) | [common]<br>val [inputIds](inputIds.md): [Tensor](../Tensor/index.md)? |
| [seqLengths](seqLengths.md) | [common]<br>val [seqLengths](seqLengths.md): [Tensor](../Tensor/index.md)? |