class_docstr: Compute Pixel Based Visual Information Fidelity (VIF_).
  
  As input to ``forward`` and ``update`` the metric accepts the following input
  
  - ``preds`` (:class:`~torch.Tensor`): Predictions from model of shape ``(N,C,H,W)`` with H,W ≥ 41
  - ``target`` (:class:`~torch.Tensor`): Ground truth values of shape ``(N,C,H,W)`` with H,W ≥ 41
  
  As output of `forward` and `compute` the metric returns the following output
  
  - ``vif-p`` (:class:`~torch.Tensor`): Tensor with vif-p score
  
  Args:
      sigma_n_sq: variance of the visual noise
      kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
  
  Example:
      >>> import torch
      >>> _ = torch.manual_seed(42)
      >>> from torchmetrics.image import VisualInformationFidelity
      >>> preds = torch.randn([32, 3, 41, 41])
      >>> target = torch.randn([32, 3, 41, 41])
      >>> vif = VisualInformationFidelity()
      >>> vif(preds, target)
      tensor(0.0032)
code: def __init__(self, sigma_n_sq: float = 2.0, **kwargs: Any) -> None:
      super().__init__(**kwargs)
  
      if not isinstance(sigma_n_sq, float) and not isinstance(
          sigma_n_sq, int
      ):
          raise ValueError(
              f"Argument `sigma_n_sq` is expected to be a positive float or int, but got {sigma_n_sq}"
          )
  
      if sigma_n_sq < 0:
          raise ValueError(
              f"Argument `sigma_n_sq` is expected to be a positive float or int, but got {sigma_n_sq}"
          )
  
      self.add_state(
          "vif_score", default=tensor(0.0), dist_reduce_fx="sum"
      )
      self.add_state("total", default=tensor(0.0), dist_reduce_fx="sum")
      self.sigma_n_sq = sigma_n_sq
  
file_path: torchmetrics/src/torchmetrics/image/vif.py
imports: from typing import Any
  import torch
  from torch import Tensor, tensor
  from torchmetrics.functional.image.vif import _vif_per_channel
  from torchmetrics.metric import Metric
label_desc: Use image node_id 1 to create a new VisualInformationFidelity object from inherited base classes: Metric with example: obj = VisualInformationFidelity(sigma_n_sq)