@staticmethod
def smooth_l1_loss(diff, beta):
    if (beta < 1e-05):
        loss = torch.abs(diff)
    else:
        n = torch.abs(diff)
        loss = torch.where((n < beta), ((0.5 * (n ** 2)) / beta), (n - (0.5 * beta)))
    return loss
@staticmethod
def smooth_l1_loss(diff, beta):
    if (beta < 1e-05):
        loss = torch.abs(diff)
    else:
        n = torch.abs(diff)
        loss = torch.where((n < beta), ((0.5 * (n ** 2)) / beta), (n - (0.5 * beta)))
    return loss