import torch
import numpy as np


def get_gaps(gt_v, pred_v):
    relative_precision = pred_v / gt_v
    gap = gt_v - pred_v
    return relative_precision, gap


def get_avg_gaps(gt_v, pred_v):
    relative_precision, gap = get_gaps(gt_v, pred_v)
    return torch.mean(relative_precision), torch.mean(gap)
