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

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

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

# conv

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

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