zea.backend.torch

Pytorch Ultrasound Beamforming Library.

Initialize modules for registries.

Functions

func_on_device(func, device, *args, **kwargs)

Moves all tensor arguments of a function to a specified device before calling it.

zea.backend.torch.func_on_device(func, device, *args, **kwargs)[source]

Moves all tensor arguments of a function to a specified device before calling it.

Parameters:
  • func (callable) – Function to be called.

  • device (str or torch.device) – Device to move tensors to.

  • *args – Positional arguments to be passed to the function.

  • **kwargs – Keyword arguments to be passed to the function.

Returns:

The output of the function.

Modules

losses

Container for custom loss functions.