def _initialize_saver(self, prefixes=None, force=False, max_to_keep=5):
        """Initializes the saver object.

        Args:
            prefixes: The prefixes that the saver should take care of.
            force (optional): Even if saver is set, reconstruct the saver
                object.
            max_to_keep (optional):
        """
        if self.saver is not None and not force:
            return
        else:
            if prefixes is None or not (type(prefixes) != list or type(prefixes) != tuple):  # noqa: E721
                raise ValueError("Prefix of variables that needs saving are not defined")

            prefixes_str = ""
            for pref in prefixes:
                prefixes_str = prefixes_str + pref + " "

            print("[#] Initializing it with variable prefixes: {}".format(prefixes_str))
            saved_vars = []
            for pref in prefixes:
                saved_vars.extend(slim.get_variables(pref))

            self.saver = tf.train.Saver(saved_vars, max_to_keep=max_to_keep)
Initializes the saver object.

        Args:
            prefixes: The prefixes that the saver should take care of.
            force (optional): Even if saver is set, reconstruct the saver
                object.
            max_to_keep (optional):
        
examples/inverse_gan_author_utils.py