code: def test_ssim_variable_batchsize(available_device):
      # Checks https://github.com/pytorch/ignite/issues/2532
      sigma = 1.5
      data_range = 1.0
      ssim = SSIM(data_range=data_range, sigma=sigma)
  
      y_preds = [
          torch.rand(12, 3, 28, 28, device=available_device),
          torch.rand(12, 3, 28, 28, device=available_device),
          torch.rand(8, 3, 28, 28, device=available_device),
          torch.rand(16, 3, 28, 28, device=available_device),
          torch.rand(1, 3, 28, 28, device=available_device),
          torch.rand(30, 3, 28, 28, device=available_device),
      ]
      y_true = [v * 0.8 for v in y_preds]
  
      for y_pred, y in zip(y_preds, y_true):
          ssim.update((y_pred, y))
  
      out = ssim.compute()
      ssim.reset()
      ssim.update((torch.cat(y_preds), torch.cat(y_true)))
      expected = ssim.compute()
      assert np.allclose(out, expected)
  
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 6 for calling a global function with example usage: test_ssim_variable_batchsize(available_device) without return types