---
title: "ClikaRT::ops::matmul"
sidebar_label: "matmul"
description: "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."
---

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

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

## matmul() {#matmul}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`matmul`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `other`,<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;`bool` `transpose_a` `=` `false`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`bool` `transpose_b` `=` `false`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `situ_beta` `=` `0.0`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`double` `situ_linear_beta` `=` `0.0`<br />
)

</div>

`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`](./index.md#Activation)'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.

<div class="api-declared">

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

</div>
