def METHOD_NAME(self, dtype=None):
    """
    Sets the dtype for value matrices.
    Parameters
    ----------
    dtype: Instance of numpy.dtype of torch.dtype. (default: None)
        Sets the dtype to `dtype`. If None set to either numpy.float64 or torch.float64 depending on the backend.
    """
    if self.BACKEND == "numpy":
        if dtype is None:
            self.DTYPE = "float64"
        elif not isinstance(dtype, np.dtype):
            raise ValueError(
                f"Backend is set to numpy, dtype must be an instance of np.dtype. Got: {type(dtype)}"
            )
        else:
            self.DTYPE = dtype
    elif self.BACKEND == "torch":
        if dtype is None:
            self.DTYPE = torch.float64
        elif not isinstance(dtype, torch.dtype):
            raise ValueError(
                f"Backend is set to torch, dtype must be an instance of torch.dtype. Got: {type(dtype)}"
            )
        else:
            self.DTYPE = dtype