import torch


def detachToNumpy(tensor):
    """
    gets a pytorch tensor and returns a numpy array
    :param tensor: (pytorch tensor)
    :return: (numpy float)
    """
    # detach means to seperate the gradient from the data of the tensor
    return tensor.to(torch.device('cpu')).detach().numpy()