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

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

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

# deformConv

[common]\
fun [deformConv](deformConv.md)(input: [Tensor](../Tensor/index.md), weight: [Tensor](../Tensor/index.md), offset: [Tensor](../Tensor/index.md), mask: [Tensor](../Tensor/index.md)? = null, bias: [Tensor](../Tensor/index.md)? = null, stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), groups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, offsetGroups: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 1, activation: [Activation](../Activation/index.md) = Activation.IDENTITY): [Tensor](../Tensor/index.md)

`deformConv(input: Tensor, weight: Tensor, offset: Tensor, mask: Tensor? = null, bias: Tensor? = null, stride: LongArray = longArrayOf(), padding: LongArray = longArrayOf(), dilation: LongArray = longArrayOf(), groups: Long = 1L, offsetGroups: Long = 1L, activation: Activation = Activation.IDENTITY)`: the `deform_conv` operator. Deformable convolution, 1-D/2-D/3-D (rank derives from `input`), channels-last: `x [N, D1..Dr, C]`, `weight [O, K1..Kr, C/groups]` (OHWI), `offset [N, out-spatial..., offset_groups·∏K·r]`, `mask [N, out-spatial..., offset_groups·∏K]` (absent ⇒ unmodulated), `bias [O]`; returns `[N, out-spatial..., O]` at `input`'s dtype. Each kernel tap samples at `out·stride − pad_lo + tap·dilation + Δ` (pixel units, bilinear; out-of-bounds reads 0); the offset channel for (group `g`, tap `t`, axis `d`) is `(g·∏K + t)·r + d` with taps row-major over the kernel and axes in layout order (2-D: Δh then Δw). `padding` is interleaved `(lo, hi)` pairs over the spatial axes; `stride`/`dilation` broadcast per spatial axis (empty ⇒ 1). All floating inputs must share `input`'s dtype (f32/f64/f16/bf16; no silent promotion); `activation` is a fused elementwise epilogue applied after bias.