def __init__(self, sum_: TScalar=0):
    if isinstance(sum_, torch.Tensor):
        self._sum = sum_.item()
    else:
        assert isinstance(sum_, (int, float))
        self._sum = sum_
def __init__(self, sum_: TScalar=0):
    if isinstance(sum_, torch.Tensor):
        self._sum = sum_.item()
    else:
        assert isinstance(sum_, (int, float))
        self._sum = sum_