class_docstr: Computes the true/false positives and true/false negatives rates for binary classification by group.
  
  Related to `Type I and Type II errors`_.
  
  Accepts the following input tensors:
  
  - ``preds`` (int or float tensor): ``(N, ...)``. If preds is a floating point tensor with values outside
    [0,1] range we consider the input to be logits and will auto apply sigmoid per element. Additionally,
    we convert to int tensor with thresholding using the value in ``threshold``.
  - ``target`` (int tensor): ``(N, ...)``.
  - ``groups`` (int tensor): ``(N, ...)``. The group identifiers should be ``0, 1, ..., (num_groups - 1)``.
  
  The additional dimensions are flatted along the batch dimension.
  
  Args:
      num_groups: The number of groups.
      threshold: Threshold for transforming probability to binary {0,1} predictions.
      ignore_index: Specifies a target value that is ignored and does not contribute to the metric calculation
      validate_args: bool indicating if input arguments and tensors should be validated for correctness.
          Set to ``False`` for faster computations.
      kwargs: Additional keyword arguments, see :ref:`Metric kwargs` for more info.
  
  Returns:
      The metric returns a dict with a group identifier as key and a tensor with the tp, fp, tn and fn rates as value.
  
  Example (preds is int tensor):
      >>> from torchmetrics.classification import BinaryGroupStatRates
      >>> target = torch.tensor([0, 1, 0, 1, 0, 1])
      >>> preds = torch.tensor([0, 1, 0, 1, 0, 1])
      >>> groups = torch.tensor([0, 1, 0, 1, 0, 1])
      >>> metric = BinaryGroupStatRates(num_groups=2)
      >>> metric(preds, target, groups)
      {'group_0': tensor([0., 0., 1., 0.]), 'group_1': tensor([1., 0., 0., 0.])}
  
  Example (preds is float tensor):
      >>> from torchmetrics.classification import BinaryGroupStatRates
      >>> target = torch.tensor([0, 1, 0, 1, 0, 1])
      >>> preds = torch.tensor([0.11, 0.84, 0.22, 0.73, 0.33, 0.92])
      >>> groups = torch.tensor([0, 1, 0, 1, 0, 1])
      >>> metric = BinaryGroupStatRates(num_groups=2)
      >>> metric(preds, target, groups)
      {'group_0': tensor([0., 0., 1., 0.]), 'group_1': tensor([1., 0., 0., 0.])}
docstr: Compute tp, fp, tn and fn rates based on inputs passed in to ``update`` previously.
docstr_tok: ["Compute","tp",",","fp",",","tn","and","fn","rates","based","on","inputs","passed","in","to","``","update","``","previously","."]
code: def compute(
      self,
  ) -> Dict[str, Tensor]:
      """Compute tp, fp, tn and fn rates based on inputs passed in to ``update`` previously."""
      results = torch.stack((self.tp, self.fp, self.tn, self.fn), dim=1)
  
      return {
          f"group_{i}": group / group.sum()
          for i, group in enumerate(results)
      }
  
imports: from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
  import torch
  from torch import Tensor
  from typing_extensions import Literal
  from torchmetrics.functional.classification.group_fairness import _binary_groups_stat_scores, _compute_binary_demographic_parity, _compute_binary_equal_opportunity
  from torchmetrics.functional.classification.stat_scores import _binary_stat_scores_arg_validation
  from torchmetrics.metric import Metric
  from torchmetrics.utilities import rank_zero_warn
  from torchmetrics.utilities.imports import _MATPLOTLIB_AVAILABLE
  from torchmetrics.utilities.plot import _AX_TYPE, _PLOT_OUT_TYPE
label_desc: Use image node_id 3 for calling the BinaryGroupStatRates obj's underlying member method code with example usage: obj.compute() and returns: unknown