---
title: "ClikaRT::ops::linear"
sidebar_label: "linear"
description: "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 = β, sit…"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## linear() {#linear}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`linear`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `weight`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`OptionalTensor`](../../index.md#OptionalTensor) `bias` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`std::optional<`[`Activation`](./index.md#Activation)`>` `activation` `=` `std::nullopt`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `situ_beta` `=` `0.0`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `situ_linear_beta` `=` `0.0`<br />
)

</div>

`x @ weightᵀ (+ bias)`; `weight` in the `[out, in]` Linear layout. Same situ contract as [`matmul`](./matmul.md#matmul): [`Activation::Situ`](./index.md#Activation) 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.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 2887

</div>
