# conv_filter_transpose2d

### deepinv.physics.functional.conv_filter_transpose2d(x, y, filter_size, padding='circular', correlation=False)

Apply the adjoint of 2D convolution with respect to its filter.

Unlike [`torch.nn.functional.conv_transpose2d()`](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.conv_transpose2d.html#torch.nn.functional.conv_transpose2d), which applies the
adjoint with respect to the input image, this function applies the adjoint
with respect to the filter, treating `x` as fixed and mapping an adjoint
output `y` back to filter space. Although this result can be obtained
with `conv_transpose2d` followed by cropping, computing only the
requested filter support directly is more efficient.

* **Parameters:**
  * **x** ([*torch.Tensor*](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor)) – Input tensor of shape `(B, C, H, W)`.
  * **y** ([*torch.Tensor*](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor)) – Adjoint input. Its spatial shape must match the output
    of [`deepinv.physics.functional.conv2d()`](https://deepinv.org/api/stubs/deepinv.physics.functional.conv2d.html.md#deepinv.physics.functional.conv2d) applied to `x`.
  * **filter_size** ([*tuple*](https://docs.python.org/3.12/library/stdtypes.html#tuple) *[*[*int*](https://docs.python.org/3.12/library/functions.html#int) *,* [*int*](https://docs.python.org/3.12/library/functions.html#int) *]*) – Filter size `(H_f, W_f)`.
  * **padding** ([*str*](https://docs.python.org/3.12/library/stdtypes.html#str)) – One of `"valid"`, `"circular"`, `"replicate"`,
    `"reflect"`, `"constant"` or `"zeros"`.
  * **correlation** ([*bool*](https://docs.python.org/3.12/library/functions.html#bool)) – If `True`, return the filter adjoint of
    cross-correlation rather than convolution.
* **Returns:**
  Per-channel filter adjoint of shape `(B, C, H_f, W_f)`.
* **Return type:**
  [*Tensor*](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor)
