---
title: "ConvTranspose"
sidebar_label: "ConvTranspose"
description: "The clika_runtime.nn ConvTranspose class."
---

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

ConvTranspose(in_channels, out_channels, kernel, stride=(), padding=(), output_padding=(), dilation=(), groups=1, bias=True, *, activation=None, dtype=None, device=None)

    A grouped, dilated transposed convolution of any rank over channels-last
    input; ``kernel`` fixes the rank.

    Args:
        in_channels: channels of the input.
        out_channels: channels of the output.
        kernel: the kernel extents, one per spatial dimension.
        stride: per-dimension strides; empty means 1.
        padding: interleaved ``(low, high)`` crop pairs, one pair per
            spatial dimension, removed from the output; empty means no
            crop.
        output_padding: extra length added on the high side of each
            output dimension (the stride ambiguity's tie-breaker); empty
            means 0.
        dilation: per-dimension dilations; empty means 1.
        groups: input-to-output channel groups.
        bias: declare the bias slot.
        activation: a fused epilogue applied to every output (a name such
            as ``"relu"`` or an :class:`~clika_runtime.Activation` value);
            ``None`` for none.
        dtype: the weight dtype the layer declares; ``None`` declares the
            default dtype (:func:`~clika_runtime.get_default_dtype`). A
            ``load_state_dict`` casts the checkpoint to the declared dtype;
            ``assign=True`` adopts the checkpoint's own dtype instead.
        device: where the layer's tensors live; ``None`` declares on the
            cpu.
    

## `__init__`

```python
__init__(self, in_channels: 'int', out_channels: 'int', kernel: 'Sequence[int]', stride: 'Sequence[int]' = (), padding: 'Sequence[int]' = (), output_padding: 'Sequence[int]' = (), dilation: 'Sequence[int]' = (), groups: 'int' = 1, bias: 'bool' = True, *, activation: 'ActivationLike' = None, dtype: 'DtypeLike | None' = None, device: 'Device | str | None' = None) -> 'None'
```

Initialize self.  See help(type(self)) for accurate signature.

## `extra_repr`

```python
extra_repr(self) -> 'str'
```

extra_repr() -> str

One line of per-class detail for :meth:`__repr__`; a layer prints
its geometry here (``in_features=64, out_features=256``).

## `forward`

```python
forward(self, input: 'Tensor') -> 'Tensor'
```

forward(input) -> Tensor

Channels-last ``[batch, *spatial, in_channels]`` to
``[batch, *spatial', out_channels]``.

## `set_weights`

```python
set_weights(self, weight: 'Tensor', bias: 'Tensor | None' = None) -> 'None'
```

set_weights(weight, bias=None) -> None

Bind the declared slots directly (``weight`` in the
``[in_channels, *kernel, out_channels // groups]`` layout); raises
RuntimeError on a shape mismatch.
