                                                self._mask_channels):
              logger.debug("Processing loss function: (func: %s, weight: %s, mask_channel: %s)",
                           func, weight, mask_channel)
              n_true, n_pred = self._apply_mask(y_true, y_pred, mask_channel)
              if isinstance(func, DSSIMObjective):
                  # Extract Image Patches in SSIM requires that y_pred be of a known shape, so
                  # specifically reshape the tensor.
                  n_pred = K.reshape(n_pred, K.int_shape(y_pred))
              this_loss = func(n_true, n_pred)
              loss_dims = K.ndim(this_loss)
              loss += (K.mean(this_loss, axis=list(range(1, loss_dims))) * weight)
          return loss
  
 
</s> remove         if hasattr(loss_func, "__name__") and loss_func.__name__ == "logcosh":
            pytest.skip("LogCosh Loss is not currently compatible with PlaidML")
 </s> add  </s> remove         "is robust to outliers. NB: Due to a bug in PlaidML, this loss does not work on AMD "
        "cards."),
 </s> add         "is robust to outliers."),
            # Some loss functions requires that y_pred be of a known shape, so specifically
            # reshape the tensor.
            n_pred = K.reshape(n_pred, K.int_shape(y_pred))
                                                self._mask_channels):
              logger.debug("Processing loss function: (func: %s, weight: %s, mask_channel: %s)",
                           func, weight, mask_channel)
              n_true, n_pred = self._apply_mask(y_true, y_pred, mask_channel)
            # Some loss functions requires that y_pred be of a known shape, so specifically
            # reshape the tensor.
            n_pred = K.reshape(n_pred, K.int_shape(y_pred))
            # Some loss functions requires that y_pred be of a known shape, so specifically
            # reshape the tensor.
            n_pred = K.reshape(n_pred, K.int_shape(y_pred))
            # Some loss functions requires that y_pred be of a known shape, so specifically
            # reshape the tensor.
            n_pred = K.reshape(n_pred, K.int_shape(y_pred))
            # Some loss functions requires that y_pred be of a known shape, so specifically
            # reshape the tensor.
            n_pred = K.reshape(n_pred, K.int_shape(y_pred))
              this_loss = func(n_true, n_pred)
              loss_dims = K.ndim(this_loss)
              loss += (K.mean(this_loss, axis=list(range(1, loss_dims))) * weight)
          return loss
  
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Enable LogCosh Loss for AMD 
lib/model/loss/loss_plaid.py