          config_file = os.path.join(pypath, "config", ".faceswap")
          return config_file
  
      def get_backend(self):
          """ Return the backend from config/.faceswap """
          # Intercept for sphinx docs build
          if sys.argv[0].endswith("sphinx-build"):
              return "nvidia"
          if not os.path.isfile(self.config_file):
              self.configure_backend()
 
</s> remove     """ Return the backend from config/.faceswap
        if file doesn't exist, create it """
 </s> add     """ Return the backend from config/.faceswap of from the `FACESWAP_BACKEND` Environment
    Variable.

    If file doesn't exist and a variable hasn't been set, create the config file. """ </s> remove def to_list(inp):
    """ Convert to list """
    if not isinstance(inp, (list, tuple)):
        return [inp]
    return list(inp)


 </s> add  </s> remove     def set_cpu_mode(cpu_mode):
        """ Set the CPU mode to 0 if not using tensorflow, else passed in arg """
 </s> add     def _set_cpu_mode(cpu_mode):
        """ Sets the CPU mode to False if not using Tensorflow, otherwise the given value.

        Parameters
        ----------
        cpu_mode: bool
            Set to ``True`` to perform some of the calculations on CPU for Nvidia backends,
            otherwise ``False``.

        Returns
        -------
        bool
            ``True`` if some calculations should be performed on CPU otherwise ``False``
        """ </s> remove     def get_name(self, name):
        """ Return unique layer name for requested block """
 </s> add     def _get_name(self, name):
        """ Return unique layer name for requested block.

        As blocks can be used multiple times, auto appends an integer to the end of the requested
        name to keep all block names unique

        Parameters
        ----------
        name: str
            The requested name for the layer

        Returns
        -------
        str
            The unique name for this layer
        """ </s> remove         self.cpu_mode = self.set_cpu_mode(cpu_mode)
 </s> add         self.cpu_mode = self._set_cpu_mode(cpu_mode)
        """ Return the backend from either the `FACESWAP_BACKEND` Environment Variable or from
        the :loc:`config/.faceswap` configuration file. """
        # Check if environment variable is set, if so use that
        if "FACESWAP_BACKEND" in os.environ:
            fs_backend = os.environ["FACESWAP_BACKEND"].lower()
            print("Setting Faceswap backend from environment variable to "
                  "{}".format(fs_backend.upper()))
            return fs_backend
          config_file = os.path.join(pypath, "config", ".faceswap")
          return config_file
  
      def get_backend(self):
        """ Return the backend from either the `FACESWAP_BACKEND` Environment Variable or from
        the :loc:`config/.faceswap` configuration file. """
        # Check if environment variable is set, if so use that
        if "FACESWAP_BACKEND" in os.environ:
            fs_backend = os.environ["FACESWAP_BACKEND"].lower()
            print("Setting Faceswap backend from environment variable to "
                  "{}".format(fs_backend.upper()))
            return fs_backend
          # Intercept for sphinx docs build
          if sys.argv[0].endswith("sphinx-build"):
              return "nvidia"
          if not os.path.isfile(self.config_file):
              self.configure_backend()
keep keep keep keep replace keep keep keep keep keep
 Simple backend unit tests (#1020)

* Add simple backend tests for lib.model
* Document lib.model
* Fix GMSD Loss for AMD
* Remove obsolete code from lib.model 
lib/utils.py