import torch


def prepare_values(y_true, y_pred):
    """Converts the input values to numpy.ndarray.

    Parameters
    ----------
    y_true : torch.tensor
        Either a CPU or GPU tensor.
    y_pred : torch.tensor
        Either a CPU or GPU tensor.

    Returns
    -------
    y_true, y_pred : numpy.ndarray
        Numpy.ndarray of the input tensor data.

    """
    if isinstance(y_true, torch.Tensor):
        if y_true.is_cuda:
            y_true = y_true.to(torch.device("cpu"))
        y_true = y_true.numpy()
    if isinstance(y_pred, torch.Tensor):
        if y_pred.is_cuda:
            y_pred = y_pred.to(torch.device("cpu"))
        y_pred = y_pred.numpy()
    return y_true, y_pred