def METHOD_NAME(self, backend, device=None, dtype=None):
    """
    Setup the compute backend.
    Parameters
    ----------
    backend: str (numpy or torch)
        Sets the compute backend to `backend`.
    device: str (default: None)
        Sets the device for torch backend. For numpy backend, sets device=None.
        If None, sets device to the first gpu if available else cpu.
    dtype: Instance of numpy.dtype or torch.dtype (default: None)
        Sets the dtype for arrays. If None, sets to either numpy.float64 or
        torch.float64 depending on the backend.
    """
    if backend not in ["numpy", "torch"]:
        raise ValueError(
            f"backend can either be `numpy` or `torch`. Got: {backend}"
        )
    if backend == "numpy":
        self.BACKEND = "numpy"
        self.DEVICE = None
    else:
        self.BACKEND = "torch"
        self.set_device(device)
    self.set_dtype(dtype=dtype)