def __init__(self, name, check_diff,
                 freeze_keys=(),
                 diff_whitelist=None):
        """
        Args:
           name (str): name of the tower
           check_diff (bool): whether to check and print about collection change
                when leaving this guard.
           freeze_keys (list): list of keys to backup when entering and restore when leaving this guard.
           diff_whitelist (list): list of keys to ignore, when check_diff is True.
                Defaults to some collections that are normally changed,
                including variables, losses, contexts, queue runners.
        """
        self._name = name
        self._check_diff = check_diff
        if diff_whitelist is None:
            diff_whitelist = CollectionGuard._default_diff_whitelist()
        self._whitelist = set(diff_whitelist)
        self._freeze_keys = freeze_keys
        self._inverse_graphkeys = get_inverse_graphkeys()

        Args:
           name (str): name of the tower
           check_diff (bool): whether to check and print about collection change
                when leaving this guard.
           freeze_keys (list): list of keys to backup when entering and restore when leaving this guard.
           diff_whitelist (list): list of keys to ignore, when check_diff is True.
                Defaults to some collections that are normally changed,
                including variables, losses, contexts, queue runners.
        
tensorpack/tfutils/collection.py