class_docstr: Criterion that computes Tversky Coefficient loss.
  
  According to :cite:`salehi2017tversky`, we compute the Tversky Coefficient as follows:
  
  .. math::
  
      \text{S}(P, G, \alpha; \beta) =
        \frac{|PG|}{|PG| + \alpha |P \setminus G| + \beta |G \setminus P|}
  
  Where:
     - :math:`P` and :math:`G` are the predicted and ground truth binary
       labels.
     - :math:`\alpha` and :math:`\beta` control the magnitude of the
       penalties for FPs and FNs, respectively.
  
  Note:
     - :math:`\alpha = \beta = 0.5` => dice coeff
     - :math:`\alpha = \beta = 1` => tanimoto coeff
     - :math:`\alpha + \beta = 1` => F beta coeff
  
  Args:
      alpha: the first coefficient in the denominator.
      beta: the second coefficient in the denominator.
      eps: scalar for numerical stability.
  
  Shape:
      - Pred: :math:`(N, C, H, W)` where C = number of classes.
      - Target: :math:`(N, H, W)` where each value is
        :math:`0 ≤ targets[i] ≤ C-1`.
  
  Examples:
      >>> N = 5  # num_classes
      >>> criterion = TverskyLoss(alpha=0.5, beta=0.5)
      >>> pred = torch.randn(1, N, 3, 5, requires_grad=True)
      >>> target = torch.empty(1, 3, 5, dtype=torch.long).random_(N)
      >>> output = criterion(pred, target)
      >>> output.backward()
code: def forward(
      self, pred: torch.Tensor, target: torch.Tensor
  ) -> torch.Tensor:
      return tversky_loss(pred, target, self.alpha, self.beta, self.eps)
  
file_path: kornia/kornia/losses/tversky.py
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from torch import nn
  from kornia.utils.one_hot import one_hot
label_desc: Use image node_id 2 for calling the TverskyLoss obj's underlying member method code with example usage: obj.forward(pred, target) and returns: tversky_loss