def smooth_l1_loss(self, x):
    sigma2 = (self.sigma ** 2)
    cond_point = (1 / sigma2)
    abs_x = torch.abs(x)
    in_mask = (abs_x < cond_point)
    out_mask = (1.0 - in_mask.type_as(x))
    in_value = (0.5 * ((self.sigma * x) ** 2))
    out_value = (abs_x - (0.5 / sigma2))
    value = ((in_value * in_mask.type_as(in_value)) + (out_value * out_mask.type_as(out_value)))
    return value
def smooth_l1_loss(self, x):
    sigma2 = (self.sigma ** 2)
    cond_point = (1 / sigma2)
    abs_x = torch.abs(x)
    in_mask = (abs_x < cond_point)
    out_mask = (1.0 - in_mask.type_as(x))
    in_value = (0.5 * ((self.sigma * x) ** 2))
    out_value = (abs_x - (0.5 / sigma2))
    value = ((in_value * in_mask.type_as(in_value)) + (out_value * out_mask.type_as(out_value)))
    return value