  from lib.utils import get_backend
  
  from .normalization import *
  if get_backend() == "amd":
      from . import losses_plaid as losses
      from . import optimizers_plaid as optimizers
  else:
      from . import losses_tf as losses
      from . import optimizers_tf as optimizers
 
</s> remove         if isinstance(loss_func, losses.MSSSIMLoss):
            pytest.skip("MS-SSIM Loss is not currently compatible with PlaidML")
 </s> add  </s> remove         additional channels at the end of :param:`y_true`, so that they can be split off and
 </s> add         additional channels at the end of :attr:`y_true`, so that they can be split off and </s> remove         tensor
            The DSSIM Loss value
 </s> add         :class:`tf.Tensor`
            The output from the convolution
        """
        return K.depthwise_conv2d(image, kernel, strides=(1, 1), padding="valid")

    def _get_ssim(self, y_true: tf.Tensor, y_pred: tf.Tensor) -> Tuple[tf.Tensor, tf.Tensor]:
        """ Obtain the structural similarity between a batch of true and predicted images.

        Parameters
        ----------
        y_true: :class:`tf.Tensor`
            The input batch of ground truth images
        y_pred: :class:`tf.Tensor`
            The input batch of predicted images

        Returns
        -------
        :class:`tf.Tensor`
            The SSIM for the given images
        :class:`tf.Tensor`
            The Contrast for the given images
        """
        channels = K.int_shape(y_true)[-1]
        kernel = K.tile(self._kernel, (1, 1, channels, 1))

        # SSIM luminance measure is (2 * mu_x * mu_y + c1) / (mu_x ** 2 + mu_y ** 2 + c1)
        mean_true = self._depthwise_conv2d(y_true, kernel)
        mean_pred = self._depthwise_conv2d(y_pred, kernel)
        num_lum = mean_true * mean_pred * 2.0
        den_lum = K.square(mean_true) + K.square(mean_pred)
        luminance = (num_lum + self._c1) / (den_lum + self._c1)

        # SSIM contrast-structure measure is (2 * cov_{xy} + c2) / (cov_{xx} + cov_{yy} + c2)
        num_con = self._depthwise_conv2d(y_true * y_pred, kernel) * 2.0
        den_con = self._depthwise_conv2d(K.square(y_true) + K.square(y_pred), kernel)

        contrast = (num_con - num_lum + self._c2) / (den_con - den_lum + self._c2)

        # Average over the height x width dimensions
        axes = (-3, -2)
        ssim = K.mean(luminance * contrast, axis=axes)
        contrast = K.mean(contrast, axis=axes)

        return ssim, contrast

    def __call__(self, y_true: tf.Tensor, y_pred: tf.Tensor) -> tf.Tensor:
        """ Call the DSSIM  or MS-DSSIM Loss Function.

        Parameters
        ----------
        y_true: :class:`tf.Tensor`
            The input batch of ground truth images
        y_pred: :class:`tf.Tensor`
            The input batch of predicted images

        Returns
        -------
        :class:`tf.Tensor`
            The DSSIM or MS-DSSIM for the given images
    from . import losses_plaid as losses  # noqa
    from . import optimizers_plaid as optimizers  # noqa
  from lib.utils import get_backend
  
  from .normalization import *
  if get_backend() == "amd":
    from . import losses_plaid as losses  # noqa
    from . import optimizers_plaid as optimizers  # noqa
    from . import losses_plaid as losses  # noqa
    from . import optimizers_plaid as optimizers  # noqa
  else:
      from . import losses_tf as losses
      from . import optimizers_tf as optimizers
keep keep keep keep replace replace keep keep keep
 SSIM Updates
  - Standardize DSSIM Function
  - Implement MSSIM function for AMD 
lib/model/__init__.py