  
              self.updates.append(K.update(p, new_p))
          return self.updates
  
      def update_1(self, params):
          """ First update on CPU or GPU """
          ms = [K.zeros(K.int_shape(p), dtype=K.dtype(p)) for p in params]
          vs = [K.zeros(K.int_shape(p), dtype=K.dtype(p)) for p in params]
          if self.amsgrad:
              vhats = [K.zeros(K.int_shape(p), dtype=K.dtype(p)) for p in params]
          else:
 
</s> remove             ms, vs, vhats = self.update_1(params)
 </s> add             ms, vs, vhats = self._update_1(params) </s> remove                 ms, vs, vhats = self.update_1(params)
 </s> add                 ms, vs, vhats = self._update_1(params) </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 l_p_norm(y_true, y_pred, p_norm=np.inf):
    """
    Calculate the L-p norm as a loss function,
    valid choics of p are [0,1,no.inf]
    """
    diff = y_true - y_pred
    loss = tf.norm(diff, ord=p_norm, axis=-1)
    return loss


 </s> add 
    def _update_1(self, params):
        """ Perform the first update. Run under CPU context if running on Tensorflow and CPU mode
        is enabled, otherwise run on the default device. """
  
              self.updates.append(K.update(p, new_p))
          return self.updates
  
    def _update_1(self, params):
        """ Perform the first update. Run under CPU context if running on Tensorflow and CPU mode
        is enabled, otherwise run on the default device. """
    def _update_1(self, params):
        """ Perform the first update. Run under CPU context if running on Tensorflow and CPU mode
        is enabled, otherwise run on the default device. """
          ms = [K.zeros(K.int_shape(p), dtype=K.dtype(p)) for p in params]
          vs = [K.zeros(K.int_shape(p), dtype=K.dtype(p)) for p in params]
          if self.amsgrad:
              vhats = [K.zeros(K.int_shape(p), dtype=K.dtype(p)) for p in params]
          else:
keep keep keep keep replace 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/model/optimizers.py