def __init__(self,
                 name,
                 log_format='.3f',
                 log_name=None,
                 log_tail=None,
                 log_strategy='AVERAGE'):
        """Initializes the stats with log format.

        Args:
            name: Name of the stats. Should be a string without spaces.
            log_format: The numerical log format. Use `time` to log time
                duration. (default: `.3f`)
            log_name: The name shown in the log. `None` means to directly use
                the stats name. (default: None)
            log_tail: The tailing log message. (default: None)
            log_strategy: Strategy to log this stats. `CURRENT`, `AVERAGE`, and
                `SUM` are supported. (default: `AVERAGE`)

        Raises:
            ValueError: If the input `log_strategy` is not supported.
        """
        log_strategy = log_strategy.upper()
        if log_strategy not in ['CURRENT', 'AVERAGE', 'SUM']:
            raise ValueError(f'Invalid log strategy `{self.log_strategy}`!')

        self._name = name
        self._log_format = log_format
        self._log_name = log_name or name
        self._log_tail = log_tail or ''
        self._log_strategy = log_strategy

        # Stats Data.
        self.val = 0  # Current value.
        self.sum = 0  # Cumulative value.
        self.avg = 0  # Averaged value.
        self.cnt = 0  # Count number.
Initializes the stats with log format.

        Args:
            name: Name of the stats. Should be a string without spaces.
            log_format: The numerical log format. Use `time` to log time
                duration. (default: `.3f`)
            log_name: The name shown in the log. `None` means to directly use
                the stats name. (default: None)
            log_tail: The tailing log message. (default: None)
            log_strategy: Strategy to log this stats. `CURRENT`, `AVERAGE`, and
                `SUM` are supported. (default: `AVERAGE`)

        Raises:
            ValueError: If the input `log_strategy` is not supported.
        
runners/running_stats.py