code: def compare_ssim_ignite_skiimg(
      y_pred: torch.Tensor,
      y: torch.Tensor,
      device: torch.device,
      precision: float = 2e-5,  # default to float32 expected precision
      *,
      skimg_y_pred: Union[np.ndarray, None] = None,
      skimg_y: Union[np.ndarray, None] = None,
      data_range: float = 1.0,
      kernel_size: Union[int, Sequence[int]] = 11,
      gaussian: bool = True,
      use_sample_covariance: bool = False,
  ):
      sigma = 1.5
  
      ssim = SSIM(data_range=data_range, sigma=sigma, device=device)
      ssim.update((y_pred, y))
      ignite_ssim = ssim.compute()
  
      if y_pred.dtype == torch.bfloat16:
          y_pred = y_pred.to(dtype=torch.float16)
  
      if skimg_y_pred is None:
          skimg_y_pred = y_pred.cpu().numpy()
      if skimg_y is None:
          skimg_y = skimg_y_pred * 0.8
  
      skimg_ssim = ski_ssim(
          skimg_y_pred,
          skimg_y,
          win_size=kernel_size,
          sigma=sigma,
          channel_axis=1,
          gaussian_weights=gaussian,
          data_range=data_range,
          use_sample_covariance=use_sample_covariance,
      )
  
      assert isinstance(ignite_ssim, float)
      assert np.allclose(ignite_ssim, skimg_ssim, atol=precision)
  
file_path: ignite/tests/ignite/metrics/test_ssim.py
imports: from typing import Sequence, Union
  import numpy
  import pytest
  import torch
  from skimage.metrics import structural_similarity
  import ignite.distributed
  from ignite.exceptions import NotComputableError
  from ignite.metrics import SSIM
label_desc: Use image node_id 4 for calling a global function with example usage: compare_ssim_ignite_skiimg(y_pred, y, device, precision) without return types