---
title: "ClikaRT::ops::deform_conv"
sidebar_label: "deform_conv"
description: "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-spatia…"
---

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

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

## deform\_conv() {#deform_conv}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`deform_conv`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `weight`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `offset`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`OptionalTensor`](../../index.md#OptionalTensor) `mask` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`OptionalTensor`](../../index.md#OptionalTensor) `bias` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`ClikaRT::Span`](../Span.md)`<const std::int64_t>` `stride` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`ClikaRT::Span`](../Span.md)`<const std::int64_t>` `padding` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`ClikaRT::Span`](../Span.md)`<const std::int64_t>` `dilation` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`int64_t` `groups` `=` `1`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`int64_t` `offset_groups` `=` `1`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Activation`](./index.md#Activation) `activation` `=` [`Activation::Identity`](./index.md#Activation)<br />
)

</div>

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.

<div class="api-declared">

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

</div>
