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

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

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

# matmul

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

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