def update(self, val, n=1):
    if isinstance(val, AverageMeter):
        reduced_meter: AverageMeter = utils.reduce_average_meter(self, val)
        self.sum = reduced_meter.sum
        self.count = reduced_meter.count
        self.sum_square = reduced_meter.sum_square
    else:
        self.sum += (val * n)
        self.count += n
        self.sum_square = (self.sum_square + ((val * val) * n))
def update(self, val, n=1):
    if isinstance(val, AverageMeter):
        reduced_meter: AverageMeter = utils.reduce_average_meter(self, val)
        self.sum = reduced_meter.sum
        self.count = reduced_meter.count
        self.sum_square = reduced_meter.sum_square
    else:
        self.sum += (val * n)
        self.count += n
        self.sum_square = (self.sum_square + ((val * val) * n))