modulo

colibri.optics.functional.modulo(x, t=1.0)[source]

Modulo operation.

\[\mathbf{x} = \mathbf{x} - t \Big\lfloor \frac{\mathbf{x}}{t} \Big\rfloor\]
Parameters:
  • x (torch.Tensor) – Input tensor with any shape (dim1, dim2, …, dimN).

  • t (float) – Modulo value.

Returns:

Modulo operation result with the same shape as input (dim1, dim2, …, dimN).

Return type:

torch.Tensor