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

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

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

# Ops

[common]\
object [Ops](index.md)

The generated operator surface; see the file banner for its laws.

## Functions

| Name | Summary |
|---|---|
| [abs](abs.md) | [common]<br>fun [abs](abs.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`abs(input: Tensor)`: the `abs` operator. Elementwise absolute value. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [absInPlace](absInPlace.md) | [common]<br>fun [absInPlace](absInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`absInPlace(self: Tensor)`: the `abs_` operator. In-place `abs`: writes the result through `self`; same formula, arguments, and error conditions as `abs()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [acos](acos.md) | [common]<br>fun [acos](acos.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`acos(input: Tensor)`: the `acos` operator. Elementwise arccosine. Inputs outside `[-1, 1]` produce NaN. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [acosh](acosh.md) | [common]<br>fun [acosh](acosh.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`acosh(input: Tensor)`: the `acosh` operator. Elementwise inverse hyperbolic cosine. Inputs below `1` produce NaN. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [acoshInPlace](acoshInPlace.md) | [common]<br>fun [acoshInPlace](acoshInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`acoshInPlace(self: Tensor)`: the `acosh_` operator. In-place `acosh`: writes the result through `self`; same formula, arguments, and error conditions as `acosh()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [acosInPlace](acosInPlace.md) | [common]<br>fun [acosInPlace](acosInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`acosInPlace(self: Tensor)`: the `acos_` operator. In-place `acos`: writes the result through `self`; same formula, arguments, and error conditions as `acos()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [adaptiveAvgPool](adaptiveAvgPool.md) | [common]<br>fun [adaptiveAvgPool](adaptiveAvgPool.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`adaptiveAvgPool(input: Tensor, outputSize: LongArray)`: the `adaptive_avg_pool` operator. Rank-generic adaptive average pooling to a target output size, channels-last. The window geometry is DERIVED per output position so the spatial dims land exactly on `output_size`; no kernel/stride/padding to pick. |
| [adaptiveAvgPool1d](adaptiveAvgPool1d.md) | [common]<br>fun [adaptiveAvgPool1d](adaptiveAvgPool1d.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`adaptiveAvgPool1d(input: Tensor, outputSize: LongArray)`: the `adaptive_avg_pool1d` operator. 1-D adaptive average pooling of `[N, L, C]` to `[N, L', C]`; the window geometry is derived from `output_size`. See `adaptive_avg_pool`. |
| [adaptiveAvgPool2d](adaptiveAvgPool2d.md) | [common]<br>fun [adaptiveAvgPool2d](adaptiveAvgPool2d.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`adaptiveAvgPool2d(input: Tensor, outputSize: LongArray)`: the `adaptive_avg_pool2d` operator. 2-D adaptive average pooling of `[N, H, W, C]` to `[N, H', W', C]`; windows derived so the output lands exactly on `output_size = {H', W'}`. `{1, 1}` is global average pooling. |
| [adaptiveAvgPool3d](adaptiveAvgPool3d.md) | [common]<br>fun [adaptiveAvgPool3d](adaptiveAvgPool3d.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`adaptiveAvgPool3d(input: Tensor, outputSize: LongArray)`: the `adaptive_avg_pool3d` operator. 3-D adaptive average pooling of `[N, D, H, W, C]` to `[N, D', H', W', C]`. See `adaptive_avg_pool`. |
| [adaptiveMaxPool](adaptiveMaxPool.md) | [common]<br>fun [adaptiveMaxPool](adaptiveMaxPool.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`adaptiveMaxPool(input: Tensor, outputSize: LongArray)`: the `adaptive_max_pool` operator. Rank-generic adaptive MAX pooling to a target output size, channels-last, the max sibling of `adaptive_avg_pool`. A window holding any NaN element yields NaN. |
| [adaptiveMaxPool1d](adaptiveMaxPool1d.md) | [common]<br>fun [adaptiveMaxPool1d](adaptiveMaxPool1d.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`adaptiveMaxPool1d(input: Tensor, outputSize: LongArray)`: the `adaptive_max_pool1d` operator. 1-D adaptive max pooling of `[N, L, C]` to `[N, L', C]`. See `adaptive_max_pool`. |
| [adaptiveMaxPool2d](adaptiveMaxPool2d.md) | [common]<br>fun [adaptiveMaxPool2d](adaptiveMaxPool2d.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`adaptiveMaxPool2d(input: Tensor, outputSize: LongArray)`: the `adaptive_max_pool2d` operator. 2-D adaptive max pooling of `[N, H, W, C]` to `[N, H', W', C]`. `{1, 1}` is global max pooling. See `adaptive_max_pool`. |
| [adaptiveMaxPool3d](adaptiveMaxPool3d.md) | [common]<br>fun [adaptiveMaxPool3d](adaptiveMaxPool3d.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`adaptiveMaxPool3d(input: Tensor, outputSize: LongArray)`: the `adaptive_max_pool3d` operator. 3-D adaptive max pooling of `[N, D, H, W, C]` to `[N, D', H', W', C]`. See `adaptive_max_pool`. |
| [add](add.md) | [common]<br>fun [add](add.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`add(input: Tensor, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the `add` operator. Adds `other` (scaled) to `input` elementwise. Broadcasting and type promotion, the contract every binary op on this surface shares: operand shapes broadcast per the standard rules (trailing dims align; a 1 stretches), and dtypes promote to the dominant operand dtype per the promotion lattice (a scalar `other` keeps its weak kind; an integer literal with an integer tensor stays integral, a double promotes weak-float). The other ops below state &quot;broadcasts and promotes as `add`&quot; instead of restating this.<br>[common]<br>fun [add](add.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`add(input: Tensor, other: Double, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the number form of `add`, `other` as a scalar.<br>[common]<br>fun [add](add.md)(input: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), other: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`add(input: Double, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the `add` operator. Scalar-LHS . `input` keeps its kind: an integer scalar with an integer tensor stays integral (weak-int promotion); a double promotes weak-float. The parameter set mirrors the tensor-first form: `alpha` scales the TENSOR operand `other`, `activation` applies to the result. |
| [addInPlace](addInPlace.md) | [common]<br>fun [addInPlace](addInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`addInPlace(self: Tensor, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the `add_` operator. In-place `add`: writes through `x`; semantics as `ops::add` (which also documents broadcasting/promotion). Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [addInPlace](addInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`addInPlace(self: Tensor, other: Double, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the number form of `add_`, `other` as a scalar. |
| [addLayerNorm](addLayerNorm.md) | [common]<br>fun [addLayerNorm](addLayerNorm.md)(input: [Tensor](../Tensor/index.md), residual: [Tensor](../Tensor/index.md)? = null, postResidual: [Tensor](../Tensor/index.md)? = null, normalizedShape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), skipBias: [Tensor](../Tensor/index.md)? = null, weight: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`addLayerNorm(input: Tensor, residual: Tensor? = null, postResidual: Tensor? = null, normalizedShape: LongArray = longArrayOf(), skipBias: Tensor? = null, weight: Tensor? = null, bias: Tensor? = null, eps: Double? = null, activation: Activation? = null)`: the `add_layer_norm` operator. Fused residual-add + normalization, on either side of the norm. Which data flow runs is inferred from which addends you supply; there is no mode flag: * `residual` only → `{ACT(norm(x + residual)·w + b), x + residual}` * `post_residual` only → `{ACT(norm(x)·w + b) + post_residual, UNDEFINED}` * both → `{ACT(norm(x + residual)·w + b) + post_residual, x + residual}` * neither → raises (that is a plain `rms_norm`/`layer_norm`) The **second result is the PRE-norm sum**, the residual stream the next sub-layer reads. Supplying only `post_residual` forms no such sum, so that element comes back UNDEFINED: read only the first one in that flow. The activation applies to the **norm result, before**`post_residual` is added; it is the norm's epilogue, not the sum's. Gated activations (SwiGlu / GeGlu / ReGlu) narrow their input and are rejected. |
| [addRmsNorm](addRmsNorm.md) | [common]<br>fun [addRmsNorm](addRmsNorm.md)(input: [Tensor](../Tensor/index.md), residual: [Tensor](../Tensor/index.md)? = null, residual2: [Tensor](../Tensor/index.md)? = null, postResidual: [Tensor](../Tensor/index.md)? = null, normalizedShape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), skipBias: [Tensor](../Tensor/index.md)? = null, weight: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`addRmsNorm(input: Tensor, residual: Tensor? = null, residual2: Tensor? = null, postResidual: Tensor? = null, normalizedShape: LongArray = longArrayOf(), skipBias: Tensor? = null, weight: Tensor? = null, bias: Tensor? = null, eps: Double? = null, activation: Activation? = null)`: the `add_rms_norm` operator. Fused residual-add + normalization, on either side of the norm. Which data flow runs is inferred from which addends you supply; there is no mode flag: * `residual` only → `{ACT(norm(x + residual)·w + b), x + residual}` * `post_residual` only → `{ACT(norm(x)·w + b) + post_residual, UNDEFINED}` * both → `{ACT(norm(x + residual)·w + b) + post_residual, x + residual}` * neither → raises (that is a plain `rms_norm`/`layer_norm`) The **second result is the PRE-norm sum**, the residual stream the next sub-layer reads. Supplying only `post_residual` forms no such sum, so that element comes back UNDEFINED: read only the first one in that flow. The activation applies to the **norm result, before**`post_residual` is added; it is the norm's epilogue, not the sum's. Gated activations (SwiGlu / GeGlu / ReGlu) narrow their input and are rejected. |
| [all](all.md) | [common]<br>fun [all](all.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`all(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false)`: the `all` operator. True where EVERY element over `dims` is nonzero (logical AND reduce). Empty `dims` reduces every dimension. Output dtype is always `Bool`. An element is nonzero exactly when its Bool cast is true: +0 and -0 are zero; a subnormal, an infinity and a NaN are nonzero. |
| [allclose](allclose.md) | [common]<br>fun [allclose](allclose.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), rtol: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0E-5, atol: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0E-8, equalNan: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`allclose(input: Tensor, other: Tensor, rtol: Double = 1e-5, atol: Double = 1e-8, equalNan: Boolean = false)`: the `allclose` operator. Whether EVERY elementwise pair is approximately equal, a reduction to one verdict. Shapes broadcast per the standard rules before the reduction. |
| [amax](amax.md) | [common]<br>fun [amax](amax.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`amax(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false)`: the `amax` operator. Maximum value of `input` over `dims`. Empty `dims` reduces every dimension. Returns VALUES (for the positions use `argmax`). |
| [amin](amin.md) | [common]<br>fun [amin](amin.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`amin(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false)`: the `amin` operator. Minimum value of `input` over `dims`. Empty `dims` reduces every dimension. Returns VALUES (for the positions use `argmin`). |
| [aminmax](aminmax.md) | [common]<br>fun [aminmax](aminmax.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`aminmax(input: Tensor, dim: Long? = null, keepdim: Boolean = false)`: the `aminmax` operator. |
| [any](any.md) | [common]<br>fun [any](any.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`any(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false)`: the `any` operator. True where ANY element over `dims` is nonzero (logical OR reduce). Empty `dims` reduces every dimension. Output dtype is always `Bool`. An element is nonzero exactly when its Bool cast is true: +0 and -0 are zero; a subnormal, an infinity and a NaN are nonzero. |
| [arange](arange.md) | [common]<br>fun [arange](arange.md)(start: [Tensor](../Tensor/index.md), end: [Tensor](../Tensor/index.md), step: [Tensor](../Tensor/index.md)? = null, dtype: [DType](../DType/index.md) = DType.INT64, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`arange(start: Tensor, end: Tensor, step: Tensor? = null, dtype: DType = DType.INT64, device: Placement? = null)`: the `arange` operator. Evenly stepped 1-D range over the half-open interval `[start, end)`. `out[i] = start + i * step`, for `ceil((end - start) / step)` elements; `end` itself is never included. Each bound is an int/float literal OR a 0-D Tensor (a tensor bound traces symbolically, never syncing to the host).<br>[common]<br>fun [arange](arange.md)(start: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), end: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), step: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, dtype: [DType](../DType/index.md) = DType.INT64, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`arange(start: Double, end: Double, step: Double = 1.0, dtype: DType = DType.INT64, device: Placement? = null)`: the number form of `arange`, `start`, `end`, `step` as scalars. |
| [argmax](argmax.md) | [common]<br>fun [argmax](argmax.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, indexDtype: [DType](../DType/index.md) = DType.INT64): [Tensor](../Tensor/index.md)<br>`argmax(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false, indexDtype: DType = DType.INT64)`: the `argmax` operator. Index of the maximum of `input` over `dims`. Empty `dims` reduces every dimension (the index is then into the flattened tensor). The index dtype is `Int64` by default; `Int32` narrows it (an Int32 index addresses a reduced extent of at most INT32_MAX elements). |
| [argmin](argmin.md) | [common]<br>fun [argmin](argmin.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, indexDtype: [DType](../DType/index.md) = DType.INT64): [Tensor](../Tensor/index.md)<br>`argmin(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false, indexDtype: DType = DType.INT64)`: the `argmin` operator. Index of the minimum of `input` over `dims`. Empty `dims` reduces every dimension (the index is then into the flattened tensor). The index dtype is `Int64` by default; `Int32` narrows it (an Int32 index addresses a reduced extent of at most INT32_MAX elements). |
| [argsort](argsort.md) | [common]<br>fun [argsort](argsort.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, descending: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, stable: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`argsort(input: Tensor, dim: Long = -1L, descending: Boolean = false, stable: Boolean = false)`: the `argsort` operator. Indices that would sort `input` along `dim` (ascending unless `descending`). |
| [asin](asin.md) | [common]<br>fun [asin](asin.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`asin(input: Tensor)`: the `asin` operator. Elementwise arcsine. Inputs outside `[-1, 1]` produce NaN. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [asinh](asinh.md) | [common]<br>fun [asinh](asinh.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`asinh(input: Tensor)`: the `asinh` operator. Elementwise inverse hyperbolic sine. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [asinhInPlace](asinhInPlace.md) | [common]<br>fun [asinhInPlace](asinhInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`asinhInPlace(self: Tensor)`: the `asinh_` operator. In-place `asinh`: writes the result through `self`; same formula, arguments, and error conditions as `asinh()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [asinInPlace](asinInPlace.md) | [common]<br>fun [asinInPlace](asinInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`asinInPlace(self: Tensor)`: the `asin_` operator. In-place `asin`: writes the result through `self`; same formula, arguments, and error conditions as `asin()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [atan](atan.md) | [common]<br>fun [atan](atan.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atan(input: Tensor)`: the `atan` operator. Elementwise arctangent. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [atan2](atan2.md) | [common]<br>fun [atan2](atan2.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atan2(input: Tensor, other: Tensor)`: the `atan2` operator. Elementwise four-quadrant arc tangent of `a/b` (the angle of the point `(b, a)`), in radians. Broadcasts and promotes as `add`. |
| [atan2InPlace](atan2InPlace.md) | [common]<br>fun [atan2InPlace](atan2InPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atan2InPlace(self: Tensor, other: Tensor)`: the `atan2_` operator. In-place `atan2`: writes the angles through `x`. Writes through `self` and returns it, so calls chain. |
| [atanh](atanh.md) | [common]<br>fun [atanh](atanh.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atanh(input: Tensor)`: the `atanh` operator. Elementwise inverse hyperbolic tangent. Inputs outside `(-1, 1)` produce NaN / ±inf. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [atanhInPlace](atanhInPlace.md) | [common]<br>fun [atanhInPlace](atanhInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atanhInPlace(self: Tensor)`: the `atanh_` operator. In-place `atanh`: writes the result through `self`; same formula, arguments, and error conditions as `atanh()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [atanInPlace](atanInPlace.md) | [common]<br>fun [atanInPlace](atanInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atanInPlace(self: Tensor)`: the `atan_` operator. In-place `atan`: writes the result through `self`; same formula, arguments, and error conditions as `atan()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [atleast1d](atleast1d.md) | [common]<br>fun [atleast1d](atleast1d.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atleast1d(input: Tensor)`: the `atleast_1d` operator. `input` with leading size-1 dims prepended until rank >= 1; a higher-rank input passes through unchanged. Returns a VIEW sharing `input`'s storage (no copy). |
| [atleast2d](atleast2d.md) | [common]<br>fun [atleast2d](atleast2d.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atleast2d(input: Tensor)`: the `atleast_2d` operator. `input` with leading size-1 dims prepended until rank >= 2 (see `atleast_1d`). Returns a view (no copy). |
| [atleast3d](atleast3d.md) | [common]<br>fun [atleast3d](atleast3d.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`atleast3d(input: Tensor)`: the `atleast_3d` operator. `input` with leading size-1 dims prepended until rank >= 3 (see `atleast_1d`). Returns a view (no copy). |
| [attention](attention.md) | [common]<br>fun [attention](attention.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), attnMask: [Tensor](../Tensor/index.md)? = null, headSink: [Tensor](../Tensor/index.md)? = null, isCausal: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, qScale: [Tensor](../Tensor/index.md)? = null, softcap: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, slidingWindow: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, smoothSoftmax: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, kScale: [Tensor](../Tensor/index.md)? = null, vScale: [Tensor](../Tensor/index.md)? = null, keptPrefix: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`attention(query: Tensor, key: Tensor, value: Tensor, attnMask: Tensor? = null, headSink: Tensor? = null, isCausal: Boolean? = null, qScale: Tensor? = null, softcap: Double? = null, slidingWindow: Long? = null, smoothSoftmax: Boolean? = null, kScale: Tensor? = null, vScale: Tensor? = null, keptPrefix: Tensor? = null)`: the `attention` operator. Dense attention with the serving riders: per-head sink, logit soft-cap, sliding window, smoothed softmax. The core is `scaled_dot_product_attention`; each rider adjusts the softmax stage: - `head_sink``[H_q]`: a per-head virtual logit folded into the softmax denominator (attention that can &quot;go nowhere&quot;). - `softcap`: logits pass through `cap * tanh(x / cap)` before the softmax. - `sliding_window`: each query attends only the last N key positions. - `smooth_softmax`: adds one to the softmax denominator. Default `false`. |
| [attentionOverCache](attentionOverCache.md) | [common]<br>fun [attentionOverCache](attentionOverCache.md)(query: [Tensor](../Tensor/index.md), cacheKey: [Tensor](../Tensor/index.md), cacheValue: [Tensor](../Tensor/index.md), kvcacheStart: [Tensor](../Tensor/index.md), cuSeqlensQ: [Tensor](../Tensor/index.md), cuSeqlensK: [Tensor](../Tensor/index.md), maxSeqlenQ: [Tensor](../Tensor/index.md)? = null, maxSeqlenK: [Tensor](../Tensor/index.md)? = null, ropeCos: [Tensor](../Tensor/index.md)? = null, ropeSin: [Tensor](../Tensor/index.md)? = null, positionIds: [Tensor](../Tensor/index.md)? = null, attnMask: [Tensor](../Tensor/index.md)? = null, isCausal: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, qScale: [Tensor](../Tensor/index.md)? = null, softcap: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, slidingWindow: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, smoothSoftmax: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, rotaryMode: [RotaryMode](../RotaryMode/index.md)? = null, numHeads: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, kvNumHeads: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, kScale: [Tensor](../Tensor/index.md)? = null, vScale: [Tensor](../Tensor/index.md)? = null, headSink: [Tensor](../Tensor/index.md)? = null, qNormGain: [Tensor](../Tensor/index.md)? = null, kNormGain: [Tensor](../Tensor/index.md)? = null, qkNormEps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, slotIds: [Tensor](../Tensor/index.md)? = null, keptPrefix: [Tensor](../Tensor/index.md)? = null, kvPositionOffset: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`attentionOverCache(query: Tensor, cacheKey: Tensor, cacheValue: Tensor, kvcacheStart: Tensor, cuSeqlensQ: Tensor, cuSeqlensK: Tensor, maxSeqlenQ: Tensor? = null, maxSeqlenK: Tensor? = null, ropeCos: Tensor? = null, ropeSin: Tensor? = null, positionIds: Tensor? = null, attnMask: Tensor? = null, isCausal: Boolean? = null, qScale: Tensor? = null, softcap: Double? = null, slidingWindow: Long? = null, smoothSoftmax: Boolean? = null, rotaryMode: RotaryMode? = null, numHeads: Long? = null, kvNumHeads: Long? = null, kScale: Tensor? = null, vScale: Tensor? = null, headSink: Tensor? = null, qNormGain: Tensor? = null, kNormGain: Tensor? = null, qkNormEps: Double? = null, slotIds: Tensor? = null, keptPrefix: Tensor? = null, kvPositionOffset: Tensor? = null)`: the `attention_over_cache` operator. Attend a KV cache WITHOUT appending to it (a read-only re-attention). q is packed varlen `[ΣS_q, H, D]` (or hidden-folded `[ΣS_q, num_heads*D]` with `num_heads` set); `cache_key`/`cache_value` are a cache another attention call already appended: continuous head-major `[max_seqs, H_kv, max_seq, D]` with a rank-1 `[B]``kvcache_start` (the layout selector; its values are not read, and q's position derives from `cu_seqlens_k`), or a paged block pool `[num_blocks, H_kv, block_size, D]` with a rank-2 `[B, max_blocks]` block table (every entry `-1` or in `[0, num_blocks)`, no block index repeated within a row; an out-of-range or repeated entry refuses `INVALID_ARGUMENT` before any read). On the continuous cache `slot_ids` (`[B]` Int32, in range, pairwise distinct) names each batch row's cache row; absent, batch row b reads cache row b. `cu_seqlens_k` is each sequence's TOTAL cached length: per-seq `[B]` or cumulative `[B+1]`. The cache is never written. When `rope_cos`/`rope_sin` are bound, rotary applies to q only (the cached keys are already rotated). Use case: a q-only module re-attending a sibling layer's cache. `head_sink` is the per-head softmax sink `[H_q]`, a virtual logit folded into the softmax denominator, the same contract as `group_query_attention_varlen`; it rides the parameter tail here. |
| [attentionVarlen](attentionVarlen.md) | [common]<br>fun [attentionVarlen](attentionVarlen.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), cuSeqlensQ: [Tensor](../Tensor/index.md), cuSeqlensK: [Tensor](../Tensor/index.md), maxSeqlenQ: [Tensor](../Tensor/index.md)? = null, maxSeqlenK: [Tensor](../Tensor/index.md)? = null, attnMask: [Tensor](../Tensor/index.md)? = null, headSink: [Tensor](../Tensor/index.md)? = null, isCausal: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, qScale: [Tensor](../Tensor/index.md)? = null, softcap: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, slidingWindow: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, smoothSoftmax: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, kScale: [Tensor](../Tensor/index.md)? = null, vScale: [Tensor](../Tensor/index.md)? = null, keptPrefix: [Tensor](../Tensor/index.md)? = null, kvPositionOffset: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`attentionVarlen(query: Tensor, key: Tensor, value: Tensor, cuSeqlensQ: Tensor, cuSeqlensK: Tensor, maxSeqlenQ: Tensor? = null, maxSeqlenK: Tensor? = null, attnMask: Tensor? = null, headSink: Tensor? = null, isCausal: Boolean? = null, qScale: Tensor? = null, softcap: Double? = null, slidingWindow: Long? = null, smoothSoftmax: Boolean? = null, kScale: Tensor? = null, vScale: Tensor? = null, keptPrefix: Tensor? = null, kvPositionOffset: Tensor? = null)`: the `attention_varlen` operator. Variable-length (packed) form of `attention`: the serving riders over token-packed ragged batches. Tensors and offsets follow `scaled_dot_product_attention_varlen`; the riders (`head_sink`, `softcap`, `sliding_window`, `smooth_softmax`) follow `attention`. |
| [avgPool](avgPool.md) | [common]<br>fun [avgPool](avgPool.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), countIncludePad: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html), divisorOverride: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?): [Tensor](../Tensor/index.md)<br>`avgPool(input: Tensor, kernelSize: LongArray, stride: LongArray, padding: LongArray, ceilMode: Boolean, countIncludePad: Boolean, divisorOverride: Long?)`: the `avg_pool` operator. Rank-generic average pooling, channels-last. `input` is `[N, D1..Dn, C]`; the window rank is read from `kernel_size`'s length. Each output element averages its window; `count_include_pad` decides whether padded positions count in the divisor, and `divisor_override` replaces the divisor outright. |
| [avgPool1d](avgPool1d.md) | [common]<br>fun [avgPool1d](avgPool1d.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, countIncludePad: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true): [Tensor](../Tensor/index.md)<br>`avgPool1d(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0), ceilMode: Boolean = false, countIncludePad: Boolean = true)`: the `avg_pool1d` operator. 1-D average pooling over `[N, L, C]` (channels-last). See `avg_pool`; `stride` empty = `kernel_size`. |
| [avgPool2d](avgPool2d.md) | [common]<br>fun [avgPool2d](avgPool2d.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, countIncludePad: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, divisorOverride: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)<br>`avgPool2d(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0, 0), ceilMode: Boolean = false, countIncludePad: Boolean = true, divisorOverride: Long? = null)`: the `avg_pool2d` operator. 2-D average pooling over `[N, H, W, C]` (channels-last). Averages each `kernel_size` window; `count_include_pad` includes the zero padding in the divisor; `divisor_override` fixes the divisor. `stride` empty = `kernel_size`. |
| [avgPool3d](avgPool3d.md) | [common]<br>fun [avgPool3d](avgPool3d.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0, 0), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, countIncludePad: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, divisorOverride: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)<br>`avgPool3d(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0, 0, 0), ceilMode: Boolean = false, countIncludePad: Boolean = true, divisorOverride: Long? = null)`: the `avg_pool3d` operator. 3-D average pooling over `[N, D, H, W, C]` (channels-last). See `avg_pool2d`; parameters extend to `{kD, kH, kW}` etc. |
| [batchNorm](batchNorm.md) | [common]<br>fun [batchNorm](batchNorm.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, runningMean: [Tensor](../Tensor/index.md)? = null, runningVar: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`batchNorm(input: Tensor, weight: Tensor? = null, bias: Tensor? = null, runningMean: Tensor? = null, runningVar: Tensor? = null, eps: Double? = null, activation: Activation? = null)`: the `batch_norm` operator. Per-channel batch normalization (inference form), channels-last. `input` is `[N, *spatial, C]`; every operand is per-channel `[C]`. The supplied `running_mean` / `running_var` ARE the statistics (inference only; no training mode, no momentum). Optional fused `activation` applies to the result. |
| [bernoulli](bernoulli.md) | [common]<br>fun [bernoulli](bernoulli.md)(probabilities: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`bernoulli(probabilities: Tensor, device: Placement? = null)`: the `bernoulli` operator. Independent Bernoulli draws from per-element success probabilities. Each output element is 1 with probability `probabilities[i]`, else 0; shape and dtype mirror `probabilities`. |
| [bernoulliInPlace](bernoulliInPlace.md) | [common]<br>fun [bernoulliInPlace](bernoulliInPlace.md)(self: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`bernoulliInPlace(self: Tensor, device: Placement? = null)`: the `bernoulli_` operator. In-place: overwrite `self`, whose values are the per-element success probabilities, with the 0/1 draws (`self[i] ~ Bernoulli(self[i])`). Writes through `self` and returns it, so calls chain. |
| [binaryCrossEntropy](binaryCrossEntropy.md) | [common]<br>fun [binaryCrossEntropy](binaryCrossEntropy.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null, reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN): [Tensor](../Tensor/index.md)<br>`binaryCrossEntropy(input: Tensor, target: Tensor, weight: Tensor? = null, reduction: Reduction = Reduction.MEAN)`: the `binary_cross_entropy` operator. Binary cross-entropy on element-wise PROBABILITIES. `input` must already be probabilities in `[0, 1]` (apply `sigmoid` first, or use `binary_cross_entropy_with_logits` for the fused, numerically safer form). `weight` re-weights each element's loss. |
| [binaryCrossEntropyWithLogits](binaryCrossEntropyWithLogits.md) | [common]<br>fun [binaryCrossEntropyWithLogits](binaryCrossEntropyWithLogits.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null, reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN, posWeight: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`binaryCrossEntropyWithLogits(input: Tensor, target: Tensor, weight: Tensor? = null, reduction: Reduction = Reduction.MEAN, posWeight: Tensor? = null)`: the `binary_cross_entropy_with_logits` operator. Binary cross-entropy on RAW LOGITS (sigmoid fused, numerically stable). Computes `binary_cross_entropy(sigmoid(input), target)` in one pass without materializing the probabilities. `pos_weight` scales the positive-class term per element (class-imbalance correction). |
| [bincount](bincount.md) | [common]<br>fun [bincount](bincount.md)(input: [Tensor](../Tensor/index.md), weights: [Tensor](../Tensor/index.md)? = null, minlength: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`bincount(input: Tensor, weights: Tensor? = null, minlength: Long = 0L)`: the `bincount` operator. Occurrence count (or weight sum) of each non-negative integer value. The output is 1-D with length `max(x) + 1`, floored at `minlength`; entry `i` counts how often `i` occurs (with `weights` bound, it sums the weights at those positions instead). |
| [bitwiseAnd](bitwiseAnd.md) | [common]<br>fun [bitwiseAnd](bitwiseAnd.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseAnd(input: Tensor, other: Tensor)`: the `bitwise_and` operator. Elementwise bitwise AND; the dtype law the whole bitwise family shares: integer and Bool dtypes only, and BOTH operands must carry ONE dtype (no promotion; a mixed pair is refused typed; a scalar `other` adopts `input`'s dtype). Shapes broadcast per the standard rules; the output carries the shared dtype. The other bitwise ops state &quot;dtype law as `bitwise_and`&quot; instead of restating this.<br>[common]<br>fun [bitwiseAnd](bitwiseAnd.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseAnd(input: Tensor, other: Double)`: the number form of `bitwise_and`, `other` as a scalar. |
| [bitwiseAndInPlace](bitwiseAndInPlace.md) | [common]<br>fun [bitwiseAndInPlace](bitwiseAndInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseAndInPlace(self: Tensor, other: Tensor)`: the `bitwise_and_` operator. In-place `bitwise_and`: writes the AND through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [bitwiseAndInPlace](bitwiseAndInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseAndInPlace(self: Tensor, other: Double)`: the number form of `bitwise_and_`, `other` as a scalar. |
| [bitwiseLeftShift](bitwiseLeftShift.md) | [common]<br>fun [bitwiseLeftShift](bitwiseLeftShift.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseLeftShift(input: Tensor, other: Tensor)`: the `bitwise_left_shift` operator. Elementwise `a << other`. Integer dtypes only (Bool refuses; a shifted Bool byte has no meaning); otherwise dtype law as `bitwise_and`. The shift is a TOTAL function: a count outside `[0, bit_width)`, negative included, yields the fully shifted-out value (zero fill), identically on every backend.<br>[common]<br>fun [bitwiseLeftShift](bitwiseLeftShift.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseLeftShift(input: Tensor, other: Double)`: the number form of `bitwise_left_shift`, `other` as a scalar. |
| [bitwiseLeftShiftInPlace](bitwiseLeftShiftInPlace.md) | [common]<br>fun [bitwiseLeftShiftInPlace](bitwiseLeftShiftInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseLeftShiftInPlace(self: Tensor, other: Tensor)`: the `bitwise_left_shift_` operator. In-place `bitwise_left_shift`: writes the shifted values through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [bitwiseLeftShiftInPlace](bitwiseLeftShiftInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseLeftShiftInPlace(self: Tensor, other: Double)`: the number form of `bitwise_left_shift_`, `other` as a scalar. |
| [bitwiseNot](bitwiseNot.md) | [common]<br>fun [bitwiseNot](bitwiseNot.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseNot(input: Tensor)`: the `bitwise_not` operator. Elementwise bitwise NOT (`~x`; logical NOT for Bool). Integer and Bool dtypes; the output keeps `input`'s dtype. |
| [bitwiseNotInPlace](bitwiseNotInPlace.md) | [common]<br>fun [bitwiseNotInPlace](bitwiseNotInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseNotInPlace(self: Tensor)`: the `bitwise_not_` operator. In-place `bitwise_not`: complements `x` in place. Writes through `self` and returns it, so calls chain. |
| [bitwiseOr](bitwiseOr.md) | [common]<br>fun [bitwiseOr](bitwiseOr.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseOr(input: Tensor, other: Tensor)`: the `bitwise_or` operator. Elementwise bitwise OR; dtype law as `bitwise_and`.<br>[common]<br>fun [bitwiseOr](bitwiseOr.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseOr(input: Tensor, other: Double)`: the number form of `bitwise_or`, `other` as a scalar. |
| [bitwiseOrInPlace](bitwiseOrInPlace.md) | [common]<br>fun [bitwiseOrInPlace](bitwiseOrInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseOrInPlace(self: Tensor, other: Tensor)`: the `bitwise_or_` operator. In-place `bitwise_or`: writes the OR through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [bitwiseOrInPlace](bitwiseOrInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseOrInPlace(self: Tensor, other: Double)`: the number form of `bitwise_or_`, `other` as a scalar. |
| [bitwiseRightShift](bitwiseRightShift.md) | [common]<br>fun [bitwiseRightShift](bitwiseRightShift.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseRightShift(input: Tensor, other: Tensor)`: the `bitwise_right_shift` operator. Elementwise `a >> other`. Integer dtypes only (Bool refuses); otherwise dtype law as `bitwise_and`. ARITHMETIC (sign-propagating) for signed dtypes, logical for unsigned; the shift is a TOTAL function; a count outside `[0, bit_width)`, negative included, yields the fully shifted-out value (sign fill 0/-1 for signed, 0 for unsigned), identically on every backend.<br>[common]<br>fun [bitwiseRightShift](bitwiseRightShift.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseRightShift(input: Tensor, other: Double)`: the number form of `bitwise_right_shift`, `other` as a scalar. |
| [bitwiseRightShiftInPlace](bitwiseRightShiftInPlace.md) | [common]<br>fun [bitwiseRightShiftInPlace](bitwiseRightShiftInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseRightShiftInPlace(self: Tensor, other: Tensor)`: the `bitwise_right_shift_` operator. In-place `bitwise_right_shift`: writes the shifted values through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [bitwiseRightShiftInPlace](bitwiseRightShiftInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseRightShiftInPlace(self: Tensor, other: Double)`: the number form of `bitwise_right_shift_`, `other` as a scalar. |
| [bitwiseXor](bitwiseXor.md) | [common]<br>fun [bitwiseXor](bitwiseXor.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseXor(input: Tensor, other: Tensor)`: the `bitwise_xor` operator. Elementwise bitwise XOR; dtype law as `bitwise_and`.<br>[common]<br>fun [bitwiseXor](bitwiseXor.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseXor(input: Tensor, other: Double)`: the number form of `bitwise_xor`, `other` as a scalar. |
| [bitwiseXorInPlace](bitwiseXorInPlace.md) | [common]<br>fun [bitwiseXorInPlace](bitwiseXorInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`bitwiseXorInPlace(self: Tensor, other: Tensor)`: the `bitwise_xor_` operator. In-place `bitwise_xor`: writes the XOR through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [bitwiseXorInPlace](bitwiseXorInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`bitwiseXorInPlace(self: Tensor, other: Double)`: the number form of `bitwise_xor_`, `other` as a scalar. |
| [bmm](bmm.md) | [common]<br>fun [bmm](bmm.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`bmm(input: Tensor, other: Tensor, bias: Tensor? = null, activation: Activation? = null)`: the `bmm` operator. Batched matrix multiply of two rank-3 tensors, with an optional fused bias and activation epilogue. `a [B, M, K] x b [B, K, N] -> [B, M, N]`, one independent matmul per batch index. |
| [broadcastTensors](broadcastTensors.md) | [common]<br>fun [broadcastTensors](broadcastTensors.md)(tensors: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`broadcastTensors(tensors: List<Tensor>)`: the `broadcast_tensors` operator. Broadcast every input to their common shape: dims are right-aligned, size-1 dims stretch, anything else must match. Returns VIEWS; each output shares its input's storage, with the stretched positions aliasing ONE stored element; treat the results as read-only (or `contiguous` one to materialize it). |
| [broadcastTo](broadcastTo.md) | [common]<br>fun [broadcastTo](broadcastTo.md)(input: [Tensor](../Tensor/index.md), shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`broadcastTo(input: Tensor, shape: LongArray)`: the `broadcast_to` operator. Alias of `expand` under the NumPy name; same broadcasting rules, same view semantics. |
| [bucketize](bucketize.md) | [common]<br>fun [bucketize](bucketize.md)(input: [Tensor](../Tensor/index.md), boundaries: [Tensor](../Tensor/index.md), outInt32: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, right: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`bucketize(input: Tensor, boundaries: Tensor, outInt32: Boolean = false, right: Boolean = false)`: the `bucketize` operator. Bucket index of each `input` element against a sorted 1-D `boundaries`. With `right == false` (default) an element in `[b[i-1], b[i])` maps to bucket `i`; `right == true` uses `(b[i-1], b[i]]`. Output shape mirrors `input`. |
| [cast](cast.md) | [common]<br>fun [cast](cast.md)(input: [Tensor](../Tensor/index.md), target: [DType](../DType/index.md), forceCopy: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`cast(input: Tensor, target: DType, forceCopy: Boolean = false)`: the `cast` operator. Same-device dtype conversion. Converts per element to `target`. When `input` already has `target`'s dtype and `force_copy` is `false`, the input passes through unchanged (no new storage); set `force_copy = true` to guarantee an owning copy. |
| [castLike](castLike.md) | [common]<br>fun [castLike](castLike.md)(input: [Tensor](../Tensor/index.md), reference: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`castLike(input: Tensor, reference: Tensor)`: the `cast_like` operator. `cast` to another tensor's dtype: `cast(x, reference.dtype())`. |
| [causalConvUpdate](causalConvUpdate.md) | [common]<br>fun [causalConvUpdate](causalConvUpdate.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)?, state: [Tensor](../Tensor/index.md), seqLens: [Tensor](../Tensor/index.md)? = null, slotIds: [Tensor](../Tensor/index.md)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`causalConvUpdate(input: Tensor, weight: Tensor, bias: Tensor?, state: Tensor, seqLens: Tensor? = null, slotIds: Tensor? = null, activation: Activation? = null)`: the `causal_conv_update` operator. Depthwise causal short-conv serving step over a rolling per-sequence window. `x [B, S, dim]`; `weight [dim, W]` (oldest tap first); optional `bias [dim]`; `state [B, dim, W]` (same dtype as x) is read AND updated IN PLACE in both modes: S 1 runs the prefill conv with each row's left context seeded from its window (a zero window is a fresh sequence, bit for bit; an S-token call over committed state equals S single-token steps exactly) and re-captures the window as the last W of (old window ++ the row's valid inputs; zero valid tokens leave it unchanged); S == 1 shift-inserts the new token and emits the tap dot. `seq_lens` (`[B]` Int32) bounds ragged prefill rows (their padding is zero post-activation). `activation` applies to the returned `out [B, S, dim]` only (Silu fuses in-kernel); the stored window stays pre-activation raw. `slot_ids` (`[B]` Int32, device-resident) addresses `state` as a SLAB `[num_slots, dim, W]`: batch row `b` reads/updates slab row `slot_ids[b]` in place (ids in range and DISTINCT per call, the caller's contract); absent keeps state row `b`. |
| [cdist](cdist.md) | [common]<br>fun [cdist](cdist.md)(x1: [Tensor](../Tensor/index.md), x2: [Tensor](../Tensor/index.md), p: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 2.0): [Tensor](../Tensor/index.md)<br>`cdist(x1: Tensor, x2: Tensor, p: Double = 2.0)`: the `cdist` operator. Pairwise L_p distance between every ROW pair of two matrices. `(B?, M, K) x (B?, N, K) -> (B?, M, N)`; the optional leading batch dims broadcast. |
| [ceil](ceil.md) | [common]<br>fun [ceil](ceil.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`ceil(input: Tensor)`: the `ceil` operator. Elementwise ceiling: the smallest integer not below `input`. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [ceilInPlace](ceilInPlace.md) | [common]<br>fun [ceilInPlace](ceilInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`ceilInPlace(self: Tensor)`: the `ceil_` operator. In-place `ceil`: writes the result through `self`; same formula, arguments, and error conditions as `ceil()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [celu](celu.md) | [common]<br>fun [celu](celu.md)(input: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)<br>`celu(input: Tensor, alpha: Double = 1.0)`: the `celu` operator. Continuously differentiable exponential linear unit. |
| [celuInPlace](celuInPlace.md) | [common]<br>fun [celuInPlace](celuInPlace.md)(self: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)<br>`celuInPlace(self: Tensor, alpha: Double = 1.0)`: the `celu_` operator. In-place `celu`: writes the result through `self`; same formula, arguments, and error conditions as `celu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [chunk](chunk.md) | [common]<br>fun [chunk](chunk.md)(input: [Tensor](../Tensor/index.md), numChunks: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`chunk(input: Tensor, numChunks: Long, dim: Long = 0L)`: the `chunk` operator. Split along `dim` into `num_chunks` near-equal parts (the last may be shorter). Returns VIEWS sharing the source's storage (one call, no copy); prefer it over repeated `narrow`s. |
| [circularPad](circularPad.md) | [common]<br>fun [circularPad](circularPad.md)(input: [Tensor](../Tensor/index.md), pad: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`circularPad(input: Tensor, pad: LongArray)`: the `circular_pad` operator. `pad` in wrap-around mode: the padding continues from the opposite edge. Same `(lo, hi)` pair layout as `constant_pad`. Copies. |
| [clamp](clamp.md) | [common]<br>fun [clamp](clamp.md)(input: [Tensor](../Tensor/index.md), min: [Tensor](../Tensor/index.md)? = null, max: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`clamp(input: Tensor, min: Tensor? = null, max: Tensor? = null)`: the `clamp` operator. Clamp `input` into min, max; an empty bound leaves that side unbounded. |
| [clampInPlace](clampInPlace.md) | [common]<br>fun [clampInPlace](clampInPlace.md)(self: [Tensor](../Tensor/index.md), min: [Tensor](../Tensor/index.md)? = null, max: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`clampInPlace(self: Tensor, min: Tensor? = null, max: Tensor? = null)`: the `clamp_` operator. In-place `clamp`: writes the result through `self`; same formula, arguments, and error conditions as `clamp()`. Either bound may be absent (`std::nullopt`), a one-sided clamp; tensor bounds broadcast against `self`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [clampMax](clampMax.md) | [common]<br>fun [clampMax](clampMax.md)(input: [Tensor](../Tensor/index.md), max: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`clampMax(input: Tensor, max: Tensor)`: the `clamp_max` operator. Elementwise upper bound. `max` is a scalar or a tensor broadcast against `input` (numpy rules).<br>[common]<br>fun [clampMax](clampMax.md)(input: [Tensor](../Tensor/index.md), max: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`clampMax(input: Tensor, max: Double)`: the number form of `clamp_max`, `max` as a scalar. |
| [clampMaxInPlace](clampMaxInPlace.md) | [common]<br>fun [clampMaxInPlace](clampMaxInPlace.md)(self: [Tensor](../Tensor/index.md), max: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`clampMaxInPlace(self: Tensor, max: Tensor)`: the `clamp_max_` operator. In-place `clamp_max`: writes the result through `self`; same formula, arguments, and error conditions as `clamp_max()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [clampMaxInPlace](clampMaxInPlace.md)(self: [Tensor](../Tensor/index.md), max: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`clampMaxInPlace(self: Tensor, max: Double)`: the number form of `clamp_max_`, `max` as a scalar. |
| [clampMin](clampMin.md) | [common]<br>fun [clampMin](clampMin.md)(input: [Tensor](../Tensor/index.md), min: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`clampMin(input: Tensor, min: Tensor)`: the `clamp_min` operator. Elementwise lower bound. `min` is a scalar or a tensor broadcast against `input` (numpy rules).<br>[common]<br>fun [clampMin](clampMin.md)(input: [Tensor](../Tensor/index.md), min: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`clampMin(input: Tensor, min: Double)`: the number form of `clamp_min`, `min` as a scalar. |
| [clampMinInPlace](clampMinInPlace.md) | [common]<br>fun [clampMinInPlace](clampMinInPlace.md)(self: [Tensor](../Tensor/index.md), min: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`clampMinInPlace(self: Tensor, min: Tensor)`: the `clamp_min_` operator. In-place `clamp_min`: writes the result through `self`; same formula, arguments, and error conditions as `clamp_min()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [clampMinInPlace](clampMinInPlace.md)(self: [Tensor](../Tensor/index.md), min: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`clampMinInPlace(self: Tensor, min: Double)`: the number form of `clamp_min_`, `min` as a scalar. |
| [clone](clone.md) | [common]<br>fun [clone](clone.md)(src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`clone(src: Tensor)`: the `clone` operator. Deep copy on the same device: fresh storage, identical shape, dtype, and values. Equivalent to `copy(src)` with the defaults. |
| [concat](concat.md) | [common]<br>fun [concat](concat.md)(tensors: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;, dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`concat(tensors: List<Tensor>, dim: Long = 0L, activation: Activation = Activation.IDENTITY)`: the `concat` operator. Join tensors along an EXISTING dim: all inputs share rank and off-dim extents; the `dim` extents add up. Copies into fresh storage. The optional `activation` fuses an elementwise epilogue into the single copy pass (`act(concat(...))`): it requires a float output dtype, every input already AT that dtype, and a non-gated kind; anything else raises. `Activation::Identity` (the default) is the plain join. |
| [constantPad](constantPad.md) | [common]<br>fun [constantPad](constantPad.md)(input: [Tensor](../Tensor/index.md), pad: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), value: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`constantPad(input: Tensor, pad: LongArray, value: Tensor? = null)`: the `constant_pad` operator. `pad` with a constant fill. Pads each axis by interleaved `(lo, hi)` pairs in layout order: pair `i` pads axis `i`; fewer pairs than the rank pads only the leading axes; a negative width crops that side. Widths are literals or 0-D integer Tensors. Copies. |
| [contiguous](contiguous.md) | [common]<br>fun [contiguous](contiguous.md)(input: [Tensor](../Tensor/index.md), forceCopy: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`contiguous(input: Tensor, forceCopy: Boolean = false)`: the `contiguous` operator. Packs the tensor into row-major contiguous storage. A no-op passthrough (no copy, same storage) when the input is already contiguous and `force_copy` is `false`. Kernels stride natively; call this only when YOUR host-side consumption needs dense memory, never &quot;to be safe&quot; before an op. |
| [conv](conv.md) | [common]<br>fun [conv](conv.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)?, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), mode: [PadMode](../PadMode/index.md) = PadMode.CONSTANT, value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`conv(input: Tensor, weight: Tensor, bias: Tensor?, stride: LongArray, padding: LongArray, dilation: LongArray, groups: Long, mode: PadMode = PadMode.CONSTANT, value: Double? = null, activation: Activation = Activation.IDENTITY)`: the `conv` operator. Convolution family, channels-last (`[N, spatial..., C]`), weights output-channel-first (`[O, spatial..., Ig]`). `stride` / `dilation` / `output_padding` are PER-AXIS window attributes everywhere: length 0 (defaulted), 1 (broadcast), or spatial-rank. `padding` carries TWO conventions; read the one that matches the op: - `conv` / `conv_transpose*`: interleaved `(lo, hi)` PAIRS in axis order (even length; pair `i` pads spatial axis `i`); asymmetric pads spell directly, e.g. 1-D `{2, 3}` = lo 2, hi 3. - `conv1d/2d/3d`: SYMMETRIC per-axis widths (length 0/1/spatial-rank), e.g. 1-D `{2}` = lo 2, hi 2; an asymmetric pad needs `conv` or an explicit `ops::pad` first. The inline defaults below encode the split: `conv1d` pads `{0}`, `conv_transpose1d` pads `{0, 0}`. |
| [conv1d](conv1d.md) | [common]<br>fun [conv1d](conv1d.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`conv1d(input: Tensor, weight: Tensor, bias: Tensor? = null, stride: LongArray = longArrayOf(1), padding: LongArray = longArrayOf(0), dilation: LongArray = longArrayOf(1), groups: Long = 1L, activation: Activation = Activation.IDENTITY)`: the `conv1d` operator. 1-D convolution over a channels-last input. Layout is channels-last: input `[N, spatial.., C]`, weight OHWI `[O, K.., C/groups]` (output channels first, kernel dims, then the per-group input channels), optional bias `[O]`. |
| [conv2d](conv2d.md) | [common]<br>fun [conv2d](conv2d.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`conv2d(input: Tensor, weight: Tensor, bias: Tensor? = null, stride: LongArray = longArrayOf(1, 1), padding: LongArray = longArrayOf(0, 0), dilation: LongArray = longArrayOf(1, 1), groups: Long = 1L, activation: Activation = Activation.IDENTITY)`: the `conv2d` operator. 2-D convolution over a channels-last input. Layout is channels-last: input `[N, spatial.., C]`, weight OHWI `[O, K.., C/groups]` (output channels first, kernel dims, then the per-group input channels), optional bias `[O]`. |
| [conv3d](conv3d.md) | [common]<br>fun [conv3d](conv3d.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1, 1), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0, 0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1, 1), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`conv3d(input: Tensor, weight: Tensor, bias: Tensor? = null, stride: LongArray = longArrayOf(1, 1, 1), padding: LongArray = longArrayOf(0, 0, 0), dilation: LongArray = longArrayOf(1, 1, 1), groups: Long = 1L, activation: Activation = Activation.IDENTITY)`: the `conv3d` operator. 3-D convolution over a channels-last input. Layout is channels-last: input `[N, spatial.., C]`, weight OHWI `[O, K.., C/groups]` (output channels first, kernel dims, then the per-group input channels), optional bias `[O]`. |
| [convTranspose](convTranspose.md) | [common]<br>fun [convTranspose](convTranspose.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)?, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), outputPadding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`convTranspose(input: Tensor, weight: Tensor, bias: Tensor?, stride: LongArray, padding: LongArray, outputPadding: LongArray, groups: Long, dilation: LongArray, activation: Activation = Activation.IDENTITY)`: the `conv_transpose` operator. Rank-polymorphic (1-D/2-D/3-D) transposed (fractionally-strided) convolution (learnable upsampling). Layout is channels-last; the WEIGHT is the transpose-flip of `conv`'s: input-channel-first `[C_in, K.., O/groups]`; `C_in == weight[0]` and `C_out == weight[-1] * groups` (the cuDNN-BackwardData / ONNX convention, NOT conv's OHWI). `padding` is per-side: two entries (lo, hi) per spatial dim. `output_padding` grows only the output's high side. All geometry spans are explicit here; the `conv_transpose1d/2d/3d` wrappers below carry the per-rank defaults. |
| [convTranspose1d](convTranspose1d.md) | [common]<br>fun [convTranspose1d](convTranspose1d.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0), outputPadding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`convTranspose1d(input: Tensor, weight: Tensor, bias: Tensor? = null, stride: LongArray = longArrayOf(1), padding: LongArray = longArrayOf(0, 0), outputPadding: LongArray = longArrayOf(0), groups: Long = 1L, dilation: LongArray = longArrayOf(1), activation: Activation = Activation.IDENTITY)`: the `conv_transpose1d` operator. 1-D transposed (fractionally-strided) convolution (learnable upsampling). Layout is channels-last; the WEIGHT is the transpose-flip of `conv`'s: input-channel-first `[C_in, K.., O/groups]`; `C_in == weight[0]` and `C_out == weight[-1] * groups` (the cuDNN-BackwardData / ONNX convention, NOT conv's OHWI). `padding` is per-side: two entries (lo, hi) per spatial dim. `output_padding` grows only the output's high side. |
| [convTranspose2d](convTranspose2d.md) | [common]<br>fun [convTranspose2d](convTranspose2d.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0, 0, 0), outputPadding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`convTranspose2d(input: Tensor, weight: Tensor, bias: Tensor? = null, stride: LongArray = longArrayOf(1, 1), padding: LongArray = longArrayOf(0, 0, 0, 0), outputPadding: LongArray = longArrayOf(0, 0), groups: Long = 1L, dilation: LongArray = longArrayOf(1, 1), activation: Activation = Activation.IDENTITY)`: the `conv_transpose2d` operator. 2-D transposed (fractionally-strided) convolution (learnable upsampling). Layout is channels-last; the WEIGHT is the transpose-flip of `conv`'s: input-channel-first `[C_in, K.., O/groups]`; `C_in == weight[0]` and `C_out == weight[-1] * groups` (the cuDNN-BackwardData / ONNX convention, NOT conv's OHWI). `padding` is per-side: two entries (lo, hi) per spatial dim. `output_padding` grows only the output's high side. |
| [convTranspose3d](convTranspose3d.md) | [common]<br>fun [convTranspose3d](convTranspose3d.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1, 1), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0, 0, 0, 0, 0), outputPadding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0, 0), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1, 1), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`convTranspose3d(input: Tensor, weight: Tensor, bias: Tensor? = null, stride: LongArray = longArrayOf(1, 1, 1), padding: LongArray = longArrayOf(0, 0, 0, 0, 0, 0), outputPadding: LongArray = longArrayOf(0, 0, 0), groups: Long = 1L, dilation: LongArray = longArrayOf(1, 1, 1), activation: Activation = Activation.IDENTITY)`: the `conv_transpose3d` operator. 3-D transposed (fractionally-strided) convolution (learnable upsampling). Layout is channels-last; the WEIGHT is the transpose-flip of `conv`'s: input-channel-first `[C_in, K.., O/groups]`; `C_in == weight[0]` and `C_out == weight[-1] * groups` (the cuDNN-BackwardData / ONNX convention, NOT conv's OHWI). `padding` is per-side: two entries (lo, hi) per spatial dim. `output_padding` grows only the output's high side. |
| [copy](copy.md) | [common]<br>fun [copy](copy.md)(src: [Tensor](../Tensor/index.md), target: [Placement](../Placement/index.md)? = null, forceCopy: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true): [Tensor](../Tensor/index.md)<br>`copy(src: Tensor, target: Placement? = null, forceCopy: Boolean = true)`: the `copy` operator. Copies a tensor, optionally to another device or stream. With the default `force_copy = true` the result always owns fresh storage; with `force_copy = false` a same-device copy may pass the input through. `target` absent = `src`'s own stream. |
| [copyInPlace](copyInPlace.md) | [common]<br>fun [copyInPlace](copyInPlace.md)(self: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md), target: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`copyInPlace(self: Tensor, src: Tensor, target: Placement? = null)`: the `copy_` operator. Copies `src` INTO `self`'s existing storage, converting per element to `self`'s dtype in the same single pass (never `cast` first; the copy IS the cast). Shapes must match after broadcasting `src`. Raises `ClikaRT::Error` where the shapes/dtypes cannot be served; returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [copyInto](copyInto.md) | [common]<br>fun [copyInto](copyInto.md)(self: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md), target: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`copyInto(self: Tensor, src: Tensor, target: Placement? = null)`: the `copy_into` operator. Write `src` into the caller-supplied `out` buffer (the destination-first spelling of the in-place copy; bind a persistent buffer once, write it every step with no allocation). Dtype conversion is interleaved with the write; a cross-device `src` is transferred first. Returns `out`. Writes through `self` and returns it, so calls chain. |
| [copysign](copysign.md) | [common]<br>fun [copysign](copysign.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`copysign(input: Tensor, other: Tensor)`: the `copysign` operator. Elementwise `|a|` carrying the sign of `other`. Broadcasts and promotes as `add`.<br>[common]<br>fun [copysign](copysign.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`copysign(input: Tensor, other: Double)`: the number form of `copysign`, `other` as a scalar. |
| [copysignInPlace](copysignInPlace.md) | [common]<br>fun [copysignInPlace](copysignInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`copysignInPlace(self: Tensor, other: Tensor)`: the `copysign_` operator. In-place `copysign`: writes the re-signed magnitudes through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [copysignInPlace](copysignInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`copysignInPlace(self: Tensor, other: Double)`: the number form of `copysign_`, `other` as a scalar. |
| [copyToCpu](copyToCpu.md) | [common]<br>fun [copyToCpu](copyToCpu.md)(src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`copyToCpu(src: Tensor)`: the `copy_to_cpu` operator. Materializes a host-resident copy of the tensor (device-to-host transfer; an owning CPU tensor even when `src` is already on the CPU). |
| [cos](cos.md) | [common]<br>fun [cos](cos.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`cos(input: Tensor)`: the `cos` operator. Elementwise cosine. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [cosh](cosh.md) | [common]<br>fun [cosh](cosh.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`cosh(input: Tensor)`: the `cosh` operator. Elementwise hyperbolic cosine. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [coshInPlace](coshInPlace.md) | [common]<br>fun [coshInPlace](coshInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`coshInPlace(self: Tensor)`: the `cosh_` operator. In-place `cosh`: writes the result through `self`; same formula, arguments, and error conditions as `cosh()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [cosineSimilarity](cosineSimilarity.md) | [common]<br>fun [cosineSimilarity](cosineSimilarity.md)(x1: [Tensor](../Tensor/index.md), x2: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`cosineSimilarity(x1: Tensor, x2: Tensor, dim: Long = 1L, eps: Double? = null)`: the `cosine_similarity` operator. Cosine similarity along `dim`. |
| [cosInPlace](cosInPlace.md) | [common]<br>fun [cosInPlace](cosInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`cosInPlace(self: Tensor)`: the `cos_` operator. In-place `cos`: writes the result through `self`; same formula, arguments, and error conditions as `cos()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [countNonzero](countNonzero.md) | [common]<br>fun [countNonzero](countNonzero.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)<br>`countNonzero(input: Tensor, dims: LongArray = longArrayOf())`: the `count_nonzero` operator. Number of nonzero elements over `dims`. Empty `dims` counts across the whole tensor. Output dtype is always `Int64`. An element is nonzero exactly when its Bool cast is true: +0 and -0 are zero; a subnormal, an infinity and a NaN are nonzero. |
| [cross](cross.md) | [common]<br>fun [cross](cross.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)<br>`cross(input: Tensor, other: Tensor, dim: Long? = null)`: the `cross` operator. 3-vector cross product along `dim`. Both operands share one shape; the `dim` axis (default: the LAST axis) must have size 3. The output mirrors the input shape. |
| [crossEntropy](crossEntropy.md) | [common]<br>fun [crossEntropy](crossEntropy.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null, ignoreIndex: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN): [Tensor](../Tensor/index.md)<br>`crossEntropy(input: Tensor, target: Tensor, weight: Tensor? = null, ignoreIndex: Long? = null, reduction: Reduction = Reduction.MEAN)`: the `cross_entropy` operator. Cross-entropy loss over class LOGITS; the class dim is LAST. Equivalent to `log_softmax` over the class axis followed by negative-log-likelihood: |
| [cummax](cummax.md) | [common]<br>fun [cummax](cummax.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`cummax(input: Tensor, dim: Long)`: the `cummax` operator. |
| [cummin](cummin.md) | [common]<br>fun [cummin](cummin.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`cummin(input: Tensor, dim: Long)`: the `cummin` operator. |
| [cumprod](cumprod.md) | [common]<br>fun [cumprod](cumprod.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`cumprod(input: Tensor, dim: Long, dtype: DType = DType.UNDEFINED)`: the `cumprod` operator. Cumulative product along `dim` (inclusive scan). |
| [cumprodInPlace](cumprodInPlace.md) | [common]<br>fun [cumprodInPlace](cumprodInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`cumprodInPlace(self: Tensor, dim: Long, dtype: DType = DType.UNDEFINED)`: the `cumprod_` operator. In-place `cumprod`: rewrites `self` with its inclusive prefix products along `dim` and returns it under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [cumsum](cumsum.md) | [common]<br>fun [cumsum](cumsum.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`cumsum(input: Tensor, dim: Long, dtype: DType = DType.UNDEFINED)`: the `cumsum` operator. Cumulative sum along `dim` (inclusive scan). Output mirrors `input`'s shape; `dtype` widens the accumulation/output when set (`Undefined` keeps `input`'s dtype). |
| [cumsumInPlace](cumsumInPlace.md) | [common]<br>fun [cumsumInPlace](cumsumInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`cumsumInPlace(self: Tensor, dim: Long, dtype: DType = DType.UNDEFINED)`: the `cumsum_` operator. In-place `cumsum`: rewrites `self` with its inclusive prefix sums along `dim` and returns it under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [deformConv](deformConv.md) | [common]<br>fun [deformConv](deformConv.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), offset: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, offsetGroups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`deformConv(input: Tensor, weight: Tensor, offset: Tensor, mask: Tensor? = null, bias: Tensor? = null, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(), dilation: LongArray = longArrayOf(), groups: Long = 1L, offsetGroups: Long = 1L, activation: Activation = Activation.IDENTITY)`: the `deform_conv` operator. Deformable convolution, 1-D/2-D/3-D (rank derives from `input`), channels-last: `x [N, D1..Dr, C]`, `weight [O, K1..Kr, C/groups]` (OHWI), `offset [N, out-spatial..., offset_groups·∏K·r]`, `mask [N, out-spatial..., offset_groups·∏K]` (absent ⇒ unmodulated), `bias [O]`; returns `[N, out-spatial..., O]` at `input`'s dtype. Each kernel tap samples at `out·stride − pad_lo + tap·dilation + Δ` (pixel units, bilinear; out-of-bounds reads 0); the offset channel for (group `g`, tap `t`, axis `d`) is `(g·∏K + t)·r + d` with taps row-major over the kernel and axes in layout order (2-D: Δh then Δw). `padding` is interleaved `(lo, hi)` pairs over the spatial axes; `stride`/`dilation` broadcast per spatial axis (empty ⇒ 1). All floating inputs must share `input`'s dtype (f32/f64/f16/bf16; no silent promotion); `activation` is a fused elementwise epilogue applied after bias. |
| [deg2rad](deg2rad.md) | [common]<br>fun [deg2rad](deg2rad.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`deg2rad(input: Tensor)`: the `deg2rad` operator. Converts degrees to radians elementwise: . |
| [deg2radInPlace](deg2radInPlace.md) | [common]<br>fun [deg2radInPlace](deg2radInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`deg2radInPlace(self: Tensor)`: the `deg2rad_` operator. In-place `deg2rad`: writes the radians through `x`. Writes through `self` and returns it, so calls chain. |
| [diag](diag.md) | [common]<br>fun [diag](diag.md)(input: [Tensor](../Tensor/index.md), diagonal: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`diag(input: Tensor, diagonal: Long = 0L)`: the `diag` operator. Rank-1 <-> rank-2 diagonal converter. A vector of length `L` becomes an `(L + |diagonal|) x (L + |diagonal|)` matrix carrying it on the chosen diagonal (zeros elsewhere); a matrix input reads the chosen diagonal back out as a vector. `diagonal`: 0 = main, +k above, -k below. Copies. |
| [diagEmbed](diagEmbed.md) | [common]<br>fun [diagEmbed](diagEmbed.md)(input: [Tensor](../Tensor/index.md), offset: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, dim1: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -2L, dim2: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L): [Tensor](../Tensor/index.md)<br>`diagEmbed(input: Tensor, offset: Long = 0L, dim1: Long = -2L, dim2: Long = -1L)`: the `diag_embed` operator. Embed the LAST dim along the diagonal of a fresh `(dim1, dim2)` plane: output rank = input rank + 1, both new dims sized `last + |offset|`, the inverse of `diagonal`. Defaults place the plane at the trailing two dims. Copies. |
| [diagonal](diagonal.md) | [common]<br>fun [diagonal](diagonal.md)(input: [Tensor](../Tensor/index.md), offset: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, dim1: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, dim2: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1): [Tensor](../Tensor/index.md)<br>`diagonal(input: Tensor, offset: Long = 0L, dim1: Long = 0L, dim2: Long = 1L)`: the `diagonal` operator. Extract the `offset`-th diagonal between `dim1` and `dim2`: the two source dims are removed and a trailing dim of the diagonal's length is appended (rank - 1 total). Copies into fresh storage (deliberately not a view). |
| [diff](diff.md) | [common]<br>fun [diff](diff.md)(input: [Tensor](../Tensor/index.md), n: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, prepend: [Tensor](../Tensor/index.md)? = null, append: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`diff(input: Tensor, n: Long = 1L, dim: Long = -1L, prepend: Tensor? = null, append: Tensor? = null)`: the `diff` operator. n-th order finite difference along `dim`. Each application shortens the axis by one, so the output's `dim` extent is `size(dim) - n`. `prepend` / `append` are concatenated onto the axis before differencing (they must match `input`'s shape outside `dim`). |
| [div](div.md) | [common]<br>fun [div](div.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), roundingMode: [RoundingMode](../RoundingMode/index.md) = RoundingMode.NONE, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`div(input: Tensor, other: Tensor, roundingMode: RoundingMode = RoundingMode.NONE, activation: Activation = Activation.IDENTITY)`: the `div` operator. Divides `input` by `other` elementwise, with an optional quotient rounding. Broadcasts and promotes as `add`.<br>[common]<br>fun [div](div.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), roundingMode: [RoundingMode](../RoundingMode/index.md) = RoundingMode.NONE, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`div(input: Tensor, other: Double, roundingMode: RoundingMode = RoundingMode.NONE, activation: Activation = Activation.IDENTITY)`: the number form of `div`, `other` as a scalar.<br>[common]<br>fun [div](div.md)(input: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), other: [Tensor](../Tensor/index.md), roundingMode: [RoundingMode](../RoundingMode/index.md) = RoundingMode.NONE, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`div(input: Double, other: Tensor, roundingMode: RoundingMode = RoundingMode.NONE, activation: Activation = Activation.IDENTITY)`: the `div` operator. Scalar-LHS `a / b`. `input` keeps its kind (see `Scalar`). The parameter set mirrors the tensor-first form: `rounding_mode` picks true/trunc/floor division, `activation` applies to the result. |
| [divInPlace](divInPlace.md) | [common]<br>fun [divInPlace](divInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), roundingMode: [RoundingMode](../RoundingMode/index.md) = RoundingMode.NONE, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`divInPlace(self: Tensor, other: Tensor, roundingMode: RoundingMode = RoundingMode.NONE, activation: Activation = Activation.IDENTITY)`: the `div_` operator. In-place `div`: writes the (optionally rounded) quotient through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [divInPlace](divInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), roundingMode: [RoundingMode](../RoundingMode/index.md) = RoundingMode.NONE, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`divInPlace(self: Tensor, other: Double, roundingMode: RoundingMode = RoundingMode.NONE, activation: Activation = Activation.IDENTITY)`: the number form of `div_`, `other` as a scalar. |
| [dot](dot.md) | [common]<br>fun [dot](dot.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`dot(input: Tensor, other: Tensor)`: the `dot` operator. Inner product of two 1-D tensors. Higher-rank inputs are rejected; use `matmul` (or `inner`) for batched contractions. |
| [dynamicQuantize](dynamicQuantize.md) | [common]<br>fun [dynamicQuantize](dynamicQuantize.md)(input: [Tensor](../Tensor/index.md)): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`dynamicQuantize(input: Tensor)`: the `dynamic_quantize` operator. Fused dynamic quantization: encode float `input` to uint8 affine codes with the scale and zero point derived from `input`'s own runtime range. |
| [einsum](einsum.md) | [common]<br>fun [einsum](einsum.md)(equation: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), operands: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;): [Tensor](../Tensor/index.md)<br>`einsum(equation: String, operands: List<Tensor>)`: the `einsum` operator. Einstein-summation contraction from a notation string. `equation` names each operand's axes and (after `->`) the output axes; omitting `->` keeps the once-appearing labels in alphabetical order. One- and two-operand equations are served: one operand reduces and permutes; two operands contract through a single batched matmul. |
| [elu](elu.md) | [common]<br>fun [elu](elu.md)(input: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, inputScale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)<br>`elu(input: Tensor, alpha: Double = 1.0, scale: Double = 1.0, inputScale: Double = 1.0)`: the `elu` operator. Exponential linear unit. Elementwise; `input_scale` feeds only the exponential's argument. |
| [eluInPlace](eluInPlace.md) | [common]<br>fun [eluInPlace](eluInPlace.md)(self: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, inputScale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)<br>`eluInPlace(self: Tensor, alpha: Double = 1.0, scale: Double = 1.0, inputScale: Double = 1.0)`: the `elu_` operator. In-place `elu`: writes the result through `self`; same formula, arguments, and error conditions as `elu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [embedding](embedding.md) | [common]<br>fun [embedding](embedding.md)(indices: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`embedding(indices: Tensor, weight: Tensor, bias: Tensor? = null, activation: Activation? = null)`: the `embedding` operator. Embedding lookup: gathers rows of `weight` by `indices`, with an optional bias + activation epilogue. |
| [empty](empty.md) | [common]<br>fun [empty](empty.md)(shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dtype: [DType](../DType/index.md), device: [Placement](../Placement/index.md)? = null, pinnedFor: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`empty(shape: LongArray, dtype: DType, device: Placement? = null, pinnedFor: Placement? = null)`: the `empty` operator. Uninitialized tensor of the given shape; the contents are whatever the allocator hands back; write every element before reading any. Each `shape` extent is an int literal OR a 0-D integer Tensor (a tensor extent traces symbolically, never syncing to the host). |
| [emptyLike](emptyLike.md) | [common]<br>fun [emptyLike](emptyLike.md)(reference: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`emptyLike(reference: Tensor, device: Placement? = null)`: the `empty_like` operator. Uninitialized tensor with `reference`'s shape and dtype. |
| [emptyStrided](emptyStrided.md) | [common]<br>fun [emptyStrided](emptyStrided.md)(size: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dtype: [DType](../DType/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`emptyStrided(size: LongArray, stride: LongArray, dtype: DType, device: Placement? = null)`: the `empty_strided` operator. Uninitialized tensor with caller-chosen sizes AND strides (element units). The storage is sized to the strided footprint. Extents and strides are host integers (no tensor-valued entries on this factory). |
| [eq](eq.md) | [common]<br>fun [eq](eq.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`eq(input: Tensor, other: Tensor)`: the `eq` operator. Elementwise equality `a == other`, the output contract the whole comparison family shares: the result is a `Bool` tensor at the broadcast shape (operands promote to their dominant dtype before the compare). A scalar `other` compares against every element. The other comparisons state &quot;output as `eq`&quot; instead of restating this.<br>[common]<br>fun [eq](eq.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`eq(input: Tensor, other: Double)`: the number form of `eq`, `other` as a scalar. |
| [eqInPlace](eqInPlace.md) | [common]<br>fun [eqInPlace](eqInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`eqInPlace(self: Tensor, other: Tensor)`: the `eq_` operator. In-place `eq`: writes the comparison result through `x` (`x` keeps its own dtype; true/false land as one/zero). Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [eqInPlace](eqInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`eqInPlace(self: Tensor, other: Double)`: the number form of `eq_`, `other` as a scalar. |
| [erf](erf.md) | [common]<br>fun [erf](erf.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`erf(input: Tensor)`: the `erf` operator. Elementwise Gauss error function. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [erfc](erfc.md) | [common]<br>fun [erfc](erfc.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`erfc(input: Tensor)`: the `erfc` operator. Elementwise complementary error function. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [erfcInPlace](erfcInPlace.md) | [common]<br>fun [erfcInPlace](erfcInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`erfcInPlace(self: Tensor)`: the `erfc_` operator. In-place `erfc`: writes the result through `self`; same formula, arguments, and error conditions as `erfc()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [erfInPlace](erfInPlace.md) | [common]<br>fun [erfInPlace](erfInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`erfInPlace(self: Tensor)`: the `erf_` operator. In-place `erf`: writes the result through `self`; same formula, arguments, and error conditions as `erf()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [erfinv](erfinv.md) | [common]<br>fun [erfinv](erfinv.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`erfinv(input: Tensor)`: the `erfinv` operator. Elementwise inverse error function. Inputs outside `(-1, 1)` produce NaN; ±1 produce ±inf. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [erfinvInPlace](erfinvInPlace.md) | [common]<br>fun [erfinvInPlace](erfinvInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`erfinvInPlace(self: Tensor)`: the `erfinv_` operator. In-place `erfinv`: writes the result through `self`; same formula, arguments, and error conditions as `erfinv()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [exp](exp.md) | [common]<br>fun [exp](exp.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`exp(input: Tensor)`: the `exp` operator. Elementwise natural exponential. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [expand](expand.md) | [common]<br>fun [expand](expand.md)(input: [Tensor](../Tensor/index.md), shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), bidirectional: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`expand(input: Tensor, shape: LongArray, bidirectional: Boolean = false)`: the `expand` operator. Broadcast `input` to a larger shape WITHOUT copying. Size-1 dims stretch to their target; leading target dims with no input counterpart broadcast; `-1` keeps the input's extent at that position. Extents are literals or 0-D integer Tensors (trace symbolically). With `bidirectional = true` the aligned dims broadcast BOTH ways (the ONNX Expand rule): a target extent of 1 against a non-1 input dim keeps the input dim (the pairwise max) instead of raising. The default is the strict directed form (`broadcast_to`). Returns a VIEW: every stretched position aliases ONE stored element; treat the result as read-only (or `contiguous` it to materialize). |
| [expandAs](expandAs.md) | [common]<br>fun [expandAs](expandAs.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`expandAs(input: Tensor, other: Tensor)`: the `expand_as` operator. `expand` to `other`'s shape; `other` supplies extents only; its data is never read. Same broadcasting rules and view semantics as `expand`. |
| [expInPlace](expInPlace.md) | [common]<br>fun [expInPlace](expInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`expInPlace(self: Tensor)`: the `exp_` operator. In-place `exp`: writes the result through `self`; same formula, arguments, and error conditions as `exp()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [exponentialInPlace](exponentialInPlace.md) | [common]<br>fun [exponentialInPlace](exponentialInPlace.md)(self: [Tensor](../Tensor/index.md), lambd: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`exponentialInPlace(self: Tensor, lambd: Double = 1.0, device: Placement? = null)`: the `exponential_` operator. In-place exponential fill with rate `lambd`: overwrites `self` with draws from `p(x) = lambd * exp(-lambd * x)` (x >= 0) and returns it under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [eye](eye.md) | [common]<br>fun [eye](eye.md)(n: [Tensor](../Tensor/index.md), m: [Tensor](../Tensor/index.md)? = null, dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`eye(n: Tensor, m: Tensor? = null, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the `eye` operator. A 2-D identity matrix `[n, m]`: `1` on the diagonal, `0` elsewhere; `m` defaults to `n` (square).<br>[common]<br>fun [eye](eye.md)(n: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), m: [Tensor](../Tensor/index.md)? = null, dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`eye(n: Double, m: Tensor? = null, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the number form of `eye`, `n` as a scalar. |
| [fastGelu](fastGelu.md) | [common]<br>fun [fastGelu](fastGelu.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`fastGelu(input: Tensor)`: the `fast_gelu` operator. FastGELU: the tanh GELU approximation as a standalone op. |
| [fill](fill.md) | [common]<br>fun [fill](fill.md)(input: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`fill(input: Tensor, value: Tensor, device: Placement? = null)`: the `fill` operator. A new tensor with `input`'s shape and dtype, every element set to `value`. `input` supplies GEOMETRY only; its data is never read. `value` is a literal or a 0-D Tensor (a tensor value traces symbolically).<br>[common]<br>fun [fill](fill.md)(input: [Tensor](../Tensor/index.md), value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`fill(input: Tensor, value: Double, device: Placement? = null)`: the number form of `fill`, `value` as a scalar. |
| [fillDiagonal](fillDiagonal.md) | [common]<br>fun [fillDiagonal](fillDiagonal.md)(input: [Tensor](../Tensor/index.md), fillValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), wrap: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`fillDiagonal(input: Tensor, fillValue: Double, wrap: Boolean = false, device: Placement? = null)`: the `fill_diagonal` operator. A copy of the 2-D matrix `input` with `fill_value` written along its diagonal. Without `wrap` the diagonal stops at `min(rows, cols)`; with `wrap = true` a TALL matrix continues the diagonal below the wrap row, restarting at the left edge (the classic tall-matrix wrap). |
| [fillDiagonalInPlace](fillDiagonalInPlace.md) | [common]<br>fun [fillDiagonalInPlace](fillDiagonalInPlace.md)(self: [Tensor](../Tensor/index.md), fillValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), wrap: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`fillDiagonalInPlace(self: Tensor, fillValue: Double, wrap: Boolean = false, device: Placement? = null)`: the `fill_diagonal_` operator. In-place `fill_diagonal`: writes the diagonal through `self`; same arguments and error conditions as `fill_diagonal()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [fillInPlace](fillInPlace.md) | [common]<br>fun [fillInPlace](fillInPlace.md)(self: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`fillInPlace(self: Tensor, value: Tensor, device: Placement? = null)`: the `fill_` operator. In-place `fill`: overwrites every element of `self` with `value`; same arguments and error conditions as `fill()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [fillInPlace](fillInPlace.md)(self: [Tensor](../Tensor/index.md), value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`fillInPlace(self: Tensor, value: Double, device: Placement? = null)`: the number form of `fill_`, `value` as a scalar. |
| [flatten](flatten.md) | [common]<br>fun [flatten](flatten.md)(input: [Tensor](../Tensor/index.md), startDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, endDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L): [Tensor](../Tensor/index.md)<br>`flatten(input: Tensor, startDim: Long = 0L, endDim: Long = -1L)`: the `flatten` operator. Collapse the INCLUSIVE dim range `[start_dim, end_dim]` into one dim; the defaults collapse everything to 1-D. Returns a view sharing storage when the input's stride layout factors into the merged shape (contiguous inputs always do); copies into a fresh dense tensor otherwise. |
| [flip](flip.md) | [common]<br>fun [flip](flip.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`flip(input: Tensor, dims: LongArray)`: the `flip` operator. Reverse the element order along each dim in `dims`. Always copies; a reversed layout is not expressible as a view in this runtime, so this op never returns one. |
| [fliplr](fliplr.md) | [common]<br>fun [fliplr](fliplr.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`fliplr(input: Tensor)`: the `fliplr` operator. `flip` on dim 1: reverse each row's column order. Input rank must be >= 2. Copies. |
| [flipud](flipud.md) | [common]<br>fun [flipud](flipud.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`flipud(input: Tensor)`: the `flipud` operator. `flip` on dim 0: reverse the leading dim's order. Copies. |
| [floor](floor.md) | [common]<br>fun [floor](floor.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`floor(input: Tensor)`: the `floor` operator. Elementwise floor: the largest integer not above `input`. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [floorDivide](floorDivide.md) | [common]<br>fun [floorDivide](floorDivide.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`floorDivide(input: Tensor, other: Tensor)`: the `floor_divide` operator. Elementwise `floor(a / other)`, i.e. `ops::div` with `RoundingMode::Floor`. Broadcasts and promotes as `add`.<br>[common]<br>fun [floorDivide](floorDivide.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`floorDivide(input: Tensor, other: Double)`: the number form of `floor_divide`, `other` as a scalar. |
| [floorDivideInPlace](floorDivideInPlace.md) | [common]<br>fun [floorDivideInPlace](floorDivideInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`floorDivideInPlace(self: Tensor, other: Tensor)`: the `floor_divide_` operator. In-place `floor_divide`: writes the floored quotient through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [floorDivideInPlace](floorDivideInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`floorDivideInPlace(self: Tensor, other: Double)`: the number form of `floor_divide_`, `other` as a scalar. |
| [floorInPlace](floorInPlace.md) | [common]<br>fun [floorInPlace](floorInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`floorInPlace(self: Tensor)`: the `floor_` operator. In-place `floor`: writes the result through `self`; same formula, arguments, and error conditions as `floor()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [fmax](fmax.md) | [common]<br>fun [fmax](fmax.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`fmax(input: Tensor, other: Tensor)`: the `fmax` operator. Elementwise IEEE 754 maximum, NaN-IGNORING: where one operand is NaN the other value wins (both NaN gives NaN). For the NaN-propagating law use `ops::maximum`. Broadcasts and promotes as `add`. |
| [fmin](fmin.md) | [common]<br>fun [fmin](fmin.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`fmin(input: Tensor, other: Tensor)`: the `fmin` operator. Elementwise IEEE 754 minimum, NaN-IGNORING (the `fmax` dual). Broadcasts and promotes as `add`. |
| [fmod](fmod.md) | [common]<br>fun [fmod](fmod.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`fmod(input: Tensor, other: Tensor)`: the `fmod` operator. Elementwise remainder with the sign of the DIVIDEND, i.e. `ops::mod` with `ModMode::C`. Broadcasts and promotes as `add`.<br>[common]<br>fun [fmod](fmod.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`fmod(input: Tensor, other: Double)`: the number form of `fmod`, `other` as a scalar. |
| [fmodInPlace](fmodInPlace.md) | [common]<br>fun [fmodInPlace](fmodInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`fmodInPlace(self: Tensor, other: Tensor)`: the `fmod_` operator. In-place `fmod`: writes the remainders through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [fmodInPlace](fmodInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`fmodInPlace(self: Tensor, other: Double)`: the number form of `fmod_`, `other` as a scalar. |
| [fold](fold.md) | [common]<br>fun [fold](fold.md)(input: [Tensor](../Tensor/index.md), outputSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), mode: [PadMode](../PadMode/index.md) = PadMode.CONSTANT, value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`fold(input: Tensor, outputSize: LongArray, kernelSize: LongArray, dilation: LongArray = longArrayOf(), padding: LongArray = longArrayOf(), stride: LongArray = longArrayOf(), mode: PadMode = PadMode.CONSTANT, value: Double? = null)`: the `fold` operator. col2im: the inverse of `unfold`; it sums overlapping windows back into a channels-last image. Input `[N, L, prod(kernel_size), C]`; overlapping window contributions ADD (so `fold(unfold(x))` multiplies overlapped elements by their coverage count). |
| [frac](frac.md) | [common]<br>fun [frac](frac.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`frac(input: Tensor)`: the `frac` operator. Elementwise fractional part. Keeps the sign of `input` (`frac(-1.5) == -0.5`). Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [fracInPlace](fracInPlace.md) | [common]<br>fun [fracInPlace](fracInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`fracInPlace(self: Tensor)`: the `frac_` operator. In-place `frac`: writes the result through `self`; same formula, arguments, and error conditions as `frac()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [frexp](frexp.md) | [common]<br>fun [frexp](frexp.md)(input: [Tensor](../Tensor/index.md)): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`frexp(input: Tensor)`: the `frexp` operator. Decomposes each element into `mantissa * 2^exponent` with `|mantissa| in [0.5, 1)`. Floating-point inputs only. The mantissa keeps the input's dtype (Float32 for the bit-packed sub-byte float formats, whose value grids cannot hold the mantissa range); the exponent is Int32. |
| [full](full.md) | [common]<br>fun [full](full.md)(shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), fillValue: [Tensor](../Tensor/index.md), dtype: [DType](../DType/index.md), device: [Placement](../Placement/index.md)? = null, pinnedFor: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`full(shape: LongArray, fillValue: Tensor, dtype: DType, device: Placement? = null, pinnedFor: Placement? = null)`: the `full` operator. A new tensor of the given shape with every element set to `fill_value`. Each `shape` extent is an int literal or a 0-D integer Tensor (traces symbolically). `fill_value` is a scalar literal or a tensor: a bool keeps Bool kind, an integer keeps its integer-ness across the boundary and stays exact past 2^53, and a tensor fills every element from its values (a 0-D tensor, or one broadcastable to `shape`), the same write as `fill_` on an `empty` tensor in one kernel. `Tensor::full` is the literal-only form.<br>[common]<br>fun [full](full.md)(shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), fillValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dtype: [DType](../DType/index.md), device: [Placement](../Placement/index.md)? = null, pinnedFor: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`full(shape: LongArray, fillValue: Double, dtype: DType, device: Placement? = null, pinnedFor: Placement? = null)`: the number form of `full`, `fillValue` as a scalar. |
| [fullLike](fullLike.md) | [common]<br>fun [fullLike](fullLike.md)(reference: [Tensor](../Tensor/index.md), fillValue: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`fullLike(reference: Tensor, fillValue: Tensor, device: Placement? = null)`: the `full_like` operator. A new tensor with `reference`'s shape and dtype, filled with `fill_value`. `fill_value` takes the same forms as `full`'s: a bool, an integer, a double, or a tensor (0-D, or broadcastable to the reference's shape).<br>[common]<br>fun [fullLike](fullLike.md)(reference: [Tensor](../Tensor/index.md), fillValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`fullLike(reference: Tensor, fillValue: Double, device: Placement? = null)`: the number form of `full_like`, `fillValue` as a scalar. |
| [gatedDeltaUpdate](gatedDeltaUpdate.md) | [common]<br>fun [gatedDeltaUpdate](gatedDeltaUpdate.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), beta: [Tensor](../Tensor/index.md), gate: [Tensor](../Tensor/index.md), state: [Tensor](../Tensor/index.md), seqLens: [Tensor](../Tensor/index.md)? = null, slotIds: [Tensor](../Tensor/index.md)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, gateBias: [Tensor](../Tensor/index.md)? = null, gateScale: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`gatedDeltaUpdate(query: Tensor, key: Tensor, value: Tensor, beta: Tensor, gate: Tensor, state: Tensor, seqLens: Tensor? = null, slotIds: Tensor? = null, scale: Double? = null, gateBias: Tensor? = null, gateScale: Tensor? = null)`: the `gated_delta_update` operator. Gated delta-rule recurrence step: per token, the `[B, HV, K, V]` Float32 `state` decays by `exp(g)`, takes the delta-rule rank-1 update `(beta·k) ⊗ (v − Sᵀk)`, and emits `o = (scale·q)ᵀ S`, updated IN PLACE. The gate's RANK picks the family: `[B, T, HV]` = one scalar per value head; `[B, T, HV, K]` = per key dim. q/k `[B, T, H, K]` (HV % H == 0, grouped heads), v `[B, T, HV, V]`, beta `[B, T, HV]`; `scale` defaults to K^-1/2; `seq_lens` (`[B]` Int32) bounds ragged prefill rows. `slot_ids` (`[B]` Int32, device-resident) addresses `state` as a SLAB `[num_slots, HV, K, V]`: batch row `b` reads/updates slab row `slot_ids[b]` in place (ids in range and DISTINCT per call, the caller's contract); absent keeps state row `b`. TWO gate forms, told apart by which inputs are bound: with `gate_bias` and `gate_scale` absent, `gate` IS the log-space decay (Float32 or the activations' dtype); with both bound (Float32 `gate_bias``[HV]` beside a `[B, T, HV]` gate or `[HV, K]` beside a `[B, T, HV, K]` one, the checkpoint's `dt_bias`; Float32 `gate_scale``[HV]`, the once-folded `-exp(A_log)`), `gate` is the RAW gate projection slice at the activations' dtype and the kernel forms the decay `gate_scale * softplus(g + gate_bias)` in fp32 registers, so no add / softplus / mul pass and no fp32 transient precede the call. One without the other rejects; a backend without the raw-gate arm declines it typed. |
| [gatedRmsNorm](gatedRmsNorm.md) | [common]<br>fun [gatedRmsNorm](gatedRmsNorm.md)(input: [Tensor](../Tensor/index.md), gate: [Tensor](../Tensor/index.md), normalizedShape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), weight: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`gatedRmsNorm(input: Tensor, gate: Tensor, normalizedShape: LongArray, weight: Tensor? = null, eps: Double? = null)`: the `gated_rms_norm` operator. Fused group RMS norm + post-norm silu(z) gate: `out = rms_norm(x) · silu(z)`, the norm taken over the trailing `normalized_shape` group extent (`{vd}` for a per-head norm over `[.., HV, vd]`). `weight` is the optional `[group]` gamma applied after the normalization; an absent `eps` takes the runtime's rms-norm default. |
| [gather](gather.md) | [common]<br>fun [gather](gather.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`gather(input: Tensor, dim: Long, index: Tensor)`: the `gather` operator. Axis-wise gather: read `input` at positions given by `index` along `dim`. `out[i][j][k] = x[index[i][j][k]][j][k]` for `dim = 0` (likewise for any other `dim`; only that axis's coordinate is replaced). The output takes `index`'s shape and `input`'s dtype. Index tensors are `Int32` or `Int64` on every backend; entries must lie in `[0, x`'s `dim` extent`)`. |
| [ge](ge.md) | [common]<br>fun [ge](ge.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`ge(input: Tensor, other: Tensor)`: the `ge` operator. Elementwise `a >= other`; output as `eq`.<br>[common]<br>fun [ge](ge.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`ge(input: Tensor, other: Double)`: the number form of `ge`, `other` as a scalar. |
| [geglu](geglu.md) | [common]<br>fun [geglu](geglu.md)(input: [Tensor](../Tensor/index.md), approximate: [GeluMode](../GeluMode/index.md) = GeluMode.NONE): [Tensor](../Tensor/index.md)<br>`geglu(input: Tensor, approximate: GeluMode = GeluMode.NONE)`: the `geglu` operator. GeGLU gated activation over a concatenated gate‖up tensor. The input's LAST dimension must be even (`2d`); the output halves it (`d`). `approximate` selects the exact (erf) or tanh GELU for the gate. |
| [geInPlace](geInPlace.md) | [common]<br>fun [geInPlace](geInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`geInPlace(self: Tensor, other: Tensor)`: the `ge_` operator. In-place `ge`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [geInPlace](geInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`geInPlace(self: Tensor, other: Double)`: the number form of `ge_`, `other` as a scalar. |
| [gelu](gelu.md) | [common]<br>fun [gelu](gelu.md)(input: [Tensor](../Tensor/index.md), approximate: [GeluMode](../GeluMode/index.md) = GeluMode.NONE): [Tensor](../Tensor/index.md)<br>`gelu(input: Tensor, approximate: GeluMode = GeluMode.NONE)`: the `gelu` operator. Gaussian error linear unit. `approximate = GeluMode::Tanh` selects the cheaper tanh form used by many transformer checkpoints; `GeluMode::None` is the exact erf form. |
| [geluInPlace](geluInPlace.md) | [common]<br>fun [geluInPlace](geluInPlace.md)(self: [Tensor](../Tensor/index.md), approximate: [GeluMode](../GeluMode/index.md) = GeluMode.NONE): [Tensor](../Tensor/index.md)<br>`geluInPlace(self: Tensor, approximate: GeluMode = GeluMode.NONE)`: the `gelu_` operator. In-place `gelu`: writes the result through `self`; same formula, arguments, and error conditions as `gelu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [generateRotaryCache](generateRotaryCache.md) | [common]<br>fun [generateRotaryCache](generateRotaryCache.md)(rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), maxPositions: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, lowFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, highFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, originalMaxPos: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, betaFast: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, betaSlow: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, freqFactors: [Tensor](../Tensor/index.md)? = null, device: [Placement](../Placement/index.md)? = null, yarnTruncate: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`generateRotaryCache(rotaryDim: Long, maxPositions: Long, theta: Double? = null, scaling: RopeScaling? = null, scale: Double? = null, lowFreqFactor: Double? = null, highFreqFactor: Double? = null, originalMaxPos: Long? = null, betaFast: Double? = null, betaSlow: Double? = null, freqFactors: Tensor? = null, device: Placement? = null, yarnTruncate: Boolean? = null)`: the `generate_rotary_cache` operator. The rotary angle tables of one context-scaling family: `cos` and `sin`, each `[max_positions, rotary_dim / 2]` Float32. |
| [glu](glu.md) | [common]<br>fun [glu](glu.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L): [Tensor](../Tensor/index.md)<br>`glu(input: Tensor, dim: Long = -1L)`: the `glu` operator. Gated linear unit: splits `input` in half along `dim` and gates the first half with the sigmoid of the second. The size of `dim` must be even; the output halves it. |
| [gridSample](gridSample.md) | [common]<br>fun [gridSample](gridSample.md)(input: [Tensor](../Tensor/index.md), grid: [Tensor](../Tensor/index.md), mode: [GridSampleMode](../GridSampleMode/index.md) = GridSampleMode.BILINEAR, paddingMode: [GridSamplePaddingMode](../GridSamplePaddingMode/index.md) = GridSamplePaddingMode.ZEROS, alignCorners: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`gridSample(input: Tensor, grid: Tensor, mode: GridSampleMode = GridSampleMode.BILINEAR, paddingMode: GridSamplePaddingMode = GridSamplePaddingMode.ZEROS, alignCorners: Boolean = false)`: the `grid_sample` operator. Samples a channels-last input at arbitrary grid coordinates. `input``[N, spatial_in.., C]`; `grid``[N, spatial_out.., S]` with `S` the spatial rank, coordinates normalized to `[-1, 1]`. `mode` picks the interpolation (`Bilinear` / `Nearest` / …), `padding_mode` the out-of-range policy (`Zeros` / `Border` / `Reflection`), `align_corners` the corner convention. |
| [groupNorm](groupNorm.md) | [common]<br>fun [groupNorm](groupNorm.md)(input: [Tensor](../Tensor/index.md), numGroups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), weight: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, runningMean: [Tensor](../Tensor/index.md)? = null, runningVar: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`groupNorm(input: Tensor, numGroups: Long, weight: Tensor? = null, bias: Tensor? = null, runningMean: Tensor? = null, runningVar: Tensor? = null, eps: Double? = null, activation: Activation? = null)`: the `group_norm` operator. Group normalization: channels split into `num_groups` groups, normalized per group (channels-last). Statistics are computed per `(sample, group)` over the group's channels and the spatial dims; with `running_mean` / `running_var` present they are folded per channel instead (batch-norm style). Optional fused `activation` applies to the result. |
| [groupQueryAttention](groupQueryAttention.md) | [common]<br>fun [groupQueryAttention](groupQueryAttention.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), pastKey: [Tensor](../Tensor/index.md)? = null, pastValue: [Tensor](../Tensor/index.md)? = null, kvcacheStart: [Tensor](../Tensor/index.md)? = null, ropeCos: [Tensor](../Tensor/index.md)? = null, ropeSin: [Tensor](../Tensor/index.md)? = null, positionIds: [Tensor](../Tensor/index.md)? = null, attnMask: [Tensor](../Tensor/index.md)? = null, isCausal: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, qScale: [Tensor](../Tensor/index.md)? = null, softcap: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, slidingWindow: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, smoothSoftmax: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, rotaryMode: [RotaryMode](../RotaryMode/index.md)? = null, numHeads: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, kvNumHeads: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, outPresentKey: [Tensor](../Tensor/index.md)? = null, outPresentValue: [Tensor](../Tensor/index.md)? = null, kScale: [Tensor](../Tensor/index.md)? = null, vScale: [Tensor](../Tensor/index.md)? = null, headSink: [Tensor](../Tensor/index.md)? = null, qNormGain: [Tensor](../Tensor/index.md)? = null, kNormGain: [Tensor](../Tensor/index.md)? = null, qkNormEps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, slotIds: [Tensor](../Tensor/index.md)? = null, keptPrefix: [Tensor](../Tensor/index.md)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`groupQueryAttention(query: Tensor, key: Tensor, value: Tensor, pastKey: Tensor? = null, pastValue: Tensor? = null, kvcacheStart: Tensor? = null, ropeCos: Tensor? = null, ropeSin: Tensor? = null, positionIds: Tensor? = null, attnMask: Tensor? = null, isCausal: Boolean? = null, qScale: Tensor? = null, softcap: Double? = null, slidingWindow: Long? = null, smoothSoftmax: Boolean? = null, rotaryMode: RotaryMode? = null, numHeads: Long? = null, kvNumHeads: Long? = null, outPresentKey: Tensor? = null, outPresentValue: Tensor? = null, kScale: Tensor? = null, vScale: Tensor? = null, headSink: Tensor? = null, qNormGain: Tensor? = null, kNormGain: Tensor? = null, qkNormEps: Double? = null, slotIds: Tensor? = null, keptPrefix: Tensor? = null)`: the `group_query_attention` operator. Fused GQA with RoPE + KV cache. Bind `out_present_key`/`out_present_value` to the same buffers as `past_key`/`past_value` (a `KVCache::keys`/`values(layer)` view) + pass `kvcache_start` to append the new post-RoPE K/V IN PLACE into the cache (the decode perf path). q/k/v are hidden-folded `[ΣS, heads*head_dim]`; `num_heads`/`kv_num_heads` drive the in-op head split (GQA). `head_sink` is the per-head softmax sink `[H_q]`, a virtual logit folded into the softmax denominator (attention-sink models bind one per layer), the same contract as `group_query_attention_varlen`; it rides the parameter tail here. `q_norm_gain`/`k_norm_gain` engage the POST-rope per-head RMS norm: after the in-op rotation, every head's `[head_dim]` q (and new-k) vector is RMS-normalized with the gain BEFORE any cache append, so the cache holds rotated+normed keys. Each gain is rank-1 `[head_dim]` (one vector shared across heads; any other shape rejects), any float dtype, applied at its own dtype. The gains require the in-op rope planes (`rope_cos`/`rope_sin`), and they travel WITH `qk_norm_eps`: pass the model's own rms-norm epsilon alongside the gains, or neither (a gain without the epsilon, or an epsilon with no gain, rejects). Absent ⇒ the gain-less path, unchanged. A rope-free per-head norm composes `qk_rms_norm` instead. `slot_ids` (`[B]` Int32) names the cache row each batch row appends to and attends from on a continuous `[max_seqs, H_kv, max_seq, D]` cache: a sequence keeps its row while the batch composition changes around it. Absent, batch row b uses cache row b. Every entry must lie in `[0, max_seqs)` and no two rows may share one (each rejects). On that cache `kvcache_start` stays the rank-1 `[B]` layout selector whose values are not read: each row's write offset is `cu_seqlens_k[b] - q_len[b]`. A paged block table and the dense in-place form take no `slot_ids` (the block table is its own row map; the dense form addresses rows by batch index). A paged block table (`[B, max_blocks]` Int32) is validated whole before any read: every entry is `-1` (the unused-tail pad) or a block index in `[0, num_blocks)`, and no two entries of one row name the same physical block; an out-of-range entry and a repeated one alike refuse `INVALID_ARGUMENT` (a repeat would alias two positions onto one block and decode wrong values silently). A read-only attend (`key` and `value` absent) takes no present outputs: use `attention_over_cache`, or leave `out_present_key`/`out_present_value` unbound, and `present_key`/`present_value` come back undefined. A bound present refuses `INVALID_ARGUMENT`. `kept_prefix` keeps each sequence's first P keys attended beside the sliding window (a 0-D value for every sequence, or `[B]` one per sequence; Int32 or Int64): under the causal bound a key is attended when it is inside the first P keys or inside the window; absent, the window alone. A negative P refuses. |
| [groupQueryAttentionVarlen](groupQueryAttentionVarlen.md) | [common]<br>fun [groupQueryAttentionVarlen](groupQueryAttentionVarlen.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), cuSeqlensQ: [Tensor](../Tensor/index.md), cuSeqlensK: [Tensor](../Tensor/index.md), maxSeqlenQ: [Tensor](../Tensor/index.md)? = null, maxSeqlenK: [Tensor](../Tensor/index.md)? = null, pastKey: [Tensor](../Tensor/index.md)? = null, pastValue: [Tensor](../Tensor/index.md)? = null, kvcacheStart: [Tensor](../Tensor/index.md)? = null, ropeCos: [Tensor](../Tensor/index.md)? = null, ropeSin: [Tensor](../Tensor/index.md)? = null, positionIds: [Tensor](../Tensor/index.md)? = null, attnMask: [Tensor](../Tensor/index.md)? = null, headSink: [Tensor](../Tensor/index.md)? = null, isCausal: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, qScale: [Tensor](../Tensor/index.md)? = null, softcap: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, slidingWindow: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, smoothSoftmax: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, rotaryMode: [RotaryMode](../RotaryMode/index.md)? = null, numHeads: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, kvNumHeads: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, outPresentKey: [Tensor](../Tensor/index.md)? = null, outPresentValue: [Tensor](../Tensor/index.md)? = null, kScale: [Tensor](../Tensor/index.md)? = null, vScale: [Tensor](../Tensor/index.md)? = null, qNormGain: [Tensor](../Tensor/index.md)? = null, kNormGain: [Tensor](../Tensor/index.md)? = null, qkNormEps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, slotIds: [Tensor](../Tensor/index.md)? = null, keptPrefix: [Tensor](../Tensor/index.md)? = null, kvPositionOffset: [Tensor](../Tensor/index.md)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`groupQueryAttentionVarlen(query: Tensor, key: Tensor, value: Tensor, cuSeqlensQ: Tensor, cuSeqlensK: Tensor, maxSeqlenQ: Tensor? = null, maxSeqlenK: Tensor? = null, pastKey: Tensor? = null, pastValue: Tensor? = null, kvcacheStart: Tensor? = null, ropeCos: Tensor? = null, ropeSin: Tensor? = null, positionIds: Tensor? = null, attnMask: Tensor? = null, headSink: Tensor? = null, isCausal: Boolean? = null, qScale: Tensor? = null, softcap: Double? = null, slidingWindow: Long? = null, smoothSoftmax: Boolean? = null, rotaryMode: RotaryMode? = null, numHeads: Long? = null, kvNumHeads: Long? = null, outPresentKey: Tensor? = null, outPresentValue: Tensor? = null, kScale: Tensor? = null, vScale: Tensor? = null, qNormGain: Tensor? = null, kNormGain: Tensor? = null, qkNormEps: Double? = null, slotIds: Tensor? = null, keptPrefix: Tensor? = null, kvPositionOffset: Tensor? = null)`: the `group_query_attention_varlen` operator. The varlen variant of the fused GQA above, with the same qk-norm tail: `q_norm_gain`/`k_norm_gain` (rank-1 `[head_dim]`, post-rope, applied before the K/V append) travel with `qk_norm_eps` (the model's rms-norm epsilon) and require the in-op rope planes; absent ⇒ unchanged. The gains are the after-rotation order; a model that norms its heads before the rotation (the Qwen3 order) runs `qk_rms_norm` on its projections ahead of this op and passes no gains. The same `slot_ids` contract: on a continuous cache it names each batch row's cache row (`[B]` Int32, in range, pairwise distinct; absent = row b for batch row b), and `kvcache_start`'s values stay unread there (the write offsets derive from `cu_seqlens_k`). The same block-table contract on a paged pool: every entry of the `[B, max_blocks]` table is `-1` or a block index in `[0, num_blocks)`, and no two entries of one row name the same physical block; an out-of-range or repeated entry refuses `INVALID_ARGUMENT` before any read or append. The same read-only rule: with `key` and `value` absent it takes no present outputs; use `attention_over_cache`, or leave `out_present_key`/`out_present_value` unbound. `kept_prefix` keeps each request's first P keys attended beside the sliding window (a 0-D value or `[B]`, Int32 or Int64), the same law as `attention`'s. `kv_position_offset` (`[B]`, Int32 or Int64) is each paged row's served-key offset: when a windowed paged cache serves only a row's recent blocks, its served key at view position i sits at absolute position i + offset, so the in-op rotary and the window read true positions; pass `KVCache::StepIndices::kv_position_offset` through as-is (undefined on every other cache). |
| [gt](gt.md) | [common]<br>fun [gt](gt.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`gt(input: Tensor, other: Tensor)`: the `gt` operator. Elementwise `a > other`; output as `eq`.<br>[common]<br>fun [gt](gt.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`gt(input: Tensor, other: Double)`: the number form of `gt`, `other` as a scalar. |
| [gtInPlace](gtInPlace.md) | [common]<br>fun [gtInPlace](gtInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`gtInPlace(self: Tensor, other: Tensor)`: the `gt_` operator. In-place `gt`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [gtInPlace](gtInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`gtInPlace(self: Tensor, other: Double)`: the number form of `gt_`, `other` as a scalar. |
| [hardshrink](hardshrink.md) | [common]<br>fun [hardshrink](hardshrink.md)(input: [Tensor](../Tensor/index.md), lambd: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.5): [Tensor](../Tensor/index.md)<br>`hardshrink(input: Tensor, lambd: Double = 0.5)`: the `hardshrink` operator. Hard shrinkage: zeroes every element within `[-lambd, lambd]`. |
| [hardshrinkInPlace](hardshrinkInPlace.md) | [common]<br>fun [hardshrinkInPlace](hardshrinkInPlace.md)(self: [Tensor](../Tensor/index.md), lambd: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.5): [Tensor](../Tensor/index.md)<br>`hardshrinkInPlace(self: Tensor, lambd: Double = 0.5)`: the `hardshrink_` operator. In-place `hardshrink`: writes the result through `self`; same formula, arguments, and error conditions as `hardshrink()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [hardsigmoid](hardsigmoid.md) | [common]<br>fun [hardsigmoid](hardsigmoid.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`hardsigmoid(input: Tensor)`: the `hardsigmoid` operator. Piecewise-linear sigmoid approximation. |
| [hardsigmoidInPlace](hardsigmoidInPlace.md) | [common]<br>fun [hardsigmoidInPlace](hardsigmoidInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`hardsigmoidInPlace(self: Tensor)`: the `hardsigmoid_` operator. In-place `hardsigmoid`: writes the result through `self`; same formula, arguments, and error conditions as `hardsigmoid()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [hardswish](hardswish.md) | [common]<br>fun [hardswish](hardswish.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`hardswish(input: Tensor)`: the `hardswish` operator. Piecewise-linear swish approximation (the MobileNet-v3 form). |
| [hardswishInPlace](hardswishInPlace.md) | [common]<br>fun [hardswishInPlace](hardswishInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`hardswishInPlace(self: Tensor)`: the `hardswish_` operator. In-place `hardswish`: writes the result through `self`; same formula, arguments, and error conditions as `hardswish()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [hardtanh](hardtanh.md) | [common]<br>fun [hardtanh](hardtanh.md)(input: [Tensor](../Tensor/index.md), minVal: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = -1.0, maxVal: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)<br>`hardtanh(input: Tensor, minVal: Double = -1.0, maxVal: Double = 1.0)`: the `hardtanh` operator. Clamps every element to `[min_val, max_val]`. |
| [hardtanhInPlace](hardtanhInPlace.md) | [common]<br>fun [hardtanhInPlace](hardtanhInPlace.md)(self: [Tensor](../Tensor/index.md), minVal: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = -1.0, maxVal: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)<br>`hardtanhInPlace(self: Tensor, minVal: Double = -1.0, maxVal: Double = 1.0)`: the `hardtanh_` operator. In-place `hardtanh`: writes the result through `self`; same formula, arguments, and error conditions as `hardtanh()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [hash128](hash128.md) | [common]<br>fun [hash128](hash128.md)(input: [Tensor](../Tensor/index.md), seed: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`hash128(input: Tensor, seed: Long = 0L)`: the `hash_128` operator. 128-bit sibling of `hash_64`; same byte/portability contract. |
| [hash256](hash256.md) | [common]<br>fun [hash256](hash256.md)(input: [Tensor](../Tensor/index.md), seed: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`hash256(input: Tensor, seed: Long = 0L)`: the `hash_256` operator. 256-bit sibling of `hash_64`; same byte/portability contract. |
| [hash64](hash64.md) | [common]<br>fun [hash64](hash64.md)(input: [Tensor](../Tensor/index.md), seed: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`hash64(input: Tensor, seed: Long = 0L)`: the `hash_64` operator. 64-bit content hash of `input`'s packed bytes (row-major logical order; strided inputs are materialized internally). A frozen function of (seed, bytes): identical on every platform, backend, and ISA tier, so digests are safe to persist and compare across devices. `seed` perturbs the key; 0 selects the runtime's fixed content-addressing key. |
| [hashChain](hashChain.md) | [common]<br>fun [hashChain](hashChain.md)(rows: [Tensor](../Tensor/index.md), parent: [Tensor](../Tensor/index.md), seed: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`hashChain(rows: Tensor, parent: Tensor, seed: Long = 0L)`: the `hash_chain` operator. Rowwise 128-bit CHAINED hash: for `rows [N, ..]` and a `[2]` UInt64 `parent` (zeros = the chain's zero element), row `i`'s digest hashes (digest `i-1` ‖ row `i`'s packed bytes); one dispatch computes a whole sequence's rolling content hashes. Same portability contract as `hash_64`. |
| [hashLanes](hashLanes.md) | [common]<br>fun [hashLanes](hashLanes.md)(input: [Tensor](../Tensor/index.md), key: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, algo: [HashLaneAlgo](../HashLaneAlgo/index.md) = HashLaneAlgo.AUTO, maskBits: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`hashLanes(input: Tensor, key: Long = 0L, algo: HashLaneAlgo = HashLaneAlgo.AUTO, maskBits: Long = 0L)`: the `hash_lanes` operator. Elementwise per-lane BIJECTIVE hash, shape-preserving: every lane of an integer `input` maps through a permutation of its width, so distinct lane values stay distinct (a lane-wise content id, a bucket index, a deterministic shuffle key). A 32-bit lane lands as UInt32, a 64-bit lane as UInt64; `algo` selects the permutation within the input's width (`HashLaneAlgo::Auto`: `Triple32` for 32-bit lanes, `Moremur` for 64-bit ones). `key` perturbs the permutation (0 is a fixed valid default, so the same key gives the same map on every platform and backend). `mask_bits` in `(0, width]` restricts the bijection to `[0, 2^mask_bits)`: a lane below that bound maps to a lane below it, so a table of that size is permuted onto itself; 0 (and the lane width) keeps the full width. |
| [hashTensor](hashTensor.md) | [common]<br>fun [hashTensor](hashTensor.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, mode: [HashTensorMode](../HashTensorMode/index.md) = HashTensorMode.XOR_SUM): [Tensor](../Tensor/index.md)<br>`hashTensor(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false, mode: HashTensorMode = HashTensorMode.XOR_SUM)`: the `hash_tensor` operator. Bitwise hash-reduction over `dims` (empty = all): each element's bits are mixed and combined per `mode` into a UInt64 digest, standard reduction shape. Order-independent under `HashTensorMode::XorSum`, and identical on every backend, a cheap whole-tensor fingerprint for parity checks and cache keys. |
| [histogram](histogram.md) | [common]<br>fun [histogram](histogram.md)(input: [Tensor](../Tensor/index.md), bins: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 100, range: [Tensor](../Tensor/index.md)? = null, weight: [Tensor](../Tensor/index.md)? = null, density: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`histogram(input: Tensor, bins: Long = 100L, range: Tensor? = null, weight: Tensor? = null, density: Boolean = false)`: the `histogram` operator. |
| [huberLoss](huberLoss.md) | [common]<br>fun [huberLoss](huberLoss.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN, delta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)<br>`huberLoss(input: Tensor, target: Tensor, reduction: Reduction = Reduction.MEAN, delta: Double = 1.0)`: the `huber_loss` operator. Huber loss: quadratic near zero, linear past the `delta` knee. |
| [hypot](hypot.md) | [common]<br>fun [hypot](hypot.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`hypot(input: Tensor, other: Tensor)`: the `hypot` operator. Elementwise hypotenuse . Broadcasts and promotes as `add`. |
| [hypotInPlace](hypotInPlace.md) | [common]<br>fun [hypotInPlace](hypotInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`hypotInPlace(self: Tensor, other: Tensor)`: the `hypot_` operator. In-place `hypot`: writes the hypotenuses through `x`. Writes through `self` and returns it, so calls chain. |
| [indexAdd](indexAdd.md) | [common]<br>fun [indexAdd](indexAdd.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), indices: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`indexAdd(input: Tensor, dim: Long, indices: Tensor, src: Tensor)`: the `index_add` operator. A copy of `input` with rows of `src` ACCUMULATED at `indices` along `dim`: `out[.., indices[i], ..] += src[.., i, ..]`; duplicate indices add up. |
| [indexAddInPlace](indexAddInPlace.md) | [common]<br>fun [indexAddInPlace](indexAddInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), indices: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`indexAddInPlace(self: Tensor, dim: Long, indices: Tensor, src: Tensor)`: the `index_add_` operator. In-place `index_add`: `self[.., indices[i], ..] += src[.., i, ..]`; same arguments and error conditions as `index_add()`. Accumulates through `self`'s storage (a strided view reaches its base buffer; aliases observe the write). Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [indexCopy](indexCopy.md) | [common]<br>fun [indexCopy](indexCopy.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), indices: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`indexCopy(input: Tensor, dim: Long, indices: Tensor, src: Tensor)`: the `index_copy` operator. A copy of `input` with rows of `src` WRITTEN at `indices` along `dim`: `out[.., indices[i], ..] = src[.., i, ..]`. Prefer unique indices; a duplicated position is written more than once. Same shape/index-dtype rules as `index_add`. |
| [indexCopyInPlace](indexCopyInPlace.md) | [common]<br>fun [indexCopyInPlace](indexCopyInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), indices: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`indexCopyInPlace(self: Tensor, dim: Long, indices: Tensor, src: Tensor)`: the `index_copy_` operator. In-place `index_copy`: `self[.., indices[i], ..] = src[.., i, ..]`; same arguments and error conditions as `index_copy()`. Writes through `self`'s storage (a strided view, e.g. a cache slice, reaches its base buffer; aliases observe the write). Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [indexFill](indexFill.md) | [common]<br>fun [indexFill](indexFill.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), indices: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`indexFill(input: Tensor, dim: Long, indices: Tensor, value: Tensor)`: the `index_fill` operator. A copy of `input` with the rows at `indices` along `dim` set to `value`: `out[.., indices[i], ..] = value`. `indices` is 1-D `Int32`/`Int64`; `value` is a literal or a 0-D Tensor.<br>[common]<br>fun [indexFill](indexFill.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), indices: [Tensor](../Tensor/index.md), value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`indexFill(input: Tensor, dim: Long, indices: Tensor, value: Double)`: the number form of `index_fill`, `value` as a scalar. |
| [indexFillInPlace](indexFillInPlace.md) | [common]<br>fun [indexFillInPlace](indexFillInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), indices: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`indexFillInPlace(self: Tensor, dim: Long, indices: Tensor, value: Tensor)`: the `index_fill_` operator. In-place `index_fill`: `self[.., indices[i], ..] = value`; same arguments and error conditions as `index_fill()`. Fills through `self`'s storage (a strided view reaches its base buffer; aliases observe the write). Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [indexFillInPlace](indexFillInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), indices: [Tensor](../Tensor/index.md), value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`indexFillInPlace(self: Tensor, dim: Long, indices: Tensor, value: Double)`: the number form of `index_fill_`, `value` as a scalar. |
| [indexSelect](indexSelect.md) | [common]<br>fun [indexSelect](indexSelect.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`indexSelect(input: Tensor, dim: Long, index: Tensor)`: the `index_select` operator. Select whole rows of `input` at `index` positions along `dim`. Output = `input`'s shape with the `dim` extent replaced by `index`'s length; rows may repeat and appear in any order. `index` is 1-D `Int32`/`Int64`; prefer `Int32` where the extents allow (half the index bytes). |
| [inner](inner.md) | [common]<br>fun [inner](inner.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`inner(input: Tensor, other: Tensor)`: the `inner` operator. Last-axis contraction of two tensors. Sums over the LAST dim of each operand (which must agree); the output is the cartesian product of the leading shapes: `[*a_lead, K] x [*b_lead, K] -> [*a_lead, *b_lead]`. |
| [instanceNorm](instanceNorm.md) | [common]<br>fun [instanceNorm](instanceNorm.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, runningMean: [Tensor](../Tensor/index.md)? = null, runningVar: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`instanceNorm(input: Tensor, weight: Tensor? = null, bias: Tensor? = null, runningMean: Tensor? = null, runningVar: Tensor? = null, eps: Double? = null, activation: Activation? = null)`: the `instance_norm` operator. Instance normalization: statistics per `(sample, channel)` over the spatial dims (channels-last). With `running_mean` / `running_var` present they are folded instead of computing per-instance statistics (inference form; no training mode). Optional fused `activation` applies to the result. |
| [interpolate](interpolate.md) | [common]<br>fun [interpolate](interpolate.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), scaleFactors: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), mode: [InterpMode](../InterpMode/index.md) = InterpMode.NEAREST, alignCorners: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, recomputeScaleFactor: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, antialias: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`interpolate(input: Tensor, sizes: LongArray = longArrayOf(), scaleFactors: LongArray = longArrayOf(), mode: InterpMode = InterpMode.NEAREST, alignCorners: Boolean? = null, recomputeScaleFactor: Boolean = false, antialias: Boolean = false)`: the `interpolate` operator. Resample the spatial dims to `sizes` OR by `scale_factors` (exactly one given; entries may be int literals or 0-D Tensors, so a dynamic output size flows without a host read). Rank picks the spatial variant. |
| [isclose](isclose.md) | [common]<br>fun [isclose](isclose.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), rtol: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0E-5, atol: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0E-8, equalNan: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`isclose(input: Tensor, other: Tensor, rtol: Double = 1e-5, atol: Double = 1e-8, equalNan: Boolean = false)`: the `isclose` operator. Elementwise approximate equality, the elementwise map behind `ops::allclose`, same formula and defaults (`rtol``1e-5`, `atol``1e-8`, `equal_nan``false`). |
| [isfinite](isfinite.md) | [common]<br>fun [isfinite](isfinite.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`isfinite(input: Tensor)`: the `isfinite` operator. Elementwise finiteness test (neither infinite nor NaN); output as `eq`. Integer inputs are finite everywhere. |
| [isinf](isinf.md) | [common]<br>fun [isinf](isinf.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`isinf(input: Tensor)`: the `isinf` operator. Elementwise infinity test (either sign); output as `eq`. |
| [isnan](isnan.md) | [common]<br>fun [isnan](isnan.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`isnan(input: Tensor)`: the `isnan` operator. Elementwise NaN test; output as `eq`. |
| [isneginf](isneginf.md) | [common]<br>fun [isneginf](isneginf.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`isneginf(input: Tensor)`: the `isneginf` operator. Elementwise `-inf` test; output as `eq`. |
| [isposinf](isposinf.md) | [common]<br>fun [isposinf](isposinf.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`isposinf(input: Tensor)`: the `isposinf` operator. Elementwise `+inf` test; output as `eq`. |
| [klDiv](klDiv.md) | [common]<br>fun [klDiv](klDiv.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN, logTarget: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`klDiv(input: Tensor, target: Tensor, reduction: Reduction = Reduction.MEAN, logTarget: Boolean = false)`: the `kl_div` operator. Kullback–Leibler divergence loss. `input` is given in LOG space; `target` is probabilities unless `log_target` is set (then both are logs): |
| [kron](kron.md) | [common]<br>fun [kron](kron.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`kron(input: Tensor, other: Tensor)`: the `kron` operator. Kronecker product of two same-rank tensors. Output dim `i` is `input.shape[i] * b.shape[i]`; each `input` element scales a full copy of `other` into its block. |
| [kthvalue](kthvalue.md) | [common]<br>fun [kthvalue](kthvalue.md)(input: [Tensor](../Tensor/index.md), k: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`kthvalue(input: Tensor, k: Long, dim: Long = -1L, keepdim: Boolean = false)`: the `kthvalue` operator. |
| [l1Loss](l1Loss.md) | [common]<br>fun [l1Loss](l1Loss.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN): [Tensor](../Tensor/index.md)<br>`l1Loss(input: Tensor, target: Tensor, reduction: Reduction = Reduction.MEAN)`: the `l1_loss` operator. Mean-absolute-error loss between `input` and `target`. |
| [layerNorm](layerNorm.md) | [common]<br>fun [layerNorm](layerNorm.md)(input: [Tensor](../Tensor/index.md), normalizedShape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), weight: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`layerNorm(input: Tensor, normalizedShape: LongArray, weight: Tensor? = null, bias: Tensor? = null, eps: Double? = null, activation: Activation? = null)`: the `layer_norm` operator. Layer normalization over the trailing `normalized_shape` dims of `input`. Statistics are computed per position over the trailing `normalized_shape` dims (channels-last layout, `[N, .., C]`). The output keeps `input`'s shape AND dtype. An optional `activation` is fused onto the post-affine value (gated kinds are not accepted here). |
| [le](le.md) | [common]<br>fun [le](le.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`le(input: Tensor, other: Tensor)`: the `le` operator. Elementwise `a <= other`; output as `eq`.<br>[common]<br>fun [le](le.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`le(input: Tensor, other: Double)`: the number form of `le`, `other` as a scalar. |
| [leakyRelu](leakyRelu.md) | [common]<br>fun [leakyRelu](leakyRelu.md)(input: [Tensor](../Tensor/index.md), negativeSlope: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.01): [Tensor](../Tensor/index.md)<br>`leakyRelu(input: Tensor, negativeSlope: Double = 0.01)`: the `leaky_relu` operator. ReLU with a small slope on the negative side. |
| [leakyReluInPlace](leakyReluInPlace.md) | [common]<br>fun [leakyReluInPlace](leakyReluInPlace.md)(self: [Tensor](../Tensor/index.md), negativeSlope: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.01): [Tensor](../Tensor/index.md)<br>`leakyReluInPlace(self: Tensor, negativeSlope: Double = 0.01)`: the `leaky_relu_` operator. In-place `leaky_relu`: writes the result through `self`; same formula, arguments, and error conditions as `leaky_relu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [leInPlace](leInPlace.md) | [common]<br>fun [leInPlace](leInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`leInPlace(self: Tensor, other: Tensor)`: the `le_` operator. In-place `le`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [leInPlace](leInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`leInPlace(self: Tensor, other: Double)`: the number form of `le_`, `other` as a scalar. |
| [linear](linear.md) | [common]<br>fun [linear](linear.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, activation: [Activation](../Activation/index.md)? = null, situBeta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0, situLinearBeta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0): [Tensor](../Tensor/index.md)<br>`linear(input: Tensor, weight: Tensor, bias: Tensor? = null, activation: Activation? = null, situBeta: Double = 0.0, situLinearBeta: Double = 0.0)`: the `linear` operator. `x @ weightᵀ (+ bias)`; `weight` in the `[out, in]` Linear layout. Same situ contract as `matmul`: `Activation::Situ` transforms both halves of the gate‖up projection under the two soft-caps (`situ_beta` = β, `situ_linear_beta` = lβ, both 0, from the model's config); either scalar with any other activation rejects. |
| [linspace](linspace.md) | [common]<br>fun [linspace](linspace.md)(start: [Tensor](../Tensor/index.md), end: [Tensor](../Tensor/index.md), steps: [Tensor](../Tensor/index.md), dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`linspace(start: Tensor, end: Tensor, steps: Tensor, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the `linspace` operator. `steps` evenly spaced values from `start` to `end`, ENDPOINTS INCLUDED. `out[i] = start + i * (end - start) / (steps - 1)`; the last element is exactly `end`; `steps = 1` yields just `start`. Contrast `arange`, whose upper bound is exclusive. Bounds and count are literals or 0-D Tensors (trace symbolically).<br>[common]<br>fun [linspace](linspace.md)(start: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), end: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), steps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`linspace(start: Double, end: Double, steps: Double, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the number form of `linspace`, `start`, `end`, `steps` as scalars. |
| [log](log.md) | [common]<br>fun [log](log.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`log(input: Tensor)`: the `log` operator. Elementwise natural logarithm. Zero produces -inf; negative inputs produce NaN. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [log10](log10.md) | [common]<br>fun [log10](log10.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`log10(input: Tensor)`: the `log10` operator. Elementwise base-10 logarithm. Zero produces -inf; negative inputs produce NaN. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [log10InPlace](log10InPlace.md) | [common]<br>fun [log10InPlace](log10InPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`log10InPlace(self: Tensor)`: the `log10_` operator. In-place `log10`: writes the result through `self`; same formula, arguments, and error conditions as `log10()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [log1p](log1p.md) | [common]<br>fun [log1p](log1p.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`log1p(input: Tensor)`: the `log1p` operator. Elementwise `log(1 + x)`, accurate for small `input`. Inputs below `-1` produce NaN; exactly `-1` produces -inf. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [log1pInPlace](log1pInPlace.md) | [common]<br>fun [log1pInPlace](log1pInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`log1pInPlace(self: Tensor)`: the `log1p_` operator. In-place `log1p`: writes the result through `self`; same formula, arguments, and error conditions as `log1p()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [log2](log2.md) | [common]<br>fun [log2](log2.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`log2(input: Tensor)`: the `log2` operator. Elementwise base-2 logarithm. Zero produces -inf; negative inputs produce NaN. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [log2InPlace](log2InPlace.md) | [common]<br>fun [log2InPlace](log2InPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`log2InPlace(self: Tensor)`: the `log2_` operator. In-place `log2`: writes the result through `self`; same formula, arguments, and error conditions as `log2()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [logaddexp](logaddexp.md) | [common]<br>fun [logaddexp](logaddexp.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logaddexp(input: Tensor, other: Tensor)`: the `logaddexp` operator. Elementwise , computed overflow-safely (the log-domain accumulation primitive). Broadcasts and promotes as `add`. |
| [logaddexp2](logaddexp2.md) | [common]<br>fun [logaddexp2](logaddexp2.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logaddexp2(input: Tensor, other: Tensor)`: the `logaddexp2` operator. Elementwise , `logaddexp` in base 2. Broadcasts and promotes as `add`. |
| [logicalAnd](logicalAnd.md) | [common]<br>fun [logicalAnd](logicalAnd.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logicalAnd(input: Tensor, other: Tensor)`: the `logical_and` operator. Elementwise logical AND; non-Bool inputs read as `element != 0` before the logic, and the output is always `Bool` (output as `eq`). |
| [logicalAndInPlace](logicalAndInPlace.md) | [common]<br>fun [logicalAndInPlace](logicalAndInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logicalAndInPlace(self: Tensor, other: Tensor)`: the `logical_and_` operator. In-place `logical_and`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain. |
| [logicalNot](logicalNot.md) | [common]<br>fun [logicalNot](logicalNot.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logicalNot(input: Tensor)`: the `logical_not` operator. Elementwise logical NOT (`element == 0`); output as `eq`. |
| [logicalNotInPlace](logicalNotInPlace.md) | [common]<br>fun [logicalNotInPlace](logicalNotInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logicalNotInPlace(self: Tensor)`: the `logical_not_` operator. In-place `logical_not`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain. |
| [logicalOr](logicalOr.md) | [common]<br>fun [logicalOr](logicalOr.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logicalOr(input: Tensor, other: Tensor)`: the `logical_or` operator. Elementwise logical OR (non-Bool inputs read as `!= 0`); output as `eq`. |
| [logicalOrInPlace](logicalOrInPlace.md) | [common]<br>fun [logicalOrInPlace](logicalOrInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logicalOrInPlace(self: Tensor, other: Tensor)`: the `logical_or_` operator. In-place `logical_or`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain. |
| [logicalXor](logicalXor.md) | [common]<br>fun [logicalXor](logicalXor.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logicalXor(input: Tensor, other: Tensor)`: the `logical_xor` operator. Elementwise logical XOR (non-Bool inputs read as `!= 0`); output as `eq`. |
| [logicalXorInPlace](logicalXorInPlace.md) | [common]<br>fun [logicalXorInPlace](logicalXorInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logicalXorInPlace(self: Tensor, other: Tensor)`: the `logical_xor_` operator. In-place `logical_xor`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain. |
| [logInPlace](logInPlace.md) | [common]<br>fun [logInPlace](logInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logInPlace(self: Tensor)`: the `log_` operator. In-place `log`: writes the result through `self`; same formula, arguments, and error conditions as `log()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [logit](logit.md) | [common]<br>fun [logit](logit.md)(input: [Tensor](../Tensor/index.md), eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`logit(input: Tensor, eps: Double? = null)`: the `logit` operator. Elementwise log-odds. With `eps` set, the input is first clipped to `[eps, 1 - eps]`; absent means no clipping, so inputs outside `(0, 1)` produce NaN / ±inf per IEEE semantics. |
| [logitInPlace](logitInPlace.md) | [common]<br>fun [logitInPlace](logitInPlace.md)(self: [Tensor](../Tensor/index.md), eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`logitInPlace(self: Tensor, eps: Double? = null)`: the `logit_` operator. In-place `logit`: writes the result through `self`; same formula, arguments, and error conditions as `logit()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [logSigmoid](logSigmoid.md) | [common]<br>fun [logSigmoid](logSigmoid.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logSigmoid(input: Tensor)`: the `log_sigmoid` operator. Logarithm of the sigmoid, computed stably. |
| [logSigmoidInPlace](logSigmoidInPlace.md) | [common]<br>fun [logSigmoidInPlace](logSigmoidInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`logSigmoidInPlace(self: Tensor)`: the `log_sigmoid_` operator. In-place `log_sigmoid`: writes the result through `self`; same formula, arguments, and error conditions as `log_sigmoid()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [logSoftmax](logSoftmax.md) | [common]<br>fun [logSoftmax](logSoftmax.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`logSoftmax(input: Tensor, dim: Long = -1L, dtype: DType = DType.UNDEFINED)`: the `log_softmax` operator. Logarithm of the softmax along `dim`, computed stably (never `log(softmax(x))` in two passes). |
| [logSoftmaxInPlace](logSoftmaxInPlace.md) | [common]<br>fun [logSoftmaxInPlace](logSoftmaxInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L): [Tensor](../Tensor/index.md)<br>`logSoftmaxInPlace(self: Tensor, dim: Long = -1L)`: the `log_softmax_` operator. In-place `log_softmax`: writes the result through `self`; same formula, arguments, and error conditions as `log_softmax()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [logsumexp](logsumexp.md) | [common]<br>fun [logsumexp](logsumexp.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`logsumexp(input: Tensor, dims: LongArray, keepdim: Boolean = false)`: the `logsumexp` operator. Numerically stable `log(sum(exp(x)))` over `dims`. Computed with the max-shift trick, so large magnitudes do not overflow. `dims` is required here (no reduce-all default). |
| [lt](lt.md) | [common]<br>fun [lt](lt.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`lt(input: Tensor, other: Tensor)`: the `lt` operator. Elementwise `a < other`; output as `eq`.<br>[common]<br>fun [lt](lt.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`lt(input: Tensor, other: Double)`: the number form of `lt`, `other` as a scalar. |
| [ltInPlace](ltInPlace.md) | [common]<br>fun [ltInPlace](ltInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`ltInPlace(self: Tensor, other: Tensor)`: the `lt_` operator. In-place `lt`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [ltInPlace](ltInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`ltInPlace(self: Tensor, other: Double)`: the number form of `lt_`, `other` as a scalar. |
| [maskedFill](maskedFill.md) | [common]<br>fun [maskedFill](maskedFill.md)(input: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`maskedFill(input: Tensor, mask: Tensor, value: Tensor)`: the `masked_fill` operator. Replace the elements of `input` where `mask` is true with `value`. `mask` is Bool and broadcasts to `input`'s shape; `value` is a literal or a 0-D Tensor.<br>[common]<br>fun [maskedFill](maskedFill.md)(input: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md), value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`maskedFill(input: Tensor, mask: Tensor, value: Double)`: the number form of `masked_fill`, `value` as a scalar. |
| [maskedFillInPlace](maskedFillInPlace.md) | [common]<br>fun [maskedFillInPlace](maskedFillInPlace.md)(self: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`maskedFillInPlace(self: Tensor, mask: Tensor, value: Tensor)`: the `masked_fill_` operator. In-place `masked_fill`: writes `value` through `self` where `mask` is true; same arguments and error conditions as `masked_fill()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [maskedFillInPlace](maskedFillInPlace.md)(self: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md), value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`maskedFillInPlace(self: Tensor, mask: Tensor, value: Double)`: the number form of `masked_fill_`, `value` as a scalar. |
| [maskedScatter](maskedScatter.md) | [common]<br>fun [maskedScatter](maskedScatter.md)(input: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md), source: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`maskedScatter(input: Tensor, mask: Tensor, source: Tensor)`: the `masked_scatter` operator. A copy of `input` with the leading `count(mask)` elements of `src` (read row-major) written at the positions where `mask` is true. `mask` is Bool, broadcastable to `input`; `src` must supply at least `count(mask)` elements. |
| [maskedScatterInPlace](maskedScatterInPlace.md) | [common]<br>fun [maskedScatterInPlace](maskedScatterInPlace.md)(self: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md), source: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`maskedScatterInPlace(self: Tensor, mask: Tensor, source: Tensor)`: the `masked_scatter_` operator. In-place `masked_scatter`: writes `src`'s leading elements through `self` where `mask` is true; same arguments and error conditions as `masked_scatter()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [maskedSelect](maskedSelect.md) | [common]<br>fun [maskedSelect](maskedSelect.md)(input: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`maskedSelect(input: Tensor, mask: Tensor)`: the `masked_select` operator. The elements of `input` where `mask` is true, as a 1-D tensor. The output LENGTH is data-dependent (the number of true entries); under tracing it carries a data-dependent extent. `mask` is Bool and broadcasts to `input`'s shape. |
| [matmul](matmul.md) | [common]<br>fun [matmul](matmul.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, activation: [Activation](../Activation/index.md)? = null, transposeA: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, transposeB: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, situBeta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0, situLinearBeta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0): [Tensor](../Tensor/index.md)<br>`matmul(input: Tensor, other: Tensor, bias: Tensor? = null, activation: Activation? = null, transposeA: Boolean = false, transposeB: Boolean = false, situBeta: Double = 0.0, situLinearBeta: Double = 0.0)`: the `matmul` operator. `a @ b (+ bias)` with an optional fused activation epilogue. A gated `activation` (`SwiGlu`/`GeGlu`/`ReGlu`/`Situ`) takes the product as a concatenated `[*, 2d]` gate‖up projection and emits `[*, d]` in one pass. `situ_beta`/`situ_linear_beta` are `Activation::Situ`'s two soft-cap scalars (β and lβ in `β·tanh(gate/β)·sigmoid(gate) · lβ·tanh(up/lβ)`); pass the model's own config values. `Situ` requires BOTH 0, and either scalar with any other activation rejects (it would otherwise be silently ignored). The transform computes at fp32 end-to-end with one demote at the store for f16/bf16 outputs. |
| [max](max.md) | [common]<br>fun [max](max.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`max(input: Tensor, dim: Long, keepdim: Boolean = false)`: the `max` operator. |
| [maximum](maximum.md) | [common]<br>fun [maximum](maximum.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`maximum(input: Tensor, other: Tensor)`: the `maximum` operator. Elementwise maximum, NaN-PROPAGATING: a NaN in either operand yields NaN (use `ops::fmax` for the NaN-ignoring IEEE law). Broadcasts and promotes as `add`. |
| [maximumInPlace](maximumInPlace.md) | [common]<br>fun [maximumInPlace](maximumInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`maximumInPlace(self: Tensor, other: Tensor)`: the `maximum_` operator. In-place `maximum`: writes the elementwise maxima through `x`. Writes through `self` and returns it, so calls chain. |
| [maxPool](maxPool.md) | [common]<br>fun [maxPool](maxPool.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [Tensor](../Tensor/index.md)<br>`maxPool(input: Tensor, kernelSize: LongArray, stride: LongArray, padding: LongArray, dilation: LongArray, ceilMode: Boolean)`: the `max_pool` operator. Rank-generic max pooling, channels-last. `input` is `[N, D1..Dn, C]`; the window rank is read from `kernel_size`'s length. Each output element is the maximum over its window; padding never wins. A window holding any NaN element yields NaN, and a window lying wholly in the padding yields -inf for a float dtype and the type minimum for an integer one. |
| [maxPool1d](maxPool1d.md) | [common]<br>fun [maxPool1d](maxPool1d.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`maxPool1d(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0), dilation: LongArray = longArrayOf(1), ceilMode: Boolean = false)`: the `max_pool1d` operator. 1-D max pooling over `[N, L, C]` (channels-last). See `max_pool` for the window semantics; `stride` empty = `kernel_size`. |
| [maxPool1dWithIndices](maxPool1dWithIndices.md) | [common]<br>fun [maxPool1dWithIndices](maxPool1dWithIndices.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`maxPool1dWithIndices(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0), dilation: LongArray = longArrayOf(1), ceilMode: Boolean = false)`: the `max_pool1d_with_indices` operator. |
| [maxPool2d](maxPool2d.md) | [common]<br>fun [maxPool2d](maxPool2d.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`maxPool2d(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0, 0), dilation: LongArray = longArrayOf(1, 1), ceilMode: Boolean = false)`: the `max_pool2d` operator. 2-D max pooling over `[N, H, W, C]` (channels-last). Each output element is the max over its `kernel_size` window; `stride` empty defaults to `kernel_size` (non-overlapping windows); `dilation` spaces the window's taps; `ceil_mode` rounds the output extents up. |
| [maxPool2dWithIndices](maxPool2dWithIndices.md) | [common]<br>fun [maxPool2dWithIndices](maxPool2dWithIndices.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`maxPool2dWithIndices(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0, 0), dilation: LongArray = longArrayOf(1, 1), ceilMode: Boolean = false)`: the `max_pool2d_with_indices` operator. |
| [maxPool3d](maxPool3d.md) | [common]<br>fun [maxPool3d](maxPool3d.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0, 0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1, 1), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`maxPool3d(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0, 0, 0), dilation: LongArray = longArrayOf(1, 1, 1), ceilMode: Boolean = false)`: the `max_pool3d` operator. 3-D max pooling over `[N, D, H, W, C]` (channels-last). See `max_pool2d`; parameters extend to `{kD, kH, kW}` etc. |
| [maxPool3dWithIndices](maxPool3dWithIndices.md) | [common]<br>fun [maxPool3dWithIndices](maxPool3dWithIndices.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 0, 0), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(1, 1, 1), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`maxPool3dWithIndices(input: Tensor, kernelSize: LongArray, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(0, 0, 0), dilation: LongArray = longArrayOf(1, 1, 1), ceilMode: Boolean = false)`: the `max_pool3d_with_indices` operator. |
| [maxPoolWithIndices](maxPoolWithIndices.md) | [common]<br>fun [maxPoolWithIndices](maxPoolWithIndices.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`maxPoolWithIndices(input: Tensor, kernelSize: LongArray, stride: LongArray, padding: LongArray, dilation: LongArray, ceilMode: Boolean)`: the `max_pool_with_indices` operator. Max pooling that also returns each window's winning element as a flat index over the input's spatial extents (per plane, the same for every channel). The values follow `max_pool`. The index names the window's lowest-index NaN element when it holds one, else the first element holding the max (a tie keeps the lowest index); a window lying wholly in the padding reports -1. |
| [mean](mean.md) | [common]<br>fun [mean](mean.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`mean(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false, dtype: DType = DType.UNDEFINED)`: the `mean` operator. Arithmetic mean of `input` over `dims`. Empty `dims` averages every element. `dtype` selects the output (and accumulation) dtype; the default keeps `input`'s. |
| [median](median.md) | [common]<br>fun [median](median.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`median(input: Tensor, dim: Long? = null, keepdim: Boolean = false)`: the `median` operator. |
| [meshgrid](meshgrid.md) | [common]<br>fun [meshgrid](meshgrid.md)(tensors: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;, indexing: [MeshgridIndexing](../MeshgridIndexing/index.md) = MeshgridIndexing.IJ): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`meshgrid(tensors: List<Tensor>, indexing: MeshgridIndexing = MeshgridIndexing.IJ)`: the `meshgrid` operator. Coordinate grids from 1-D axes: N inputs produce N N-D tensors, each input broadcast over every other axis, the NumPy `meshgrid`. With `MeshgridIndexing::IJ` (matrix indexing, the default) the output shapes follow the input order `[len0, len1, ..]`; `XY` (Cartesian) swaps the first two axes. |
| [min](min.md) | [common]<br>fun [min](min.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`min(input: Tensor, dim: Long, keepdim: Boolean = false)`: the `min` operator. |
| [minimum](minimum.md) | [common]<br>fun [minimum](minimum.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`minimum(input: Tensor, other: Tensor)`: the `minimum` operator. Elementwise minimum, NaN-PROPAGATING (the `maximum` dual; use `ops::fmin` for NaN-ignoring). Broadcasts and promotes as `add`. |
| [minimumInPlace](minimumInPlace.md) | [common]<br>fun [minimumInPlace](minimumInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`minimumInPlace(self: Tensor, other: Tensor)`: the `minimum_` operator. In-place `minimum`: writes the elementwise minima through `x`. Writes through `self` and returns it, so calls chain. |
| [mish](mish.md) | [common]<br>fun [mish](mish.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`mish(input: Tensor)`: the `mish` operator. Mish activation. |
| [mishInPlace](mishInPlace.md) | [common]<br>fun [mishInPlace](mishInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`mishInPlace(self: Tensor)`: the `mish_` operator. In-place `mish`: writes the result through `self`; same formula, arguments, and error conditions as `mish()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [mlaAttention](mlaAttention.md) | [common]<br>fun [mlaAttention](mlaAttention.md)(qNope: [Tensor](../Tensor/index.md), qPe: [Tensor](../Tensor/index.md), newCkv: [Tensor](../Tensor/index.md), newKpe: [Tensor](../Tensor/index.md), ckvCache: [Tensor](../Tensor/index.md), kpeCache: [Tensor](../Tensor/index.md), kvcacheStart: [Tensor](../Tensor/index.md), cuSeqlensQ: [Tensor](../Tensor/index.md), scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), slotIds: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`mlaAttention(qNope: Tensor, qPe: Tensor, newCkv: Tensor, newKpe: Tensor, ckvCache: Tensor, kpeCache: Tensor, kvcacheStart: Tensor, cuSeqlensQ: Tensor, scale: Double, slotIds: Tensor? = null)`: the `mla_attention` operator. Multi-head Latent Attention over a compressed KV cache, latent-space end to end: q_nope `[ΣS, H, Dl]` (W_UK-absorbed) + q_pe `[ΣS, H, Dr]` score against the per-token compressed rows; the caches (`[max_seqs, max_seq, Dl/Dr]`) take this step's `new_ckv`/`new_kpe` appends IN PLACE (write offsets = `kvcache_start [B]` Int32; `cu_seqlens_q [B+1]` locates each sequence's packed tokens); the returned `[ΣS, H, Dl]` output stays latent (apply the W_UV un-absorption after). `scale` is REQUIRED; the absorbed query's magnitude lives in the model's un-absorbed head dim. |
| [mm](mm.md) | [common]<br>fun [mm](mm.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`mm(input: Tensor, other: Tensor, bias: Tensor? = null, activation: Activation? = null)`: the `mm` operator. Matrix multiply of two rank-2 tensors, with an optional fused bias and activation epilogue. `a [M, K] x b [K, N] -> [M, N]`. Inputs must be rank-2 (use `bmm` for batched operands, `matmul` for the broadcasting general form). |
| [mod](mod.md) | [common]<br>fun [mod](mod.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), mode: [ModMode](../ModMode/index.md) = ModMode.PYTHON): [Tensor](../Tensor/index.md)<br>`mod(input: Tensor, other: Tensor, mode: ModMode = ModMode.PYTHON)`: the `mod` operator. Elementwise modulo with a selectable sign convention. `ModMode::Python` (default) follows the DIVISOR's sign; `ModMode::C` follows the DIVIDEND's. `ops::remainder` is exactly the Python form, `ops::fmod` exactly the C form. Broadcasts and promotes as `add`.<br>[common]<br>fun [mod](mod.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), mode: [ModMode](../ModMode/index.md) = ModMode.PYTHON): [Tensor](../Tensor/index.md)<br>`mod(input: Tensor, other: Double, mode: ModMode = ModMode.PYTHON)`: the number form of `mod`, `other` as a scalar. |
| [modInPlace](modInPlace.md) | [common]<br>fun [modInPlace](modInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), mode: [ModMode](../ModMode/index.md) = ModMode.PYTHON): [Tensor](../Tensor/index.md)<br>`modInPlace(self: Tensor, other: Tensor, mode: ModMode = ModMode.PYTHON)`: the `mod_` operator. In-place `mod`: writes the remainders through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [modInPlace](modInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), mode: [ModMode](../ModMode/index.md) = ModMode.PYTHON): [Tensor](../Tensor/index.md)<br>`modInPlace(self: Tensor, other: Double, mode: ModMode = ModMode.PYTHON)`: the number form of `mod_`, `other` as a scalar. |
| [moe](moe.md) | [common]<br>fun [moe](moe.md)(input: [Tensor](../Tensor/index.md), routerLogits: [Tensor](../Tensor/index.md), fc1Experts: [Tensor](../Tensor/index.md), fc2Experts: [Tensor](../Tensor/index.md), topK: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), fc1Bias: [Tensor](../Tensor/index.md)? = null, fc2Bias: [Tensor](../Tensor/index.md)? = null, fc3Experts: [Tensor](../Tensor/index.md)? = null, fc3Bias: [Tensor](../Tensor/index.md)? = null, eScoreCorrectionBias: [Tensor](../Tensor/index.md)? = null, routerWeights: [Tensor](../Tensor/index.md)? = null, routingMode: [MoeRouting](../MoeRouting/index.md)? = null, renormalize: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, nGroup: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, topkGroup: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, routedScalingFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, sparseMixerEps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, applyRouterWeightOnInput: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, activation: [Activation](../Activation/index.md)? = null, swigluFusion: [SwigluFusion](../SwigluFusion/index.md)? = null, swigluAlpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, swigluBeta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, swigluLimit: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, geluMode: [GeluMode](../GeluMode/index.md)? = null, sharedOutput: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`moe(input: Tensor, routerLogits: Tensor, fc1Experts: Tensor, fc2Experts: Tensor, topK: Long, fc1Bias: Tensor? = null, fc2Bias: Tensor? = null, fc3Experts: Tensor? = null, fc3Bias: Tensor? = null, eScoreCorrectionBias: Tensor? = null, routerWeights: Tensor? = null, routingMode: MoeRouting? = null, renormalize: Boolean? = null, nGroup: Long? = null, topkGroup: Long? = null, routedScalingFactor: Double? = null, sparseMixerEps: Double? = null, applyRouterWeightOnInput: Boolean? = null, activation: Activation? = null, swigluFusion: SwigluFusion? = null, swigluAlpha: Double? = null, swigluBeta: Double? = null, swigluLimit: Double? = null, geluMode: GeluMode? = null, sharedOutput: Tensor? = null)`: the `moe` operator. Fused Mixture-of-Experts layer: route, run the top-k experts, combine in one call, with no per-expert dispatch from the caller. Per token, `router_logits [T, E]` select `top_k` experts under `routing_mode`; each selected expert applies its own MLP (`fc1 [E, F·I, H]` → activation → `fc2 [E, H, I]`, with `F` = 2 for a gated activation, else 1, and an optional multiplicative `fc3 [E, I, H]` branch); the expert outputs combine under the routing weights. `input` is `[T, H]`; the result is `[T, H]` at `input`'s dtype. Per-expert biases ride `fc1_bias` / `fc2_bias` / `fc3_bias`; `e_score_correction_bias` and `n_group` / `topk_group` / `routed_scaling_factor` serve the group-limited routing families; `router_weights` feeds `MoeRouting::PreComputed` (caller-supplied combine weights); `sparse_mixer_eps` tunes `MoeRouting::SparseMixer`. The gated-activation scalars (`swiglu_*`, `gelu_mode`) carry their `swiglu` / `geglu` meanings; `shared_output [T, H]` folds a shared-expert branch into the final combine. A config argument left `std::nullopt` takes the runtime default (SoftmaxTopK routing, renormalized top-k weights). |
| [mropeRotaryEmbedding](mropeRotaryEmbedding.md) | [common]<br>fun [mropeRotaryEmbedding](mropeRotaryEmbedding.md)(input: [Tensor](../Tensor/index.md), positionIds: [Tensor](../Tensor/index.md), mropeSections: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), interleavedSections: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, mode: [RotaryMode](../RotaryMode/index.md)? = null, rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`mropeRotaryEmbedding(input: Tensor, positionIds: Tensor, mropeSections: LongArray, interleavedSections: Boolean? = null, theta: Double? = null, scaling: RopeScaling? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, scale: Double? = null)`: the `mrope_rotary_embedding` operator. Multi-section rotary position embedding over padded layouts. Multi-section RoPE (the multimodal form): the head dimension is split into `mrope_sections`, and each section takes its angles from its OWN row of `position_ids` (e.g. temporal/height/width position streams). `interleaved_sections` picks the section layout; `theta` overrides the frequency base. |
| [mropeRotaryEmbeddingQkVarlen](mropeRotaryEmbeddingQkVarlen.md) | [common]<br>fun [mropeRotaryEmbeddingQkVarlen](mropeRotaryEmbeddingQkVarlen.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), positionIds: [Tensor](../Tensor/index.md), mropeSections: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), interleavedSections: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, mode: [RotaryMode](../RotaryMode/index.md)? = null, rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`mropeRotaryEmbeddingQkVarlen(query: Tensor, key: Tensor, positionIds: Tensor, mropeSections: LongArray, interleavedSections: Boolean? = null, theta: Double? = null, scaling: RopeScaling? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, scale: Double? = null)`: the `mrope_rotary_embedding_qk_varlen` operator. Multi-axis RoPE over a packed q/k pair: ONE per-token angle table serves both projections in a single call, the media-prefill pre-rotation shape. `query`/`key` are head-exposed `[n_tokens, heads, head_dim]` (a flat `[n_tokens, heads·head_dim]` projection reshapes to it as a free view; the rotation spans the TRAILING dim, so a flat row would rotate across head boundaries); `position_ids` is `[n_axes, n_tokens]` with `n_axes == mrope_sections.size()` (strip any trailing zero sections a checkpoint's metadata pads; the axis count follows the section list); `rotary_dim` bounds the rotated span (dims beyond it pass through) and defaults to the trailing dim. Rows whose per-axis positions are all EQUAL rotate exactly as the plain ops do; serve pure-text calls through `rotary_embedding*` (cheaper: no per-token table), and use this form for packs whose rows carry genuinely multi-axis positions, then attend with the rope inputs ABSENT so the attention op consumes (and appends) q/k exactly as given. |
| [mropeRotaryEmbeddingVarlen](mropeRotaryEmbeddingVarlen.md) | [common]<br>fun [mropeRotaryEmbeddingVarlen](mropeRotaryEmbeddingVarlen.md)(input: [Tensor](../Tensor/index.md), positionIds: [Tensor](../Tensor/index.md), mropeSections: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), interleavedSections: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, mode: [RotaryMode](../RotaryMode/index.md)? = null, rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`mropeRotaryEmbeddingVarlen(input: Tensor, positionIds: Tensor, mropeSections: LongArray, interleavedSections: Boolean? = null, theta: Double? = null, scaling: RopeScaling? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, scale: Double? = null)`: the `mrope_rotary_embedding_varlen` operator. Multi-section rotary position embedding over token-packed layouts (`cu_seqlens``[B+1]` Int32, as in `rotary_embedding_varlen`). Multi-section RoPE (the multimodal form): the head dimension is split into `mrope_sections`, and each section takes its angles from its OWN row of `position_ids` (e.g. temporal/height/width position streams). `interleaved_sections` picks the section layout; `theta` overrides the frequency base. |
| [msDeformAttention](msDeformAttention.md) | [common]<br>fun [msDeformAttention](msDeformAttention.md)(value: [Tensor](../Tensor/index.md), spatialShapes: [Tensor](../Tensor/index.md), levelStartIndex: [Tensor](../Tensor/index.md), samplingLocations: [Tensor](../Tensor/index.md), attentionWeights: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`msDeformAttention(value: Tensor, spatialShapes: Tensor, levelStartIndex: Tensor, samplingLocations: Tensor, attentionWeights: Tensor)`: the `ms_deform_attention` operator. Multi-scale deformable attention (2-D): per query and head, gather `P` bilinear samples from each of `L` flattened feature-map levels and combine them with the given weights. `value [N, S, M, D]` with `S = Σ_l H_l·W_l`; `spatial_shapes [L, 2]` = per-level `(H_l, W_l)` and `level_start_index [L]` (both Int32 or Int64); `sampling_locations [N, Lq, M, L, P, 2]`; last dim `(x, y)`, normalized to `[0, 1]` per level, sampled at `loc·size − 0.5` (bilinear; out-of-bounds reads 0); `attention_weights [N, Lq, M, L, P]` are consumed AS GIVEN (apply softmax beforehand if wanted). Returns `[N, Lq, M, D]` at `value`'s dtype; accumulation is fp32. The float inputs must share `value`'s dtype (f32/f64/f16/bf16; no silent promotion). |
| [mseLoss](mseLoss.md) | [common]<br>fun [mseLoss](mseLoss.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN): [Tensor](../Tensor/index.md)<br>`mseLoss(input: Tensor, target: Tensor, reduction: Reduction = Reduction.MEAN)`: the `mse_loss` operator. Mean-squared-error loss between `input` and `target`. `Reduction::None` returns the per-element losses (shape of `input`); `Mean` / `Sum` reduce to a 0-D scalar. |
| [mul](mul.md) | [common]<br>fun [mul](mul.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`mul(input: Tensor, other: Tensor, activation: Activation = Activation.IDENTITY)`: the `mul` operator. Multiplies `input` by `other` elementwise. Broadcasts and promotes as `add`; `activation` is the same fused float-only epilogue (default `Activation::Identity`).<br>[common]<br>fun [mul](mul.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`mul(input: Tensor, other: Double, activation: Activation = Activation.IDENTITY)`: the number form of `mul`, `other` as a scalar.<br>[common]<br>fun [mul](mul.md)(input: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), other: [Tensor](../Tensor/index.md), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`mul(input: Double, other: Tensor, activation: Activation = Activation.IDENTITY)`: the `mul` operator. Scalar-LHS . `input` keeps its kind (see `Scalar`). `activation` applies to the result, mirroring the tensor-first form (mul carries no alpha; it would fold into the scalar). |
| [mulInPlace](mulInPlace.md) | [common]<br>fun [mulInPlace](mulInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`mulInPlace(self: Tensor, other: Tensor, activation: Activation = Activation.IDENTITY)`: the `mul_` operator. In-place `mul`: writes through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [mulInPlace](mulInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`mulInPlace(self: Tensor, other: Double, activation: Activation = Activation.IDENTITY)`: the number form of `mul_`, `other` as a scalar. |
| [multinomial](multinomial.md) | [common]<br>fun [multinomial](multinomial.md)(probabilities: [Tensor](../Tensor/index.md), numSamples: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), replacement: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`multinomial(probabilities: Tensor, numSamples: Long, replacement: Boolean = false, device: Placement? = null)`: the `multinomial` operator. Categorical sampling: draws `num_samples` category indices per row of a weight tensor. `probabilities` holds non-negative weights (they need not sum to 1), typically `[batch, num_categories]`; the output replaces the category axis with `num_samples` and is `Int64`. Without `replacement` each row samples distinct categories. |
| [mv](mv.md) | [common]<br>fun [mv](mv.md)(input: [Tensor](../Tensor/index.md), vec: [Tensor](../Tensor/index.md), bias: [Tensor](../Tensor/index.md)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`mv(input: Tensor, vec: Tensor, bias: Tensor? = null, activation: Activation? = null)`: the `mv` operator. Matrix-vector multiply, with an optional fused bias and activation. `a [M, K] x vec [K] -> [M]`. |
| [nanmean](nanmean.md) | [common]<br>fun [nanmean](nanmean.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`nanmean(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false)`: the `nanmean` operator. Mean over `dims`, treating NaN entries as missing. Each output element divides by the count of NON-NaN contributors (an all-NaN slice yields NaN). Float dtypes only. |
| [nanmedian](nanmedian.md) | [common]<br>fun [nanmedian](nanmedian.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`nanmedian(input: Tensor, dim: Long? = null, keepdim: Boolean = false)`: the `nanmedian` operator. |
| [nanquantile](nanquantile.md) | [common]<br>fun [nanquantile](nanquantile.md)(input: [Tensor](../Tensor/index.md), q: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, interpolation: [QuantileInterp](../QuantileInterp/index.md) = QuantileInterp.LINEAR): [Tensor](../Tensor/index.md)<br>`nanquantile(input: Tensor, q: Tensor, dim: Long? = null, keepdim: Boolean = false, interpolation: QuantileInterp = QuantileInterp.LINEAR)`: the `nanquantile` operator. `quantile` that treats NaN entries as missing; each slice's quantile is computed over its non-NaN values (an all-NaN slice yields NaN). Parameters and shapes as `quantile`.<br>[common]<br>fun [nanquantile](nanquantile.md)(input: [Tensor](../Tensor/index.md), q: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, interpolation: [QuantileInterp](../QuantileInterp/index.md) = QuantileInterp.LINEAR): [Tensor](../Tensor/index.md)<br>`nanquantile(input: Tensor, q: Double, dim: Long? = null, keepdim: Boolean = false, interpolation: QuantileInterp = QuantileInterp.LINEAR)`: the number form of `nanquantile`, `q` as a scalar. |
| [nansum](nansum.md) | [common]<br>fun [nansum](nansum.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`nansum(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false)`: the `nansum` operator. Sum over `dims`, treating NaN entries as missing (contributing zero). Float dtypes only carry NaN; for integer inputs this is plain `sum`. |
| [nanToNum](nanToNum.md) | [common]<br>fun [nanToNum](nanToNum.md)(input: [Tensor](../Tensor/index.md), nan: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, posinf: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, neginf: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`nanToNum(input: Tensor, nan: Double? = null, posinf: Double? = null, neginf: Double? = null)`: the `nan_to_num` operator. Replaces NaN and infinities with finite values. Each absent replacement falls back to the dtype-specific default: `0` for NaN, the dtype's largest finite value for `+inf`, its lowest for `-inf`. |
| [nanToNumInPlace](nanToNumInPlace.md) | [common]<br>fun [nanToNumInPlace](nanToNumInPlace.md)(self: [Tensor](../Tensor/index.md), nan: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, posinf: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, neginf: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`nanToNumInPlace(self: Tensor, nan: Double? = null, posinf: Double? = null, neginf: Double? = null)`: the `nan_to_num_` operator. In-place `nan_to_num`: writes the result through `self`; same formula, arguments, and error conditions as `nan_to_num()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [narrow](narrow.md) | [common]<br>fun [narrow](narrow.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), start: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), length: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [Tensor](../Tensor/index.md)<br>`narrow(input: Tensor, dim: Long, start: Long, length: Long)`: the `narrow` operator. `length` elements from `start` along `dim`. Both are int literals or 0-D integer Tensors (a tensor-valued window never syncs to the host). |
| [ndim](ndim.md) | [common]<br>fun [ndim](ndim.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`ndim(input: Tensor)`: the `ndim` operator. The tensor's rank as a 0-D Int64 tensor. The value is produced ON DEVICE and is traceable; under tracing it carries the symbolic value. For a plain host integer use the `*_host` sibling instead. |
| [ndimHost](ndimHost.md) | [common]<br>fun [ndimHost](ndimHost.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`ndimHost(input: Tensor)`: the `ndim_host` operator. The rank as a 0-D Int64 HOST tensor, written from metadata; the same no-sync contract as `shape_host`. |
| [ne](ne.md) | [common]<br>fun [ne](ne.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`ne(input: Tensor, other: Tensor)`: the `ne` operator. Elementwise `a != other`; output as `eq`.<br>[common]<br>fun [ne](ne.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`ne(input: Tensor, other: Double)`: the number form of `ne`, `other` as a scalar. |
| [neg](neg.md) | [common]<br>fun [neg](neg.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`neg(input: Tensor)`: the `neg` operator. Elementwise negation. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [negInPlace](negInPlace.md) | [common]<br>fun [negInPlace](negInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`negInPlace(self: Tensor)`: the `neg_` operator. In-place `neg`: writes the result through `self`; same formula, arguments, and error conditions as `neg()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [neInPlace](neInPlace.md) | [common]<br>fun [neInPlace](neInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`neInPlace(self: Tensor, other: Tensor)`: the `ne_` operator. In-place `ne`: writes the result through `x` (one/zero at `x`'s dtype). Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [neInPlace](neInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`neInPlace(self: Tensor, other: Double)`: the number form of `ne_`, `other` as a scalar. |
| [nllLoss](nllLoss.md) | [common]<br>fun [nllLoss](nllLoss.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null, ignoreIndex: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN): [Tensor](../Tensor/index.md)<br>`nllLoss(input: Tensor, target: Tensor, weight: Tensor? = null, ignoreIndex: Long? = null, reduction: Reduction = Reduction.MEAN)`: the `nll_loss` operator. Negative-log-likelihood loss over LOG-probabilities; class dim LAST. `input` is expected to already be log-probabilities (pair with `log_softmax`; `cross_entropy` is the fused form). |
| [nms](nms.md) | [common]<br>fun [nms](nms.md)(boxes: [Tensor](../Tensor/index.md), scores: [Tensor](../Tensor/index.md), maxOutputBoxesPerClass: [Tensor](../Tensor/index.md)? = null, iouThreshold: [Tensor](../Tensor/index.md)? = null, scoreThreshold: [Tensor](../Tensor/index.md)? = null, centerPointBox: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`nms(boxes: Tensor, scores: Tensor, maxOutputBoxesPerClass: Tensor? = null, iouThreshold: Tensor? = null, scoreThreshold: Tensor? = null, centerPointBox: Boolean = false)`: the `nms` operator. Batched, class-aware non-max suppression (argument order mirrors the ONNX operator). `boxes` is `[batch, num_boxes, 4]`; `scores` is `[batch, classes, num_boxes]`; returns the selected indices as an Int64 `[num_selected, 3]` of `(batch, class, box)` rows. Every threshold takes a literal OR a 0-D tensor (a tensor traces symbolically). An absent `max_output_boxes_per_class` selects NOTHING (the reference default); a negative cap clamps to 0. A literal `iou_threshold` outside 0, 1 raises. `center_point_box` picks the `[cx, cy, w, h]` box encoding over the corners form. |
| [nonzero](nonzero.md) | [common]<br>fun [nonzero](nonzero.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`nonzero(input: Tensor)`: the `nonzero` operator. Coordinates of the nonzero elements: an `[n, ndim]` Int64 matrix, one row per nonzero element of `input`. An element is nonzero exactly when its Bool cast is true: +0 and -0 are zero; a subnormal, an infinity and a NaN are nonzero. The row count is data-dependent (see `masked_select`); a 1-arg `where()` call is sugar for this op. |
| [norm](norm.md) | [common]<br>fun [norm](norm.md)(input: [Tensor](../Tensor/index.md), p: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 2.0, dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`norm(input: Tensor, p: Double = 2.0, dims: LongArray = longArrayOf(), keepdim: Boolean = false)`: the `norm` operator. The `p`-norm of `input` over `dims`. Empty `dims` reduces every dimension. |
| [normal](normal.md) | [common]<br>fun [normal](normal.md)(mean: [Tensor](../Tensor/index.md), stddev: [Tensor](../Tensor/index.md), shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`normal(mean: Tensor, stddev: Tensor, shape: LongArray, device: Placement? = null)`: the `normal` operator. Normal draws with the given mean and standard deviation. `mean` and `stddev` are scalars or tensors broadcast over `shape`.<br>[common]<br>fun [normal](normal.md)(mean: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), stddev: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`normal(mean: Double, stddev: Double, shape: LongArray, device: Placement? = null)`: the number form of `normal`, `mean`, `stddev` as scalars. |
| [normalInPlace](normalInPlace.md) | [common]<br>fun [normalInPlace](normalInPlace.md)(self: [Tensor](../Tensor/index.md), mean: [Tensor](../Tensor/index.md)? = null, stddev: [Tensor](../Tensor/index.md)? = null, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`normalInPlace(self: Tensor, mean: Tensor? = null, stddev: Tensor? = null, device: Placement? = null)`: the `normal_` operator. In-place normal fill: overwrites `self` with `N(mean, stddev^2)` draws at `self`'s shape/dtype and returns it under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [normalInPlace](normalInPlace.md)(self: [Tensor](../Tensor/index.md), mean: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0, stddev: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`normalInPlace(self: Tensor, mean: Double = 0.0, stddev: Double = 1.0, device: Placement? = null)`: the number form of `normal_`, `mean`, `stddev` as scalars. |
| [normalize](normalize.md) | [common]<br>fun [normalize](normalize.md)(input: [Tensor](../Tensor/index.md), p: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 2.0, dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`normalize(input: Tensor, p: Double = 2.0, dim: Long = 1L, eps: Double? = null)`: the `normalize` operator. L_p-normalizes `input` along `dim`: each slice is scaled to unit `p`-norm. |
| [normalizeInPlace](normalizeInPlace.md) | [common]<br>fun [normalizeInPlace](normalizeInPlace.md)(self: [Tensor](../Tensor/index.md), p: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 2.0, dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`normalizeInPlace(self: Tensor, p: Double = 2.0, dim: Long = 1L, eps: Double? = null)`: the `normalize_` operator. In-place `normalize`: rewrites `self` with its L_p-normalized value and returns it under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [numel](numel.md) | [common]<br>fun [numel](numel.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`numel(input: Tensor)`: the `numel` operator. The tensor's total element count as a 0-D Int64 tensor. The value is produced ON DEVICE and is traceable; under tracing it carries the symbolic value. For a plain host integer use the `*_host` sibling instead. |
| [numelHost](numelHost.md) | [common]<br>fun [numelHost](numelHost.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`numelHost(input: Tensor)`: the `numel_host` operator. The element count as a 0-D Int64 HOST tensor, written from metadata; the same no-sync contract as `shape_host`. Composes with shape-consuming arguments, e.g. `reshape(x, {numel_host(x)})` flattens without reading sizes to the host. |
| [oneHot](oneHot.md) | [common]<br>fun [oneHot](oneHot.md)(indices: [Tensor](../Tensor/index.md), numClasses: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [Tensor](../Tensor/index.md)<br>`oneHot(indices: Tensor, numClasses: Long)`: the `one_hot` operator. Expands an integer index tensor into a trailing one-hot dimension. |
| [ones](ones.md) | [common]<br>fun [ones](ones.md)(shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dtype: [DType](../DType/index.md), device: [Placement](../Placement/index.md)? = null, pinnedFor: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`ones(shape: LongArray, dtype: DType, device: Placement? = null, pinnedFor: Placement? = null)`: the `ones` operator. A new tensor of the given shape with every element set to one. Same shape-span and `pinned_for` contract as `empty` (extents are literals or 0-D integer Tensors). |
| [onesLike](onesLike.md) | [common]<br>fun [onesLike](onesLike.md)(reference: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`onesLike(reference: Tensor, device: Placement? = null)`: the `ones_like` operator. A one-filled tensor with `reference`'s shape and dtype (data never read); `device` absent = the reference's own device. |
| [outer](outer.md) | [common]<br>fun [outer](outer.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`outer(input: Tensor, other: Tensor)`: the `outer` operator. Outer product of two 1-D tensors: `[m] x [n] -> [m, n]`. |
| [pad](pad.md) | [common]<br>fun [pad](pad.md)(input: [Tensor](../Tensor/index.md), pad: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), mode: [PadMode](../PadMode/index.md) = PadMode.CONSTANT, value: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`pad(input: Tensor, pad: LongArray, mode: PadMode = PadMode.CONSTANT, value: Tensor? = null)`: the `pad` operator. Pad each axis by interleaved `(lo, hi)` pairs in layout order, left-to-right: pair `i` pads axis `i` (the first pair is the leading axis). Provide fewer pairs than the rank to pad only the leading axes; a negative width crops that side. `mode` selects the fill; `value` is the Constant fill (default 0). |
| [pairwiseDistance](pairwiseDistance.md) | [common]<br>fun [pairwiseDistance](pairwiseDistance.md)(x1: [Tensor](../Tensor/index.md), x2: [Tensor](../Tensor/index.md), p: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 2.0, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`pairwiseDistance(x1: Tensor, x2: Tensor, p: Double = 2.0, eps: Double? = null, keepdim: Boolean = false)`: the `pairwise_distance` operator. Row-wise L_p distance between two batched vectors. Reduces the LAST axis; leading dims broadcast. |
| [pdist](pdist.md) | [common]<br>fun [pdist](pdist.md)(input: [Tensor](../Tensor/index.md), p: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 2.0): [Tensor](../Tensor/index.md)<br>`pdist(input: Tensor, p: Double = 2.0)`: the `pdist` operator. Condensed pairwise L_p distances within ONE 2-D input. Every unordered row pair of `a [M, K]` yields one entry; the output is 1-D of length `M(M-1)/2` (upper-triangle order). |
| [permute](permute.md) | [common]<br>fun [permute](permute.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`permute(input: Tensor, dims: LongArray)`: the `permute` operator. Reorder the dims by `dims`, a permutation of `[0, rank)`. Returns a VIEW (metadata only, no copy). A kernel that later needs dense data materializes internally; no `contiguous` call is needed here. |
| [pixelShuffle](pixelShuffle.md) | [common]<br>fun [pixelShuffle](pixelShuffle.md)(input: [Tensor](../Tensor/index.md), upscaleFactor: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), mode: [PixelShuffleMode](../PixelShuffleMode/index.md) = PixelShuffleMode.CRD): [Tensor](../Tensor/index.md)<br>`pixelShuffle(input: Tensor, upscaleFactor: Long, mode: PixelShuffleMode = PixelShuffleMode.CRD)`: the `pixel_shuffle` operator. Rearranges channels into space (depth-to-space): channels-last `[N, H, W, C]` becomes `[N, H*r, W*r, C/r^2]`. |
| [pixelUnshuffle](pixelUnshuffle.md) | [common]<br>fun [pixelUnshuffle](pixelUnshuffle.md)(input: [Tensor](../Tensor/index.md), downscaleFactor: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), mode: [PixelShuffleMode](../PixelShuffleMode/index.md) = PixelShuffleMode.CRD): [Tensor](../Tensor/index.md)<br>`pixelUnshuffle(input: Tensor, downscaleFactor: Long, mode: PixelShuffleMode = PixelShuffleMode.CRD)`: the `pixel_unshuffle` operator. The inverse of `pixel_shuffle` (space-to-depth): channels-last `[N, H, W, C]` becomes `[N, H/r, W/r, C*r^2]`. |
| [poisson](poisson.md) | [common]<br>fun [poisson](poisson.md)(rates: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`poisson(rates: Tensor, device: Placement? = null)`: the `poisson` operator. Independent Poisson draws from per-element rates. |
| [pow](pow.md) | [common]<br>fun [pow](pow.md)(input: [Tensor](../Tensor/index.md), exponent: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`pow(input: Tensor, exponent: Tensor)`: the `pow` operator. Raises `input` to `exponent` elementwise: . Broadcasts and promotes as `add`; a scalar `exponent` keeps its weak kind (an integer exponent with an integer base stays integral).<br>[common]<br>fun [pow](pow.md)(input: [Tensor](../Tensor/index.md), exponent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`pow(input: Tensor, exponent: Double)`: the number form of `pow`, `exponent` as a scalar. |
| [powInPlace](powInPlace.md) | [common]<br>fun [powInPlace](powInPlace.md)(self: [Tensor](../Tensor/index.md), exponent: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`powInPlace(self: Tensor, exponent: Tensor)`: the `pow_` operator. In-place `pow`: writes the powers through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [powInPlace](powInPlace.md)(self: [Tensor](../Tensor/index.md), exponent: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`powInPlace(self: Tensor, exponent: Double)`: the number form of `pow_`, `exponent` as a scalar. |
| [prelu](prelu.md) | [common]<br>fun [prelu](prelu.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`prelu(input: Tensor, weight: Tensor? = null)`: the `prelu` operator. Parametric ReLU: a learned negative-side slope. `weight` is a scalar or a per-channel tensor broadcast against `input`. |
| [preluInPlace](preluInPlace.md) | [common]<br>fun [preluInPlace](preluInPlace.md)(self: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`preluInPlace(self: Tensor, weight: Tensor? = null)`: the `prelu_` operator. In-place `prelu`: writes the result through `self`; same formula, arguments, and error conditions as `prelu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [prod](prod.md) | [common]<br>fun [prod](prod.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`prod(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false, dtype: DType = DType.UNDEFINED)`: the `prod` operator. Product of `input`'s elements over `dims`. Empty `dims` multiplies every element. `dtype` widens the accumulation/output when set; the default keeps `input`'s dtype. |
| [put](put.md) | [common]<br>fun [put](put.md)(input: [Tensor](../Tensor/index.md), index: [Tensor](../Tensor/index.md), source: [Tensor](../Tensor/index.md), accumulate: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`put(input: Tensor, index: Tensor, source: Tensor, accumulate: Boolean = false)`: the `put` operator. A copy of `input` with `source` written at FLAT (row-major linearized) positions: `out.flat[index[i]] = source.flat[i]`. With `accumulate = true` duplicate positions ADD instead of overwrite. `index` and `source` carry the same element count; index dtype law as `gather`. |
| [putInPlace](putInPlace.md) | [common]<br>fun [putInPlace](putInPlace.md)(self: [Tensor](../Tensor/index.md), index: [Tensor](../Tensor/index.md), source: [Tensor](../Tensor/index.md), accumulate: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`putInPlace(self: Tensor, index: Tensor, source: Tensor, accumulate: Boolean = false)`: the `put_` operator. In-place `put`: writes (or accumulates) through `self` at flat positions; same arguments and error conditions as `put()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [qkLayerNorm](qkLayerNorm.md) | [common]<br>fun [qkLayerNorm](qkLayerNorm.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md)? = null, value: [Tensor](../Tensor/index.md)? = null, queryWeight: [Tensor](../Tensor/index.md)? = null, queryBias: [Tensor](../Tensor/index.md)? = null, keyWeight: [Tensor](../Tensor/index.md)? = null, keyBias: [Tensor](../Tensor/index.md)? = null, headDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`qkLayerNorm(query: Tensor, key: Tensor? = null, value: Tensor? = null, queryWeight: Tensor? = null, queryBias: Tensor? = null, keyWeight: Tensor? = null, keyBias: Tensor? = null, headDim: Long = 0L, eps: Double? = null)`: the `qk_layer_norm` operator. Per-head LAYER norm over packed attention projections, the mean-subtracting sibling of `qk_rms_norm`. Each contiguous `head_dim` run of `query` (and `key`, when present) is normalized as `(x - mean) / sqrt(var + eps) * w + b`; `value`, when given, is normalized the same way with no weight and no bias (it has no affine slots). |
| [qkLayerNormInPlace](qkLayerNormInPlace.md) | [common]<br>fun [qkLayerNormInPlace](qkLayerNormInPlace.md)(self: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md)? = null, value: [Tensor](../Tensor/index.md)? = null, queryWeight: [Tensor](../Tensor/index.md)? = null, queryBias: [Tensor](../Tensor/index.md)? = null, keyWeight: [Tensor](../Tensor/index.md)? = null, keyBias: [Tensor](../Tensor/index.md)? = null, headDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`qkLayerNormInPlace(self: Tensor, key: Tensor? = null, value: Tensor? = null, queryWeight: Tensor? = null, queryBias: Tensor? = null, keyWeight: Tensor? = null, keyBias: Tensor? = null, headDim: Long = 0L, eps: Double? = null)`: the `qk_layer_norm_` operator. In-place `qk_layer_norm`: normalizes `query` (and `key` and `value`, when given) through their own storage (no output allocation). `key` and `value` are optional operands written through: pass a pointer to your tensor, or `nullptr` for absent. Every written-through handle is rebound to the op's output, so under a `TracingScope` the caller's `key` becomes the traced output exactly as `query` does. Otherwise the same arguments and error conditions as `qk_layer_norm()`. Returns `query` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [qkRmsNorm](qkRmsNorm.md) | [common]<br>fun [qkRmsNorm](qkRmsNorm.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md)? = null, value: [Tensor](../Tensor/index.md)? = null, queryWeight: [Tensor](../Tensor/index.md)? = null, keyWeight: [Tensor](../Tensor/index.md)? = null, headDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`qkRmsNorm(query: Tensor, key: Tensor? = null, value: Tensor? = null, queryWeight: Tensor? = null, keyWeight: Tensor? = null, headDim: Long = 0L, eps: Double? = null)`: the `qk_rms_norm` operator. Per-head RMS norm over packed attention projections: query, key and value in ONE call, no reshapes. Each contiguous `head_dim` run of `query` (and `key`, when present) is its own normalization group: `out = x / sqrt(mean(x^2) + eps) * w`. `value` passes through untouched (it rides along so one call serves the projection triplet). Equivalent to reshaping `[S, heads*head_dim]` to `[S, heads, head_dim]`, applying `rms_norm`, and reshaping back, with none of those steps. |
| [qkRmsNormInPlace](qkRmsNormInPlace.md) | [common]<br>fun [qkRmsNormInPlace](qkRmsNormInPlace.md)(self: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md)? = null, value: [Tensor](../Tensor/index.md)? = null, queryWeight: [Tensor](../Tensor/index.md)? = null, keyWeight: [Tensor](../Tensor/index.md)? = null, headDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`qkRmsNormInPlace(self: Tensor, key: Tensor? = null, value: Tensor? = null, queryWeight: Tensor? = null, keyWeight: Tensor? = null, headDim: Long = 0L, eps: Double? = null)`: the `qk_rms_norm_` operator. In-place `qk_rms_norm`: normalizes `query` (and `key` and `value`, when given) through their own storage (no output allocation). `key` and `value` are optional operands written through: pass a pointer to your tensor, or `nullptr` for absent. Every written-through handle is rebound to the op's output, so under a `TracingScope` the caller's `key` becomes the traced output exactly as `query` does. Otherwise the same arguments and error conditions as `qk_rms_norm()`. Returns `query` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [quantile](quantile.md) | [common]<br>fun [quantile](quantile.md)(input: [Tensor](../Tensor/index.md), q: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, interpolation: [QuantileInterp](../QuantileInterp/index.md) = QuantileInterp.LINEAR): [Tensor](../Tensor/index.md)<br>`quantile(input: Tensor, q: Tensor, dim: Long? = null, keepdim: Boolean = false, interpolation: QuantileInterp = QuantileInterp.LINEAR)`: the `quantile` operator. The `q`-th quantile of `input` along `dim`. `q` is a scalar or 1-D tensor of probabilities in `[0, 1]`. Absent `dim` flattens `input` first. The output prepends `q`'s shape to the reduced shape; `interpolation` picks the between-ranks strategy (`Linear` by default; see `QuantileInterp` for the full set).<br>[common]<br>fun [quantile](quantile.md)(input: [Tensor](../Tensor/index.md), q: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, interpolation: [QuantileInterp](../QuantileInterp/index.md) = QuantileInterp.LINEAR): [Tensor](../Tensor/index.md)<br>`quantile(input: Tensor, q: Double, dim: Long? = null, keepdim: Boolean = false, interpolation: QuantileInterp = QuantileInterp.LINEAR)`: the number form of `quantile`, `q` as a scalar. |
| [quantizeDequantize](quantizeDequantize.md) | [common]<br>fun [quantizeDequantize](quantizeDequantize.md)(input: [Tensor](../Tensor/index.md), scale: [Tensor](../Tensor/index.md), zeroPoint: [Tensor](../Tensor/index.md)? = null, quantAxis: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, codeDtype: [DType](../DType/index.md) = DType.UNDEFINED, outDtype: [DType](../DType/index.md) = DType.UNDEFINED, blockSize: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`quantizeDequantize(input: Tensor, scale: Tensor, zeroPoint: Tensor? = null, quantAxis: Long = -1L, codeDtype: DType = DType.UNDEFINED, outDtype: DType = DType.UNDEFINED, blockSize: Long = 0L)`: the `quantize_dequantize` operator. Fake-quantize: encode `input` to affine codes and decode straight back (one op, no code tensor materialized), so the output is `input` snapped onto the quantization grid. `scale` / `zero_point` / `quant_axis` / `block_size` declare the scheme exactly as in `quantize`; `code_dtype` is the grid's code dtype (`Undefined` = the zero-point's dtype, else Int8); `out_dtype` picks the float output dtype (`Undefined` = `input`'s own). The quantization-aware inspection/tooling entry. |
| [quantizeInPlace](quantizeInPlace.md) | [common]<br>fun [quantizeInPlace](quantizeInPlace.md)(input: [Tensor](../Tensor/index.md), out: [Tensor](../Tensor/index.md), scale: [Tensor](../Tensor/index.md), zeroPoint: [Tensor](../Tensor/index.md)? = null, quantAxis: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, blockSize: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`quantizeInPlace(input: Tensor, out: Tensor, scale: Tensor, zeroPoint: Tensor? = null, quantAxis: Long = -1L, blockSize: Long = 0L)`: the `quantize_` operator. In-place sibling taking a PLAIN pre-allocated code buffer + explicit affine params: encode `input` INTO `out` (no allocation) and attach the scheme, so on return `out` is a proper quantized tensor. Parameters as in `quantize` above. Returns `out` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. |
| [quickGelu](quickGelu.md) | [common]<br>fun [quickGelu](quickGelu.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`quickGelu(input: Tensor)`: the `quick_gelu` operator. QuickGELU: the sigmoid GELU approximation. |
| [rad2deg](rad2deg.md) | [common]<br>fun [rad2deg](rad2deg.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`rad2deg(input: Tensor)`: the `rad2deg` operator. Converts radians to degrees elementwise: . |
| [rad2degInPlace](rad2degInPlace.md) | [common]<br>fun [rad2degInPlace](rad2degInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`rad2degInPlace(self: Tensor)`: the `rad2deg_` operator. In-place `rad2deg`: writes the degrees through `x`. Writes through `self` and returns it, so calls chain. |
| [rand](rand.md) | [common]<br>fun [rand](rand.md)(shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`rand(shape: LongArray, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the `rand` operator. Uniform random tensor on `[0, 1)`. |
| [randint](randint.md) | [common]<br>fun [randint](randint.md)(low: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), high: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dtype: [DType](../DType/index.md) = DType.INT64, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`randint(low: Long, high: Long, shape: LongArray, dtype: DType = DType.INT64, device: Placement? = null)`: the `randint` operator. Uniform random integers in the half-open range `[low, high)`. |
| [randintLike](randintLike.md) | [common]<br>fun [randintLike](randintLike.md)(reference: [Tensor](../Tensor/index.md), low: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), high: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`randintLike(reference: Tensor, low: Long, high: Long, device: Placement? = null)`: the `randint_like` operator. Uniform integers in `[low, high)` shaped and typed like `reference`. |
| [randLike](randLike.md) | [common]<br>fun [randLike](randLike.md)(reference: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`randLike(reference: Tensor, device: Placement? = null)`: the `rand_like` operator. Uniform `[0, 1)` draws shaped and typed like `reference`. |
| [randn](randn.md) | [common]<br>fun [randn](randn.md)(shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dtype: [DType](../DType/index.md) = DType.FLOAT32, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`randn(shape: LongArray, dtype: DType = DType.FLOAT32, device: Placement? = null)`: the `randn` operator. Standard-normal random tensor, `N(0, 1)`. |
| [randnLike](randnLike.md) | [common]<br>fun [randnLike](randnLike.md)(reference: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`randnLike(reference: Tensor, device: Placement? = null)`: the `randn_like` operator. `N(0, 1)` draws shaped and typed like `reference`. |
| [randomInPlace](randomInPlace.md) | [common]<br>fun [randomInPlace](randomInPlace.md)(self: [Tensor](../Tensor/index.md), low: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, high: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`randomInPlace(self: Tensor, low: Long? = null, high: Long? = null, device: Placement? = null)`: the `random_` operator. In-place uniform-INTEGER fill: overwrites `self` with draws from `[low, high)`. `low` and `high` come both or neither; with both absent, the range is the dtype's full representable-integer span. A view input writes through its base storage. Returns `self` for chaining. Writes through `self` and returns it, so calls chain. |
| [randperm](randperm.md) | [common]<br>fun [randperm](randperm.md)(n: [Tensor](../Tensor/index.md), dtype: [DType](../DType/index.md) = DType.INT64, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`randperm(n: Tensor, dtype: DType = DType.INT64, device: Placement? = null)`: the `randperm` operator. A random permutation of the integers `0 .. n-1`.<br>[common]<br>fun [randperm](randperm.md)(n: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dtype: [DType](../DType/index.md) = DType.INT64, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`randperm(n: Double, dtype: DType = DType.INT64, device: Placement? = null)`: the number form of `randperm`, `n` as a scalar. |
| [reciprocal](reciprocal.md) | [common]<br>fun [reciprocal](reciprocal.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`reciprocal(input: Tensor)`: the `reciprocal` operator. Elementwise reciprocal. Zero produces ±inf. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [reciprocalInPlace](reciprocalInPlace.md) | [common]<br>fun [reciprocalInPlace](reciprocalInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`reciprocalInPlace(self: Tensor)`: the `reciprocal_` operator. In-place `reciprocal`: writes the result through `self`; same formula, arguments, and error conditions as `reciprocal()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [reflectPad](reflectPad.md) | [common]<br>fun [reflectPad](reflectPad.md)(input: [Tensor](../Tensor/index.md), pad: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`reflectPad(input: Tensor, pad: LongArray)`: the `reflect_pad` operator. `pad` in mirror mode: the padding reflects the tensor across each padded edge. Same `(lo, hi)` pair layout as `constant_pad`. Copies. |
| [reglu](reglu.md) | [common]<br>fun [reglu](reglu.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`reglu(input: Tensor)`: the `reglu` operator. ReGLU gated activation over a concatenated gate‖up input. The relu-gated member of the GLU family, beside `geglu` / `swiglu`: `[.., 2d]` in, `[.., d]` out; the last dim must be even. |
| [relu](relu.md) | [common]<br>fun [relu](relu.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`relu(input: Tensor)`: the `relu` operator. Rectified linear unit. |
| [relu6](relu6.md) | [common]<br>fun [relu6](relu6.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`relu6(input: Tensor)`: the `relu6` operator. ReLU capped at 6. |
| [relu6InPlace](relu6InPlace.md) | [common]<br>fun [relu6InPlace](relu6InPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`relu6InPlace(self: Tensor)`: the `relu6_` operator. In-place `relu6`: writes the result through `self`; same formula, arguments, and error conditions as `relu6()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [reluInPlace](reluInPlace.md) | [common]<br>fun [reluInPlace](reluInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`reluInPlace(self: Tensor)`: the `relu_` operator. In-place `relu`: writes the result through `self`; same formula, arguments, and error conditions as `relu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [remainder](remainder.md) | [common]<br>fun [remainder](remainder.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`remainder(input: Tensor, other: Tensor)`: the `remainder` operator. Elementwise remainder with the sign of the DIVISOR, i.e. `ops::mod` with `ModMode::Python`. Broadcasts and promotes as `add`.<br>[common]<br>fun [remainder](remainder.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`remainder(input: Tensor, other: Double)`: the number form of `remainder`, `other` as a scalar. |
| [remainderInPlace](remainderInPlace.md) | [common]<br>fun [remainderInPlace](remainderInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`remainderInPlace(self: Tensor, other: Tensor)`: the `remainder_` operator. In-place `remainder`: writes the remainders through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [remainderInPlace](remainderInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`remainderInPlace(self: Tensor, other: Double)`: the number form of `remainder_`, `other` as a scalar. |
| [renorm](renorm.md) | [common]<br>fun [renorm](renorm.md)(input: [Tensor](../Tensor/index.md), p: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), maxnorm: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`renorm(input: Tensor, p: Double, dim: Long, maxnorm: Double, eps: Double? = null)`: the `renorm` operator. Caps each sub-tensor's `p`-norm along `dim` at `maxnorm`. Every slice along `dim` whose `p`-norm exceeds `maxnorm` is rescaled to exactly `maxnorm`; slices already within the bound pass through unchanged. |
| [renormInPlace](renormInPlace.md) | [common]<br>fun [renormInPlace](renormInPlace.md)(self: [Tensor](../Tensor/index.md), p: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), maxnorm: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`renormInPlace(self: Tensor, p: Double, dim: Long, maxnorm: Double, eps: Double? = null)`: the `renorm_` operator. In-place `renorm`: rewrites `self` with each slice's norm capped at `maxnorm` and returns it under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [repeat](repeat.md) | [common]<br>fun [repeat](repeat.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`repeat(input: Tensor, sizes: LongArray)`: the `repeat` operator. Tile `input` by per-dim repeat counts: `sizes[i]` copies along dim `i`. `sizes` must carry at least the input's rank; extra LEADING entries add fresh leading dims. Counts are literals or 0-D integer Tensors (a tensor count traces symbolically). Copies; `numel` scales by the product of the counts. |
| [repeatInterleave](repeatInterleave.md) | [common]<br>fun [repeatInterleave](repeatInterleave.md)(input: [Tensor](../Tensor/index.md), repeats: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, outputSize: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)<br>`repeatInterleave(input: Tensor, repeats: Tensor, dim: Long? = null, outputSize: Long? = null)`: the `repeat_interleave` operator. Repeat ELEMENTS, not blocks: each element along `dim` appears `repeats` times consecutively (`[a, b]` with repeats 2 ->`[a, a, b, b]`). `repeats` is a scalar (uniform count) or a 1-D tensor matching the dim's length (per-element counts, output length = their sum). With `dim` absent the input is flattened first. `output_size` is the known result length along the dim; pass it when the caller already has it, so a tensor-valued `repeats` skips the blocking host-side count. Copies.<br>[common]<br>fun [repeatInterleave](repeatInterleave.md)(input: [Tensor](../Tensor/index.md), repeats: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, outputSize: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)<br>`repeatInterleave(input: Tensor, repeats: Double, dim: Long? = null, outputSize: Long? = null)`: the number form of `repeat_interleave`, `repeats` as a scalar. |
| [replicatePad](replicatePad.md) | [common]<br>fun [replicatePad](replicatePad.md)(input: [Tensor](../Tensor/index.md), pad: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`replicatePad(input: Tensor, pad: LongArray)`: the `replicate_pad` operator. `pad` in edge-replicate mode: the padding repeats each padded edge's value. Same `(lo, hi)` pair layout as `constant_pad`. Copies. |
| [resample](resample.md) | [common]<br>fun [resample](resample.md)(input: [Tensor](../Tensor/index.md), origFreq: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), newFreq: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), lowpassFilterWidth: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 16, rolloff: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.945, beta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`resample(input: Tensor, origFreq: Long, newFreq: Long, lowpassFilterWidth: Long = 16L, rolloff: Double = 0.945, beta: Double? = null)`: the `resample` operator. Audio-domain 1-D rational resample along the LAST axis: `[.., S]` at `orig_freq` → `[.., ceil(S · L / M)]` at `new_freq`, where `L/M` is the gcd-reduced rate pair. A kaiser-windowed-sinc polyphase FIR, the standard antialiased sample-rate converter; input outside the signal reads as zero, and equal rates pass the signal through exactly. Leading axes are batch/channels (transpose another samples axis to the back first, a view). The defaults are the kaiser preset: `lowpass_filter_width` sinc zero-crossings per side, `rolloff` of the target Nyquist, and (when `beta` is absent) the design beta 14.769656459379492 (~142.7 dB design stopband). Serves f32 natively and f16/bf16 through an f32 compute lane (output mirrors the input); integer and f64 signals refuse; cast to f32 first. CPU-served; device-resident inputs refuse until an accelerator kernel lands. |
| [reshape](reshape.md) | [common]<br>fun [reshape](reshape.md)(input: [Tensor](../Tensor/index.md), shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`reshape(input: Tensor, shape: LongArray)`: the `reshape` operator. Reshape to `shape`; one entry may be -1 to infer it from the element count. A dim entry is an int literal OR a 0-D/1-D integer Tensor (`IndexBound`); e.g. `reshape(x, {shape_host(x, 1), d})` composes without reading sizes to the host. |
| [reshapeAs](reshapeAs.md) | [common]<br>fun [reshapeAs](reshapeAs.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`reshapeAs(input: Tensor, other: Tensor)`: the `reshape_as` operator. Reshape `input` to `other`'s shape (`other` supplies extents only; its data is never read). The element counts must match. Returns a view sharing storage when `input`'s stride layout can express the new shape; copies into a fresh dense tensor otherwise. |
| [rfft](rfft.md) | [common]<br>fun [rfft](rfft.md)(input: [Tensor](../Tensor/index.md), nFft: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, normalized: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`rfft(input: Tensor, nFft: Long? = null, normalized: Boolean = false)`: the `rfft` operator. One-sided real FFT along the last axis: real `[..., n]` → interleaved (re, im) pairs `[..., n_fft/2 + 1, 2]`. `n_fft` defaults to the last axis's extent; `normalized` scales the spectrum by `1/sqrt(n_fft)`. |
| [rmsNorm](rmsNorm.md) | [common]<br>fun [rmsNorm](rmsNorm.md)(input: [Tensor](../Tensor/index.md), normalizedShape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), weight: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, activation: [Activation](../Activation/index.md)? = null): [Tensor](../Tensor/index.md)<br>`rmsNorm(input: Tensor, normalizedShape: LongArray, weight: Tensor? = null, bias: Tensor? = null, eps: Double? = null, activation: Activation? = null)`: the `rms_norm` operator. Root-mean-square normalization over the trailing `normalized_shape` dims (no mean subtraction). The transformer-style norm: statistics are the mean SQUARE only, per position over the trailing dims. Optional fused `activation` applies to the post-affine value (gated kinds are not accepted). |
| [roll](roll.md) | [common]<br>fun [roll](roll.md)(input: [Tensor](../Tensor/index.md), shifts: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)<br>`roll(input: Tensor, shifts: LongArray, dims: LongArray = longArrayOf())`: the `roll` operator. Circularly shift elements: `shifts[i]` positions along `dims[i]`; elements that fall off one end re-enter at the other. With `dims` empty (the default) the tensor is treated as flattened row-major and shifted by `shifts[0]`. Copies. |
| [rot90](rot90.md) | [common]<br>fun [rot90](rot90.md)(input: [Tensor](../Tensor/index.md), k: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(0, 1)): [Tensor](../Tensor/index.md)<br>`rot90(input: Tensor, k: Long = 1L, dims: LongArray = longArrayOf(0, 1))`: the `rot90` operator. 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. |
| [rotaryEmbedding](rotaryEmbedding.md) | [common]<br>fun [rotaryEmbedding](rotaryEmbedding.md)(input: [Tensor](../Tensor/index.md), positionIds: [Tensor](../Tensor/index.md)? = null, cos: [Tensor](../Tensor/index.md)? = null, sin: [Tensor](../Tensor/index.md)? = null, mode: [RotaryMode](../RotaryMode/index.md)? = null, rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, lowFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, highFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, originalMaxPos: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, betaFast: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, betaSlow: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, freqFactors: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`rotaryEmbedding(input: Tensor, positionIds: Tensor? = null, cos: Tensor? = null, sin: Tensor? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, theta: Double? = null, scaling: RopeScaling? = null, scale: Double? = null, lowFreqFactor: Double? = null, highFreqFactor: Double? = null, originalMaxPos: Long? = null, betaFast: Double? = null, betaSlow: Double? = null, freqFactors: Tensor? = null)`: the `rotary_embedding` operator. Rotary position embedding over padded `[.., S, D]` layouts. Rotates the leading `rotary_dim` of each head vector by per-position angles (RoPE). `cos` / `sin` are the precomputed angle planes `[max_pos, rotary_dim/2]` Float32; `position_ids` (Int32/Int64) selects each token's row; absent, positions run 0, 1, 2, … per sequence. `mode` picks the pair layout (interleaved vs half-split); `rotary_dim` absent rotates the whole head dim. |
| [rotaryEmbeddingQk](rotaryEmbeddingQk.md) | [common]<br>fun [rotaryEmbeddingQk](rotaryEmbeddingQk.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), positionIds: [Tensor](../Tensor/index.md)? = null, cos: [Tensor](../Tensor/index.md)? = null, sin: [Tensor](../Tensor/index.md)? = null, mode: [RotaryMode](../RotaryMode/index.md)? = null, rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, lowFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, highFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, originalMaxPos: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, betaFast: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, betaSlow: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, freqFactors: [Tensor](../Tensor/index.md)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`rotaryEmbeddingQk(query: Tensor, key: Tensor, positionIds: Tensor? = null, cos: Tensor? = null, sin: Tensor? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, theta: Double? = null, scaling: RopeScaling? = null, scale: Double? = null, lowFreqFactor: Double? = null, highFreqFactor: Double? = null, originalMaxPos: Long? = null, betaFast: Double? = null, betaSlow: Double? = null, freqFactors: Tensor? = null)`: the `rotary_embedding_qk` operator. |
| [rotaryEmbeddingQkVarlen](rotaryEmbeddingQkVarlen.md) | [common]<br>fun [rotaryEmbeddingQkVarlen](rotaryEmbeddingQkVarlen.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), cuSeqlens: [Tensor](../Tensor/index.md), seqlens: [Tensor](../Tensor/index.md)? = null, positionIds: [Tensor](../Tensor/index.md)? = null, cos: [Tensor](../Tensor/index.md)? = null, sin: [Tensor](../Tensor/index.md)? = null, mode: [RotaryMode](../RotaryMode/index.md)? = null, rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, lowFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, highFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, originalMaxPos: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, betaFast: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, betaSlow: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, freqFactors: [Tensor](../Tensor/index.md)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`rotaryEmbeddingQkVarlen(query: Tensor, key: Tensor, cuSeqlens: Tensor, seqlens: Tensor? = null, positionIds: Tensor? = null, cos: Tensor? = null, sin: Tensor? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, theta: Double? = null, scaling: RopeScaling? = null, scale: Double? = null, lowFreqFactor: Double? = null, highFreqFactor: Double? = null, originalMaxPos: Long? = null, betaFast: Double? = null, betaSlow: Double? = null, freqFactors: Tensor? = null)`: the `rotary_embedding_qk_varlen` operator. |
| [rotaryEmbeddingVarlen](rotaryEmbeddingVarlen.md) | [common]<br>fun [rotaryEmbeddingVarlen](rotaryEmbeddingVarlen.md)(input: [Tensor](../Tensor/index.md), cuSeqlens: [Tensor](../Tensor/index.md), seqlens: [Tensor](../Tensor/index.md)? = null, positionIds: [Tensor](../Tensor/index.md)? = null, cos: [Tensor](../Tensor/index.md)? = null, sin: [Tensor](../Tensor/index.md)? = null, mode: [RotaryMode](../RotaryMode/index.md)? = null, rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, theta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, scaling: [RopeScaling](../RopeScaling/index.md)? = null, scale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, lowFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, highFreqFactor: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, originalMaxPos: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, betaFast: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, betaSlow: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, freqFactors: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`rotaryEmbeddingVarlen(input: Tensor, cuSeqlens: Tensor, seqlens: Tensor? = null, positionIds: Tensor? = null, cos: Tensor? = null, sin: Tensor? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, theta: Double? = null, scaling: RopeScaling? = null, scale: Double? = null, lowFreqFactor: Double? = null, highFreqFactor: Double? = null, originalMaxPos: Long? = null, betaFast: Double? = null, betaSlow: Double? = null, freqFactors: Tensor? = null)`: the `rotary_embedding_varlen` operator. Rotary position embedding over token-packed (variable-length) layouts. Packed `[Sum(S), .., D]` input with `cu_seqlens``[B+1]` Int32 prefix sums (per-sequence positions restart at 0 unless `position_ids` is given); `seqlens` optionally carries explicit per-sequence lengths. angles (RoPE). `cos` / `sin` are the precomputed angle planes `[max_pos, rotary_dim/2]` Float32; `position_ids` (Int32/Int64) selects each token's row; absent, positions run 0, 1, 2, … per sequence. `mode` picks the pair layout (interleaved vs half-split); `rotary_dim` absent rotates the whole head dim. |
| [round](round.md) | [common]<br>fun [round](round.md)(input: [Tensor](../Tensor/index.md), decimals: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`round(input: Tensor, decimals: Long = 0L)`: the `round` operator. Elementwise rounding to `decimals` fractional digits. `decimals = 0` (default) rounds to integers; positive keeps that many fractional digits; negative rounds to tens, hundreds, …. |
| [roundInPlace](roundInPlace.md) | [common]<br>fun [roundInPlace](roundInPlace.md)(self: [Tensor](../Tensor/index.md), decimals: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`roundInPlace(self: Tensor, decimals: Long = 0L)`: the `round_` operator. In-place `round`: writes the result through `self`; same formula, arguments, and error conditions as `round()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [rsqrt](rsqrt.md) | [common]<br>fun [rsqrt](rsqrt.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`rsqrt(input: Tensor)`: the `rsqrt` operator. Elementwise reciprocal square root. Negative inputs produce NaN; zero produces +inf. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [rsqrtInPlace](rsqrtInPlace.md) | [common]<br>fun [rsqrtInPlace](rsqrtInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`rsqrtInPlace(self: Tensor)`: the `rsqrt_` operator. In-place `rsqrt`: writes the result through `self`; same formula, arguments, and error conditions as `rsqrt()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [scaledDotProductAttention](scaledDotProductAttention.md) | [common]<br>fun [scaledDotProductAttention](scaledDotProductAttention.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), attnMask: [Tensor](../Tensor/index.md)? = null, isCausal: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, qScale: [Tensor](../Tensor/index.md)? = null, kScale: [Tensor](../Tensor/index.md)? = null, vScale: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`scaledDotProductAttention(query: Tensor, key: Tensor, value: Tensor, attnMask: Tensor? = null, isCausal: Boolean = false, qScale: Tensor? = null, kScale: Tensor? = null, vScale: Tensor? = null)`: the `scaled_dot_product_attention` operator. Scaled dot-product attention over dense head-major tensors. `s` defaults to (the q/k head size) and is replaced wholesale by `q_scale` when given. Layout is head-major, `D` innermost. |
| [scaledDotProductAttentionVarlen](scaledDotProductAttentionVarlen.md) | [common]<br>fun [scaledDotProductAttentionVarlen](scaledDotProductAttentionVarlen.md)(query: [Tensor](../Tensor/index.md), key: [Tensor](../Tensor/index.md), value: [Tensor](../Tensor/index.md), cuSeqlensQ: [Tensor](../Tensor/index.md), cuSeqlensK: [Tensor](../Tensor/index.md), maxSeqlenQ: [Tensor](../Tensor/index.md)? = null, maxSeqlenK: [Tensor](../Tensor/index.md)? = null, attnMask: [Tensor](../Tensor/index.md)? = null, isCausal: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, qScale: [Tensor](../Tensor/index.md)? = null, kScale: [Tensor](../Tensor/index.md)? = null, vScale: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`scaledDotProductAttentionVarlen(query: Tensor, key: Tensor, value: Tensor, cuSeqlensQ: Tensor, cuSeqlensK: Tensor, maxSeqlenQ: Tensor? = null, maxSeqlenK: Tensor? = null, attnMask: Tensor? = null, isCausal: Boolean = false, qScale: Tensor? = null, kScale: Tensor? = null, vScale: Tensor? = null)`: the `scaled_dot_product_attention_varlen` operator. Variable-length (packed) scaled dot-product attention: ragged batches ride one token-packed tensor plus prefix-sum offsets, no padding. Same math as `scaled_dot_product_attention`; the batch structure moves into `cu_seqlens_*`. |
| [scatter](scatter.md) | [common]<br>fun [scatter](scatter.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`scatter(input: Tensor, dim: Long, index: Tensor, src: Tensor)`: the `scatter` operator. A copy of `input` with `src` written at positions given by `index` along `dim`, the write mirror of `gather`: `out[index[p]][j][k] = src[p]` for `dim = 0` (only that axis's coordinate is redirected). A scalar `src` broadcasts one value to every indexed position; a tensor `src` matches `index`'s shape. On duplicate destinations one write wins; use `scatter_add` / `scatter_reduce` for well-defined accumulation. Index dtype law as `gather`.<br>[common]<br>fun [scatter](scatter.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`scatter(input: Tensor, dim: Long, index: Tensor, src: Double)`: the number form of `scatter`, `src` as a scalar. |
| [scatterAdd](scatterAdd.md) | [common]<br>fun [scatterAdd](scatterAdd.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md), deterministic: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`scatterAdd(input: Tensor, dim: Long, index: Tensor, src: Tensor, deterministic: Boolean = false)`: the `scatter_add` operator. `scatter` with ACCUMULATION: `out[.., index[p], ..] += src[p]`; duplicate destinations sum. |
| [scatterAddInPlace](scatterAddInPlace.md) | [common]<br>fun [scatterAddInPlace](scatterAddInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md), deterministic: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`scatterAddInPlace(self: Tensor, dim: Long, index: Tensor, src: Tensor, deterministic: Boolean = false)`: the `scatter_add_` operator. In-place `scatter_add`: accumulates through `self` at the indexed positions; same arguments (incl. `deterministic`) and error conditions as `scatter_add()`. A strided view reaches its base buffer. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [scatterInPlace](scatterInPlace.md) | [common]<br>fun [scatterInPlace](scatterInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`scatterInPlace(self: Tensor, dim: Long, index: Tensor, src: Tensor)`: the `scatter_` operator. In-place `scatter`: writes through `self` at the indexed positions; same arguments and error conditions as `scatter()`. Writes through `self`'s storage (a strided view reaches its base buffer). Returns `self` for chaining. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [scatterInPlace](scatterInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`scatterInPlace(self: Tensor, dim: Long, index: Tensor, src: Double)`: the number form of `scatter_`, `src` as a scalar. |
| [scatterReduce](scatterReduce.md) | [common]<br>fun [scatterReduce](scatterReduce.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md), reduce: [ScatterReduceMode](../ScatterReduceMode/index.md), includeSelf: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, deterministic: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`scatterReduce(input: Tensor, dim: Long, index: Tensor, src: Tensor, reduce: ScatterReduceMode, includeSelf: Boolean = true, deterministic: Boolean = false)`: the `scatter_reduce` operator. `scatter` with a REDUCTION at each destination: `Sum` / `Prod` / `Mean` / `AMax` / `AMin` (`ScatterReduceMode`). |
| [scatterReduceInPlace](scatterReduceInPlace.md) | [common]<br>fun [scatterReduceInPlace](scatterReduceInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md), reduce: [ScatterReduceMode](../ScatterReduceMode/index.md), includeSelf: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, deterministic: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`scatterReduceInPlace(self: Tensor, dim: Long, index: Tensor, src: Tensor, reduce: ScatterReduceMode, includeSelf: Boolean = true, deterministic: Boolean = false)`: the `scatter_reduce_` operator. In-place `scatter_reduce`: reduces into `self` at the indexed positions; same arguments and error conditions as `scatter_reduce()`. A strided view reaches its base buffer. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [searchsorted](searchsorted.md) | [common]<br>fun [searchsorted](searchsorted.md)(sortedSequence: [Tensor](../Tensor/index.md), values: [Tensor](../Tensor/index.md), outInt32: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, right: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, side: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)? = null, sorter: [Tensor](../Tensor/index.md)? = null): [Tensor](../Tensor/index.md)<br>`searchsorted(sortedSequence: Tensor, values: Tensor, outInt32: Boolean = false, right: Boolean = false, side: Boolean? = null, sorter: Tensor? = null)`: the `searchsorted` operator. Insertion points of `values` into a sorted sequence. For each value, the index in `sorted_sequence`'s last axis where it would insert to keep the order: `right == false` gives the leftmost admissible slot, `true` the rightmost. `side`, when present, must AGREE with `right` (it is the same switch under its string-API name); `sorter` supplies indices that sort an unsorted sequence. |
| [select](select.md) | [common]<br>fun [select](select.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [Tensor](../Tensor/index.md)<br>`select(input: Tensor, dim: Long, index: Long)`: the `select` operator. One position along `dim` (the dim is removed). `index` is an int literal OR a 0-D integer Tensor (e.g. a `shape_host`-derived index) so a data-dependent select never reads the value to the host. |
| [selu](selu.md) | [common]<br>fun [selu](selu.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`selu(input: Tensor)`: the `selu` operator. Scaled exponential linear unit: `elu` with the fixed SELU constants (alpha ~= 1.6733, scale ~= 1.0507) from the self-normalizing-networks formulation. |
| [seluInPlace](seluInPlace.md) | [common]<br>fun [seluInPlace](seluInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`seluInPlace(self: Tensor)`: the `selu_` operator. In-place `selu`: writes the result through `self`; same formula, arguments, and error conditions as `selu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [sgn](sgn.md) | [common]<br>fun [sgn](sgn.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sgn(input: Tensor)`: the `sgn` operator. Elementwise sign; identical to `sign` for real dtypes. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [sgnInPlace](sgnInPlace.md) | [common]<br>fun [sgnInPlace](sgnInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sgnInPlace(self: Tensor)`: the `sgn_` operator. In-place `sgn`: writes the result through `self`; same formula, arguments, and error conditions as `sgn()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [shape](shape.md) | [common]<br>fun [shape](shape.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)<br>`shape(input: Tensor, dim: Long? = null)`: the `shape` operator. The tensor's shape as a 1-D Int64 tensor (or one extent as 0-D). The value is produced ON DEVICE and is traceable; under tracing it carries the symbolic value. For a plain host integer use the `*_host` sibling instead. With `dim` set, returns that single extent as a 0-D Int64 tensor (negative `dim` counts from the end).<br>[common]<br>fun [shape](shape.md)(input: [Tensor](../Tensor/index.md), start: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?, end: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?): [Tensor](../Tensor/index.md)<br>`shape(input: Tensor, start: Long?, end: Long?)`: the `shape` operator. The `[start, end)` window of the shape as ONE 1-D Int64 tensor, a contiguous dim range in a single call (Python-slice bounds: negative values count from the end, `std::nullopt` leaves that side open). Same on-device, traceable contract as `shape(x)`; the host-integer sibling is `shape_host(x, start, end)`. |
| [shapeHost](shapeHost.md) | [common]<br>fun [shapeHost](shapeHost.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`shapeHost(input: Tensor)`: the `shape_host` operator. The shape of `input` as a HOST-resident Int64 tensor, written from metadata: no device kernel, no readback, no stream synchronize, whatever device `input` lives on. The cheap way to feed shape values to shape-consuming arguments (a `reshape` dim) instead of `Tensor::shape()`'s concrete ints.<br>[common]<br>fun [shapeHost](shapeHost.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [Tensor](../Tensor/index.md)<br>`shapeHost(input: Tensor, dim: Long)`: the `shape_host` operator. One dim of the shape as a 0-D Int64 host tensor (negative `dim` counts from the end). Same no-sync contract as `shape_host(x)`.<br>[common]<br>fun [shapeHost](shapeHost.md)(input: [Tensor](../Tensor/index.md), start: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?, end: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)?): [Tensor](../Tensor/index.md)<br>`shapeHost(input: Tensor, start: Long?, end: Long?)`: the `shape_host` operator. The `[start, end)` window of the shape (Python-slice semantics: negatives count from the end, absent bounds are open) as a 1-D Int64 host tensor. |
| [sigmoid](sigmoid.md) | [common]<br>fun [sigmoid](sigmoid.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sigmoid(input: Tensor)`: the `sigmoid` operator. Logistic sigmoid. |
| [sigmoidInPlace](sigmoidInPlace.md) | [common]<br>fun [sigmoidInPlace](sigmoidInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sigmoidInPlace(self: Tensor)`: the `sigmoid_` operator. In-place `sigmoid`: writes the result through `self`; same formula, arguments, and error conditions as `sigmoid()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [sign](sign.md) | [common]<br>fun [sign](sign.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sign(input: Tensor)`: the `sign` operator. Elementwise sign: `-1`, `0`, or `1`. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [signInPlace](signInPlace.md) | [common]<br>fun [signInPlace](signInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`signInPlace(self: Tensor)`: the `sign_` operator. In-place `sign`: writes the result through `self`; same formula, arguments, and error conditions as `sign()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [silu](silu.md) | [common]<br>fun [silu](silu.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`silu(input: Tensor)`: the `silu` operator. Sigmoid linear unit (swish). |
| [siluInPlace](siluInPlace.md) | [common]<br>fun [siluInPlace](siluInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`siluInPlace(self: Tensor)`: the `silu_` operator. In-place `silu`: writes the result through `self`; same formula, arguments, and error conditions as `silu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [sin](sin.md) | [common]<br>fun [sin](sin.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sin(input: Tensor)`: the `sin` operator. Elementwise sine. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [sinc](sinc.md) | [common]<br>fun [sinc](sinc.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sinc(input: Tensor)`: the `sinc` operator. Elementwise normalized sinc. Normalized convention: zeros at nonzero integers, `sinc(0) = 1` (matching torch / numpy). Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [sincInPlace](sincInPlace.md) | [common]<br>fun [sincInPlace](sincInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sincInPlace(self: Tensor)`: the `sinc_` operator. In-place `sinc`: writes the result through `self`; same formula, arguments, and error conditions as `sinc()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [sinh](sinh.md) | [common]<br>fun [sinh](sinh.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sinh(input: Tensor)`: the `sinh` operator. Elementwise hyperbolic sine. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [sinhInPlace](sinhInPlace.md) | [common]<br>fun [sinhInPlace](sinhInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sinhInPlace(self: Tensor)`: the `sinh_` operator. In-place `sinh`: writes the result through `self`; same formula, arguments, and error conditions as `sinh()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [sinInPlace](sinInPlace.md) | [common]<br>fun [sinInPlace](sinInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sinInPlace(self: Tensor)`: the `sin_` operator. In-place `sin`: writes the result through `self`; same formula, arguments, and error conditions as `sin()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [slice](slice.md) | [common]<br>fun [slice](slice.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), start: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, end: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, step: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1): [Tensor](../Tensor/index.md)<br>`slice(input: Tensor, dim: Long, start: Long? = null, end: Long? = null, step: Long = 1L)`: the `slice` operator. `[start, end)` with `step` along one dim. Each bound is an int literal, a 0-D integer Tensor, or absent (`{}`, an open bound); absent step is 1.<br>[common]<br>fun [slice](slice.md)(input: [Tensor](../Tensor/index.md), dim: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), start: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), end: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), step: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)<br>`slice(input: Tensor, dim: LongArray, start: LongArray = longArrayOf(), end: LongArray = longArrayOf(), step: LongArray = longArrayOf())`: the `slice` operator. Strided slice: for each axis in `dim`, take [start, end) with `step`. An empty start/end/step means full-range / unit-step. |
| [smoothL1Loss](smoothL1Loss.md) | [common]<br>fun [smoothL1Loss](smoothL1Loss.md)(input: [Tensor](../Tensor/index.md), target: [Tensor](../Tensor/index.md), reduction: [Reduction](../Reduction/index.md) = Reduction.MEAN, beta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0): [Tensor](../Tensor/index.md)<br>`smoothL1Loss(input: Tensor, target: Tensor, reduction: Reduction = Reduction.MEAN, beta: Double = 1.0)`: the `smooth_l1_loss` operator. Smooth-L1 loss: quadratic within `beta` of zero, L1 beyond it. `beta == 0` degenerates to plain L1. |
| [snake](snake.md) | [common]<br>fun [snake](snake.md)(input: [Tensor](../Tensor/index.md), alpha: [Tensor](../Tensor/index.md)? = null, beta: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0E-9): [Tensor](../Tensor/index.md)<br>`snake(input: Tensor, alpha: Tensor? = null, beta: Tensor? = null, eps: Double = 1e-9)`: the `snake` operator. Periodic &quot;snake&quot; activation (neural vocoders), per channels-last channel. `alpha` (frequency) and `beta` (magnitude) are rank-1 `[C]` tensors over `input`'s last dim, in the REAL domain. Apply `exp` once at setup for a log-scale checkpoint parameterization. `beta` absent selects the plain form (`beta = alpha`). One fused pass; the composed spelling costs five elementwise calls over the whole stream. |
| [snakeInPlace](snakeInPlace.md) | [common]<br>fun [snakeInPlace](snakeInPlace.md)(self: [Tensor](../Tensor/index.md), alpha: [Tensor](../Tensor/index.md)? = null, beta: [Tensor](../Tensor/index.md)? = null, eps: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0E-9): [Tensor](../Tensor/index.md)<br>`snakeInPlace(self: Tensor, alpha: Tensor? = null, beta: Tensor? = null, eps: Double = 1e-9)`: the `snake_` operator. In-place `snake`: writes the result through `self`; same formula, arguments, and error conditions as `snake()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [softcapLogits](softcapLogits.md) | [common]<br>fun [softcapLogits](softcapLogits.md)(input: [Tensor](../Tensor/index.md), cap: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`softcapLogits(input: Tensor, cap: Tensor)`: the `softcap_logits` operator. Fused logit soft-cap: `cap * tanh(x / cap)` (true division), elementwise. A number cap must be 0 (0 or negative is rejected). A tensor cap broadcasts against `input` and every element must be non-zero; that precondition is the caller's contract and is not runtime-checked.<br>[common]<br>fun [softcapLogits](softcapLogits.md)(input: [Tensor](../Tensor/index.md), cap: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`softcapLogits(input: Tensor, cap: Double)`: the number form of `softcap_logits`, `cap` as a scalar. |
| [softcapLogitsInPlace](softcapLogitsInPlace.md) | [common]<br>fun [softcapLogitsInPlace](softcapLogitsInPlace.md)(self: [Tensor](../Tensor/index.md), cap: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`softcapLogitsInPlace(self: Tensor, cap: Tensor)`: the `softcap_logits_` operator. In-place `softcap_logits`: writes the result through `self`; same formula, arguments, and error conditions as `softcap_logits()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [softcapLogitsInPlace](softcapLogitsInPlace.md)(self: [Tensor](../Tensor/index.md), cap: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`softcapLogitsInPlace(self: Tensor, cap: Double)`: the number form of `softcap_logits_`, `cap` as a scalar. |
| [softmax](softmax.md) | [common]<br>fun [softmax](softmax.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`softmax(input: Tensor, dim: Long = -1L, dtype: DType = DType.UNDEFINED)`: the `softmax` operator. Softmax along `dim`, computed stably (max-subtracted). |
| [softmaxInPlace](softmaxInPlace.md) | [common]<br>fun [softmaxInPlace](softmaxInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L): [Tensor](../Tensor/index.md)<br>`softmaxInPlace(self: Tensor, dim: Long = -1L)`: the `softmax_` operator. In-place `softmax`: writes the result through `self`; same formula, arguments, and error conditions as `softmax()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [softmin](softmin.md) | [common]<br>fun [softmin](softmin.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`softmin(input: Tensor, dim: Long = -1L, dtype: DType = DType.UNDEFINED)`: the `softmin` operator. Softmax of the negated input: weights small values highest. |
| [softminInPlace](softminInPlace.md) | [common]<br>fun [softminInPlace](softminInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L): [Tensor](../Tensor/index.md)<br>`softminInPlace(self: Tensor, dim: Long = -1L)`: the `softmin_` operator. In-place `softmin`: writes the result through `self`; same formula, arguments, and error conditions as `softmin()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [softplus](softplus.md) | [common]<br>fun [softplus](softplus.md)(input: [Tensor](../Tensor/index.md), beta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, threshold: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 20.0): [Tensor](../Tensor/index.md)<br>`softplus(input: Tensor, beta: Double = 1.0, threshold: Double = 20.0)`: the `softplus` operator. Smooth ReLU. For numerical stability the exact linear `input` is returned where `beta * x > threshold`. |
| [softplusInPlace](softplusInPlace.md) | [common]<br>fun [softplusInPlace](softplusInPlace.md)(self: [Tensor](../Tensor/index.md), beta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, threshold: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 20.0): [Tensor](../Tensor/index.md)<br>`softplusInPlace(self: Tensor, beta: Double = 1.0, threshold: Double = 20.0)`: the `softplus_` operator. In-place `softplus`: writes the result through `self`; same formula, arguments, and error conditions as `softplus()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [softshrink](softshrink.md) | [common]<br>fun [softshrink](softshrink.md)(input: [Tensor](../Tensor/index.md), lambd: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.5): [Tensor](../Tensor/index.md)<br>`softshrink(input: Tensor, lambd: Double = 0.5)`: the `softshrink` operator. Soft thresholding: shrinks every element toward zero by `lambd`. |
| [softshrinkInPlace](softshrinkInPlace.md) | [common]<br>fun [softshrinkInPlace](softshrinkInPlace.md)(self: [Tensor](../Tensor/index.md), lambd: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.5): [Tensor](../Tensor/index.md)<br>`softshrinkInPlace(self: Tensor, lambd: Double = 0.5)`: the `softshrink_` operator. In-place `softshrink`: writes the result through `self`; same formula, arguments, and error conditions as `softshrink()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [softsign](softsign.md) | [common]<br>fun [softsign](softsign.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`softsign(input: Tensor)`: the `softsign` operator. Softsign activation. |
| [softsignInPlace](softsignInPlace.md) | [common]<br>fun [softsignInPlace](softsignInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`softsignInPlace(self: Tensor)`: the `softsign_` operator. In-place `softsign`: writes the result through `self`; same formula, arguments, and error conditions as `softsign()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [sort](sort.md) | [common]<br>fun [sort](sort.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, descending: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, stable: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`sort(input: Tensor, dim: Long = -1L, descending: Boolean = false, stable: Boolean = false)`: the `sort` operator. |
| [splitBySize](splitBySize.md) | [common]<br>fun [splitBySize](splitBySize.md)(input: [Tensor](../Tensor/index.md), chunkSize: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`splitBySize(input: Tensor, chunkSize: Long, dim: Long = 0L)`: the `split_by_size` operator. Split along `dim` into pieces of `chunk_size`, `ceil(extent / chunk_size)` of them, the last possibly shorter. Returns VIEWS sharing the source's storage (no copy). |
| [splitWithSizes](splitWithSizes.md) | [common]<br>fun [splitWithSizes](splitWithSizes.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`splitWithSizes(input: Tensor, sizes: LongArray, dim: Long = 0L)`: the `split_with_sizes` operator. Split along `dim` into chunks of the given lengths; `sizes` must sum to the dim's extent. Each length is a literal or a 0-D integer Tensor. Returns VIEWS; every chunk shares the source's storage (no copy). |
| [sqrt](sqrt.md) | [common]<br>fun [sqrt](sqrt.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sqrt(input: Tensor)`: the `sqrt` operator. Elementwise square root. Negative inputs produce NaN. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [sqrtInPlace](sqrtInPlace.md) | [common]<br>fun [sqrtInPlace](sqrtInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`sqrtInPlace(self: Tensor)`: the `sqrt_` operator. In-place `sqrt`: writes the result through `self`; same formula, arguments, and error conditions as `sqrt()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [square](square.md) | [common]<br>fun [square](square.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`square(input: Tensor)`: the `square` operator. Elementwise square. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [squareInPlace](squareInPlace.md) | [common]<br>fun [squareInPlace](squareInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`squareInPlace(self: Tensor)`: the `square_` operator. In-place `square`: writes the result through `self`; same formula, arguments, and error conditions as `square()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [squeeze](squeeze.md) | [common]<br>fun [squeeze](squeeze.md)(input: [Tensor](../Tensor/index.md), dim: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)<br>`squeeze(input: Tensor, dim: LongArray = longArrayOf())`: the `squeeze` operator. Drop size-1 dims: the listed `dim`s (each must be size 1; anything else raises), or EVERY size-1 dim when `dim` is empty (the default). Returns a view (metadata only, no copy). |
| [squeezeInPlace](squeezeInPlace.md) | [common]<br>fun [squeezeInPlace](squeezeInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)<br>`squeezeInPlace(self: Tensor, dim: LongArray = longArrayOf())`: the `squeeze_` operator. In-place `squeeze`: reshapes `self`'s handle in place; same rules and error conditions as `squeeze()`; the storage is untouched. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [ssdUpdate](ssdUpdate.md) | [common]<br>fun [ssdUpdate](ssdUpdate.md)(input: [Tensor](../Tensor/index.md), dt: [Tensor](../Tensor/index.md), aRate: [Tensor](../Tensor/index.md), bMat: [Tensor](../Tensor/index.md), cMat: [Tensor](../Tensor/index.md), dSkip: [Tensor](../Tensor/index.md)?, dtBias: [Tensor](../Tensor/index.md)?, gate: [Tensor](../Tensor/index.md)?, state: [Tensor](../Tensor/index.md), seqLens: [Tensor](../Tensor/index.md)? = null, slotIds: [Tensor](../Tensor/index.md)? = null, dtSoftplus: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`ssdUpdate(input: Tensor, dt: Tensor, aRate: Tensor, bMat: Tensor, cMat: Tensor, dSkip: Tensor?, dtBias: Tensor?, gate: Tensor?, state: Tensor, seqLens: Tensor? = null, slotIds: Tensor? = null, dtSoftplus: Boolean = false)`: the `ssd_update` operator. Mamba2 / SSD selective-state serving step over a per-sequence `[H, dim, dstate]` Float32 state (updated IN PLACE; the returned tensor is `out [B, T, H, dim]`, dtype following `input`). Per token: the state decays by `exp(dt'*A[h])` (dt' = `softplus(dt + dt_bias[h])` when `dt_softplus`), accumulates `dt'*(x (outer) B)`, and emits `S*C + D[h]*x` (optionally silu-gated by `gate`). `A`/`D`/`dt_bias` are per-head Float32 parameters (`A` carries the NEGATIVE decay rate; fold `-exp(A_log)` at bind); `B`/`C` are `[B, T, G, dstate]` with `H % G == 0`. Decode is `T == 1`; a prefill runs the same sequential law. `seq_lens` (`[B]` Int32) bounds ragged rows. `slot_ids` (`[B]` Int32, device-resident) addresses `state` as a SLAB `[num_slots, H, dim, dstate]`: batch row `b` reads/updates slab row `slot_ids[b]` in place (ids in range and DISTINCT per call, the caller's contract); absent keeps state row `b`. |
| [stack](stack.md) | [common]<br>fun [stack](stack.md)(tensors: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;, dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`stack(tensors: List<Tensor>, dim: Long = 0L)`: the `stack` operator. Join tensors along a NEW dim at position `dim`: all inputs share one shape; output rank = input rank + 1, the new dim sized N. Copies. |
| [std](std.md) | [common]<br>fun [std](std.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), correction: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`std(input: Tensor, dims: LongArray = longArrayOf(), correction: Long = 1L, keepdim: Boolean = false)`: the `std` operator. Standard deviation of `input` over `dims`, with Bessel correction. `correction` is the `c` above: 1 (the default) gives the sample standard deviation, 0 the population form. |
| [stft](stft.md) | [common]<br>fun [stft](stft.md)(input: [Tensor](../Tensor/index.md), nFft: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), hopLength: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, winLength: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, window: [Tensor](../Tensor/index.md)? = null, center: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, padMode: [PadMode](../PadMode/index.md) = PadMode.REFLECT, normalized: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, onesided: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true): [Tensor](../Tensor/index.md)<br>`stft(input: Tensor, nFft: Long, hopLength: Long? = null, winLength: Long? = null, window: Tensor? = null, center: Boolean = true, padMode: PadMode = PadMode.REFLECT, normalized: Boolean = false, onesided: Boolean = true)`: the `stft` operator. Short-time Fourier transform of a real `[L]` / `[B, L]` signal: frames of `win_length` (default `n_fft`) at `hop_length` strides (default `n_fft/4`), windowed by `window` when given (a `[win_length]` tensor; absent = rectangular). Output `[T, n_freq, 2]` / `[B, T, n_freq, 2]` with `n_freq = n_fft/2 + 1`; frames along the time axis first, interleaved (re, im) pairs. `center` pads `n_fft/2` per side in `pad_mode` before framing; `normalized` scales by `1/sqrt(n_fft)`. Only the one-sided form is served; `onesided = false` refuses. |
| [sub](sub.md) | [common]<br>fun [sub](sub.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`sub(input: Tensor, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the `sub` operator. Subtracts `other` (scaled) from `input` elementwise. Broadcasts and promotes as `add`; `alpha` (default `1.0`) scales `other` before the subtract, and `activation` is the same fused float-only epilogue (default `Activation::Identity`).<br>[common]<br>fun [sub](sub.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`sub(input: Tensor, other: Double, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the number form of `sub`, `other` as a scalar.<br>[common]<br>fun [sub](sub.md)(input: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), other: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`sub(input: Double, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the `sub` operator. Scalar-LHS . `input` keeps its kind (see `Scalar`). The parameter set mirrors the tensor-first form: `alpha` scales the TENSOR operand `other`, `activation` applies to the result. |
| [subInPlace](subInPlace.md) | [common]<br>fun [subInPlace](subInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`subInPlace(self: Tensor, other: Tensor, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the `sub_` operator. In-place `sub`: writes through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [subInPlace](subInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)<br>`subInPlace(self: Tensor, other: Double, alpha: Double = 1.0, activation: Activation = Activation.IDENTITY)`: the number form of `sub_`, `other` as a scalar. |
| [sum](sum.md) | [common]<br>fun [sum](sum.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, dtype: [DType](../DType/index.md) = DType.UNDEFINED): [Tensor](../Tensor/index.md)<br>`sum(input: Tensor, dims: LongArray = longArrayOf(), keepdim: Boolean = false, dtype: DType = DType.UNDEFINED)`: the `sum` operator. Sums `input` over `dims`. Empty `dims` reduces EVERY dimension (a 0-D result unless `keepdim`). Integer inputs accumulate and return at their own dtype unless `dtype` widens them explicitly. |
| [swiglu](swiglu.md) | [common]<br>fun [swiglu](swiglu.md)(input: [Tensor](../Tensor/index.md), alpha: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, beta: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0, limit: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = Double.POSITIVE_INFINITY): [Tensor](../Tensor/index.md)<br>`swiglu(input: Tensor, alpha: Double = 1.0, beta: Double = 0.0, limit: Double = Double.POSITIVE_INFINITY)`: the `swiglu` operator. SwiGLU over a concatenated `[*, 2d]` gate‖up input → `[*, d]`, the clamped gated form: `out = (clamp(up, ±limit) + beta) · G · sigmoid(alpha·G)` with `G = min(gate, limit)`. The defaults reduce exactly to the plain `silu(gate) · up`. The last dim must be even. |
| [synchronizeAll](synchronizeAll.md) | [common]<br>fun [synchronizeAll](synchronizeAll.md)()<br>`synchronizeAll()`: the `synchronize_all` operator. Block until every live stream in the runtime has finished, a barrier for &quot;wait for all enqueued work to complete&quot; (e.g. before reading a device result on the host, or timing a phase). Infallible: it never raises. |
| [take](take.md) | [common]<br>fun [take](take.md)(self: [Tensor](../Tensor/index.md), index: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`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`. |
| [takeAlongDim](takeAlongDim.md) | [common]<br>fun [takeAlongDim](takeAlongDim.md)(input: [Tensor](../Tensor/index.md), index: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [Tensor](../Tensor/index.md)<br>`takeAlongDim(input: Tensor, index: Tensor, dim: Long? = null)`: the `take_along_dim` operator. `gather` with broadcasting between `input` and `index` on the other dims. With `dim` absent both operands are treated as flattened 1-D. Same index dtype law as `gather` (`Int32`/`Int64`). |
| [tan](tan.md) | [common]<br>fun [tan](tan.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`tan(input: Tensor)`: the `tan` operator. Elementwise tangent. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [tanh](tanh.md) | [common]<br>fun [tanh](tanh.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`tanh(input: Tensor)`: the `tanh` operator. Elementwise hyperbolic tangent. Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [tanhInPlace](tanhInPlace.md) | [common]<br>fun [tanhInPlace](tanhInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`tanhInPlace(self: Tensor)`: the `tanh_` operator. In-place `tanh`: writes the result through `self`; same formula, arguments, and error conditions as `tanh()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [tanInPlace](tanInPlace.md) | [common]<br>fun [tanInPlace](tanInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`tanInPlace(self: Tensor)`: the `tan_` operator. In-place `tan`: writes the result through `self`; same formula, arguments, and error conditions as `tan()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [tensordot](tensordot.md) | [common]<br>fun [tensordot](tensordot.md)(a: [Tensor](../Tensor/index.md), b: [Tensor](../Tensor/index.md), dimsA: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dimsB: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`tensordot(a: Tensor, b: Tensor, dimsA: LongArray, dimsB: LongArray)`: the `tensordot` operator. Named-axis contraction: sums `a` over `dims_a` against `b` over `dims_b`, pairwise. `dims_a[i]` on `a` contracts with `dims_b[i]` on `b` (equal list lengths; per-pair sizes must agree). The output is `a`'s non-contracted dims followed by `b`'s. |
| [threshold](threshold.md) | [common]<br>fun [threshold](threshold.md)(input: [Tensor](../Tensor/index.md), threshold: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`threshold(input: Tensor, threshold: Double, value: Double)`: the `threshold` operator. Elementwise threshold: keeps values above `threshold`, replaces the rest with `value`. |
| [thresholdInPlace](thresholdInPlace.md) | [common]<br>fun [thresholdInPlace](thresholdInPlace.md)(self: [Tensor](../Tensor/index.md), threshold: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`thresholdInPlace(self: Tensor, threshold: Double, value: Double)`: the `threshold_` operator. In-place `threshold`: writes the result through `self`; same formula, arguments, and error conditions as `threshold()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [tile](tile.md) | [common]<br>fun [tile](tile.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`tile(input: Tensor, dims: LongArray)`: the `tile` operator. `repeat` that also accepts FEWER counts than the rank; missing leading entries default to 1. Counts are literals or 0-D integer Tensors (a tensor count traces symbolically). Copies. |
| [to](to.md) | [common]<br>fun [to](to.md)(src: [Tensor](../Tensor/index.md), target: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`to(src: Tensor, target: Placement? = null)`: the `to` operator. Moves a tensor to a device or stream. Already-resident inputs pass through (no transfer). The result is produced on `target`'s stream; downstream ops on that stream order after the transfer automatically.<br>[common]<br>fun [to](to.md)(src: [Tensor](../Tensor/index.md), deviceStr: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [Tensor](../Tensor/index.md)<br>`to(src: Tensor, deviceStr: String)`: the `to` operator. String-addressed `to`: the device is named by string: `"cpu"`, `"cuda"`, `"cuda:1"`, ….<br>[common]<br>fun [to](to.md)(tensors: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;, target: [Placement](../Placement/index.md)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`to(tensors: List<Tensor>, target: Placement? = null)`: the `to` operator. Multi-tensor `to`: moves a batch in ONE call; the batched transfer beats N single moves when several tensors cross together (one submission, one ordering point). |
| [topk](topk.md) | [common]<br>fun [topk](topk.md)(input: [Tensor](../Tensor/index.md), k: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L, largest: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, sorted: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`topk(input: Tensor, k: Long, dim: Long = -1L, largest: Boolean = true, sorted: Boolean = true)`: the `topk` operator. |
| [trace](trace.md) | [common]<br>fun [trace](trace.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`trace(input: Tensor)`: the `trace` operator. Sum of the main diagonal of a rank-2 tensor. |
| [transpose](transpose.md) | [common]<br>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)<br>`transpose(input: Tensor, dim0: Long, dim1: Long)`: the `transpose` operator. Swap `dim0` and `dim1`, `permute` for exactly two dims. Returns a view (no copy). |
| [tril](tril.md) | [common]<br>fun [tril](tril.md)(input: [Tensor](../Tensor/index.md), diagonal: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`tril(input: Tensor, diagonal: Long = 0L)`: the `tril` operator. Zero out the entries ABOVE the chosen diagonal of the last two axes; the lower-triangular part survives. `diagonal`: 0 = main, +k above, -k below. Copies. |
| [trilInPlace](trilInPlace.md) | [common]<br>fun [trilInPlace](trilInPlace.md)(self: [Tensor](../Tensor/index.md), diagonal: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`trilInPlace(self: Tensor, diagonal: Long = 0L)`: the `tril_` operator. In-place `tril`: zeroes the upper triangle through `self`; same arguments and error conditions as `tril()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [triu](triu.md) | [common]<br>fun [triu](triu.md)(input: [Tensor](../Tensor/index.md), diagonal: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`triu(input: Tensor, diagonal: Long = 0L)`: the `triu` operator. Zero out the entries BELOW the chosen diagonal of the last two axes; the upper-triangular part survives. `diagonal`: 0 = main, +k above, -k below. Copies. |
| [triuInPlace](triuInPlace.md) | [common]<br>fun [triuInPlace](triuInPlace.md)(self: [Tensor](../Tensor/index.md), diagonal: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)<br>`triuInPlace(self: Tensor, diagonal: Long = 0L)`: the `triu_` operator. In-place `triu`: zeroes the lower triangle through `self`; same arguments and error conditions as `triu()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [trunc](trunc.md) | [common]<br>fun [trunc](trunc.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`trunc(input: Tensor)`: the `trunc` operator. Elementwise truncation toward zero (drops the fraction). Value-domain violations follow IEEE semantics (NaN / ±inf in the result), never an error. |
| [truncInPlace](truncInPlace.md) | [common]<br>fun [truncInPlace](truncInPlace.md)(self: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`truncInPlace(self: Tensor)`: the `trunc_` operator. In-place `trunc`: writes the result through `self`; same formula, arguments, and error conditions as `trunc()`. A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [unflatten](unflatten.md) | [common]<br>fun [unflatten](unflatten.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)<br>`unflatten(input: Tensor, dim: Long, sizes: LongArray)`: the `unflatten` operator. Split the dim at `dim` into `sizes`, the inverse of `flatten`. The product of `sizes` must equal that dim's extent. Returns a view sharing storage when the layout permits; copies otherwise. |
| [unfold](unfold.md) | [common]<br>fun [unfold](unfold.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), mode: [PadMode](../PadMode/index.md) = PadMode.CONSTANT, value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)<br>`unfold(input: Tensor, kernelSize: LongArray, dilation: LongArray = longArrayOf(), padding: LongArray = longArrayOf(), stride: LongArray = longArrayOf(), mode: PadMode = PadMode.CONSTANT, value: Double? = null)`: the `unfold` operator. im2col: extracts sliding kernel windows from a channels-last input. Input `[N, spatial.., C]` (1-D/2-D/3-D); output `[N, L, prod(kernel_size), C]` where `L` is the number of window placements; channels-last throughout (window samples sit next to channels). |
| [uniformInPlace](uniformInPlace.md) | [common]<br>fun [uniformInPlace](uniformInPlace.md)(self: [Tensor](../Tensor/index.md), low: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 0.0, high: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) = 1.0, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`uniformInPlace(self: Tensor, low: Double = 0.0, high: Double = 1.0, device: Placement? = null)`: the `uniform_` operator. In-place uniform fill on `[low, high)`: overwrites `self` at its own shape/dtype and returns it under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [unique](unique.md) | [common]<br>fun [unique](unique.md)(input: [Tensor](../Tensor/index.md), sorted: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true, returnInverse: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, returnCounts: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`unique(input: Tensor, sorted: Boolean = true, returnInverse: Boolean = false, returnCounts: Boolean = false, dim: Long? = null)`: the `unique` operator. |
| [uniqueConsecutive](uniqueConsecutive.md) | [common]<br>fun [uniqueConsecutive](uniqueConsecutive.md)(input: [Tensor](../Tensor/index.md), returnInverse: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, returnCounts: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;<br>`uniqueConsecutive(input: Tensor, returnInverse: Boolean = false, returnCounts: Boolean = false, dim: Long? = null)`: the `unique_consecutive` operator. |
| [unsqueeze](unsqueeze.md) | [common]<br>fun [unsqueeze](unsqueeze.md)(input: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [Tensor](../Tensor/index.md)<br>`unsqueeze(input: Tensor, dim: Long)`: the `unsqueeze` operator. Insert a size-1 dim at `dim`. The position is normalized against the OUTPUT rank, so `-1` appends at the trailing end. Returns a view (no copy). |
| [unsqueezeInPlace](unsqueezeInPlace.md) | [common]<br>fun [unsqueezeInPlace](unsqueezeInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [Tensor](../Tensor/index.md)<br>`unsqueezeInPlace(self: Tensor, dim: Long)`: the `unsqueeze_` operator. In-place `unsqueeze`: reshapes `self`'s handle in place; same rules and error conditions as `unsqueeze()`; the storage is untouched. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [upsampleBicubic2d](upsampleBicubic2d.md) | [common]<br>fun [upsampleBicubic2d](upsampleBicubic2d.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), scaleFactors: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), alignCorners: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`upsampleBicubic2d(input: Tensor, sizes: LongArray = longArrayOf(), scaleFactors: LongArray = longArrayOf(), alignCorners: Boolean = false)`: the `upsample_bicubic2d` operator. 2-D bicubic resize. Exactly one of `sizes` (target extents) / `scale_factors` (multipliers) is given; entries are literals or 0-D tensors (tensor entries trace symbolically). Input is channels-last. |
| [upsampleBilinear2d](upsampleBilinear2d.md) | [common]<br>fun [upsampleBilinear2d](upsampleBilinear2d.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), scaleFactors: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), alignCorners: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`upsampleBilinear2d(input: Tensor, sizes: LongArray = longArrayOf(), scaleFactors: LongArray = longArrayOf(), alignCorners: Boolean = false)`: the `upsample_bilinear2d` operator. 2-D bilinear resize. Exactly one of `sizes` (target extents) / `scale_factors` (multipliers) is given; entries are literals or 0-D tensors (tensor entries trace symbolically). Input is channels-last. |
| [upsampleLinear1d](upsampleLinear1d.md) | [common]<br>fun [upsampleLinear1d](upsampleLinear1d.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), scaleFactors: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), alignCorners: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`upsampleLinear1d(input: Tensor, sizes: LongArray = longArrayOf(), scaleFactors: LongArray = longArrayOf(), alignCorners: Boolean = false)`: the `upsample_linear1d` operator. `interpolate` with `InterpMode::Linear` (linear / bilinear / trilinear by input rank) or `InterpMode::Bicubic`. |
| [upsampleNearest1d](upsampleNearest1d.md) | [common]<br>fun [upsampleNearest1d](upsampleNearest1d.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), scaleFactors: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)<br>`upsampleNearest1d(input: Tensor, sizes: LongArray = longArrayOf(), scaleFactors: LongArray = longArrayOf())`: the `upsample_nearest1d` operator. `interpolate` with `InterpMode::Nearest` over a 1d/2d/3d input. |
| [upsampleNearest2d](upsampleNearest2d.md) | [common]<br>fun [upsampleNearest2d](upsampleNearest2d.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), scaleFactors: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)<br>`upsampleNearest2d(input: Tensor, sizes: LongArray = longArrayOf(), scaleFactors: LongArray = longArrayOf())`: the `upsample_nearest2d` operator. 2-D nearest-neighbor resize. Exactly one of `sizes` (target extents) / `scale_factors` (multipliers) is given; entries are literals or 0-D tensors (tensor entries trace symbolically). Input is channels-last. |
| [upsampleNearest3d](upsampleNearest3d.md) | [common]<br>fun [upsampleNearest3d](upsampleNearest3d.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), scaleFactors: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf()): [Tensor](../Tensor/index.md)<br>`upsampleNearest3d(input: Tensor, sizes: LongArray = longArrayOf(), scaleFactors: LongArray = longArrayOf())`: the `upsample_nearest3d` operator. 3-D nearest-neighbor resize. Exactly one of `sizes` (target extents) / `scale_factors` (multipliers) is given; entries are literals or 0-D tensors (tensor entries trace symbolically). Input is channels-last. |
| [upsampleTrilinear3d](upsampleTrilinear3d.md) | [common]<br>fun [upsampleTrilinear3d](upsampleTrilinear3d.md)(input: [Tensor](../Tensor/index.md), sizes: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), scaleFactors: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), alignCorners: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`upsampleTrilinear3d(input: Tensor, sizes: LongArray = longArrayOf(), scaleFactors: LongArray = longArrayOf(), alignCorners: Boolean = false)`: the `upsample_trilinear3d` operator. 3-D trilinear resize. Exactly one of `sizes` (target extents) / `scale_factors` (multipliers) is given; entries are literals or 0-D tensors (tensor entries trace symbolically). Input is channels-last. |
| [validateRotaryDim](validateRotaryDim.md) | [common]<br>fun [validateRotaryDim](validateRotaryDim.md)(rotaryDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), headDim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = -1L)<br>`validateRotaryDim(rotaryDim: Long, headDim: Long = -1L)`: the `validate_rotary_dim` operator. Checks a rotary-embedding configuration up front: `rotary_dim` must be positive, even, and (when `head_dim` is given) no larger than `head_dim`. |
| [var](var.md) | [common]<br>fun [var](var.md)(input: [Tensor](../Tensor/index.md), dims: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), correction: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)<br>`var(input: Tensor, dims: LongArray = longArrayOf(), correction: Long = 1L, keepdim: Boolean = false)`: the `var` operator. Variance of `input` over `dims`, with Bessel correction. `correction` is the `c` above: 1 (the default) gives the sample variance, 0 the population form. |
| [where](where.md) | [common]<br>fun [where](where.md)(condition: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`where(condition: Tensor)`: the `where` operator. The coordinates where `condition` is nonzero, sugar for `nonzero`. Returns the same `[n, ndim]` Int64 coordinate matrix as ONE tensor (not a per-dim tuple); the row count is data-dependent.<br>[common]<br>fun [where](where.md)(condition: [Tensor](../Tensor/index.md), input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`where(condition: Tensor, input: Tensor, other: Tensor)`: the `where` operator. Elementwise select: `condition ? x : y`, with numpy-style broadcasting across all three operands. `condition` is Bool; the output takes the broadcast shape and the promoted common dtype of `input` and `other`. |
| [xlog1py](xlog1py.md) | [common]<br>fun [xlog1py](xlog1py.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`xlog1py(input: Tensor, other: Tensor)`: the `xlog1py` operator. Elementwise with the convention (entropy-style sums stay finite where `input` is zero). Broadcasts and promotes as `add`.<br>[common]<br>fun [xlog1py](xlog1py.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`xlog1py(input: Tensor, other: Double)`: the number form of `xlog1py`, `other` as a scalar. |
| [xlogy](xlogy.md) | [common]<br>fun [xlogy](xlogy.md)(input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`xlogy(input: Tensor, other: Tensor)`: the `xlogy` operator. Elementwise with the convention. Broadcasts and promotes as `add`.<br>[common]<br>fun [xlogy](xlogy.md)(input: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`xlogy(input: Tensor, other: Double)`: the number form of `xlogy`, `other` as a scalar. |
| [xlogyInPlace](xlogyInPlace.md) | [common]<br>fun [xlogyInPlace](xlogyInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)<br>`xlogyInPlace(self: Tensor, other: Tensor)`: the `xlogy_` operator. In-place `xlogy`: writes the result through `x`. Writes through `self` and returns it, so calls chain.<br>[common]<br>fun [xlogyInPlace](xlogyInPlace.md)(self: [Tensor](../Tensor/index.md), other: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)<br>`xlogyInPlace(self: Tensor, other: Double)`: the number form of `xlogy_`, `other` as a scalar. |
| [zeroInPlace](zeroInPlace.md) | [common]<br>fun [zeroInPlace](zeroInPlace.md)(self: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`zeroInPlace(self: Tensor, device: Placement? = null)`: the `zero_` operator. In-place zero fill: overwrites every element of `self` with zero (the error conditions of `zeros()`). A view input writes through its base storage. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain. |
| [zeros](zeros.md) | [common]<br>fun [zeros](zeros.md)(shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dtype: [DType](../DType/index.md), device: [Placement](../Placement/index.md)? = null, pinnedFor: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`zeros(shape: LongArray, dtype: DType, device: Placement? = null, pinnedFor: Placement? = null)`: the `zeros` operator. A new tensor of the given shape with every element set to zero. Same shape-span and `pinned_for` contract as `empty` (extents are literals or 0-D integer Tensors). |
| [zerosLike](zerosLike.md) | [common]<br>fun [zerosLike](zerosLike.md)(reference: [Tensor](../Tensor/index.md), device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)<br>`zerosLike(reference: Tensor, device: Placement? = null)`: the `zeros_like` operator. A zero-filled tensor with `reference`'s shape and dtype (data never read); `device` absent = the reference's own device. |