# dirac_comb

### deepinv.utils.dirac_comb(shape, step, device='cpu')

Returns a [`torch.Tensor`](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor) with a Dirac comb in 2D (impulse train) at the given step.

* **Parameters:**
  * **shape** ([*tuple*](https://docs.python.org/3.12/library/stdtypes.html#tuple)) – shape of the output tensor.
  * **step** ([*int*](https://docs.python.org/3.12/library/functions.html#int)) – step of the Dirac comb.
  * **device** ([*str*](https://docs.python.org/3.12/library/stdtypes.html#str)) – device of the output tensor.

## Examples using `dirac_comb`:

<div class="sphx-glr-thumbnails">
<!-- thumbnail-parent-div-open --><div class="sphx-glr-thumbcontainer" tooltip="This example provides a tour of 2D blur operators in DeepInverse. In particular, we show how to use DiffractionBlurs (Fresnel diffraction), motion blurs and space varying blurs.">![](auto_examples/physics/images/thumb/sphx_glr_demo_blur_tour_thumb.png)

[Tour of blur operators](https://deepinv.org/auto_examples/physics/demo_blur_tour.html.md)

  <div class="sphx-glr-thumbnail-title">Tour of blur operators</div>
</div>
<!-- thumbnail-parent-div-close --></div>
