code: def _ssim_multichannel(
      x: Tensor,
      y: Tensor,
      data_range: float,
      window_size: int,
      k1: float,
      k2: float,
      gaussian_std: float,
  ) -> Tensor:
      """
      Applies SSIM independently to each channel.
  
      Given a multi-channel image, applies single-channel SSIM calculations
      to each channel independently, then stacks the per-channel results
      along a new axis.
  
      Args:
          x: a batch of images of shape [batch_size, num_channels,
              height, width].
          y: a batch of images of shape [batch_size, num_channels,
              height, width].
          data_range: dynamic range of the input tensors.
          window_size: window size for SSIM calculation.
          k1: k1 parameter for SSIM calculation.
          k2: k2 parameter for SSIM calculation.
          gaussian_std: standard deviation of Gaussian filter to use in SSIM
              calculations.
  
      Returns:
          Tensor of shape [num_channels, batch_size, 2], where output[i] is
          the output of _ssim_single_channel applied to channel i.
      """
  
      num_channels = x.shape[1]
      return torch.stack(
          [
              _ssim_single_channel(
                  x=x[:, i : i + 1],
                  y=y[:, i : i + 1],
                  window_size=window_size,
                  data_range=data_range,
                  k1=k1,
                  k2=k2,
                  gaussian_std=gaussian_std,
              )
              for i in range(num_channels)
          ]
      )
  
file_path: NeuralCompression/neuralcompression/functional/_multiscale_structural_similarity.py
imports: from typing import Callable, Optional, Sequence
  import torch
  from torch import Tensor
  from torch.nn import functional
label_desc: Use image node_id 4 for calling a global function with example usage: _ssim_multichannel(x, y, data_range, window_size, k1, k2, gaussian_std) and returns: torch