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

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

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

# linear

[common]\
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)

`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.