class_docstr: This metric computes the top-k accuracy using a similar interface to
  :class:`~torch.nn.CrossEntropyLoss`.
  
  Args:
      k (int): Specifies the value of ``k`` in the top-k accuracy.
      ignore_index (int): Specifies a target value that is ignored and does not contribute
          to the top-k accuracy. (Default value = -100)
      reduction (string, optional): Specifies the reduction to apply to the output:
          ``'none'`` | ``'mean'`` | ``'sum'``. ``'none'``: no reduction will be applied,
          ``'mean'``: the sum of the output will be divided by the number of
          elements in the output, ``'sum'``: the output will be summed.
  
  
  Possible string name:
      - ``'top{k}'``
      - ``'top{k}_acc'``
      - ``'top{k}_accuracy'``
  
      for ``{k}`` from 1 to 10, 20, 30, ..., 100.
  
  Keys in :class:`logs<poutyne.Callback>` dictionary of callbacks:
      - Train: ``'top{k}'``
      - Validation: ``'val_top{k}'``
  
      where ``{k}`` is replaced by the value of parameter ``k``.
  
  Shape:
      - Input: :math:`(N, C)` where `C = number of classes`, or
        :math:`(N, C, d_1, d_2, ..., d_K)` with :math:`K \geq 1` in the case of
        `K`-dimensional top-k accuracy.
      - Target: :math:`(N)` where each value is :math:`0 \leq \text{targets}[i] \leq C-1`, or
        :math:`(N, d_1, d_2, ..., d_K)` with :math:`K \geq 1` in the case of
        K-dimensional top-k accuracy.
      - Output: The top-k accuracy.
code: def forward(self, y_pred, y_true):
      return topk(
          y_pred,
          y_true,
          self.k,
          ignore_index=self.ignore_index,
          reduction=self.reduction,
      )
  
imports: from abc import ABC
  import torch.nn
  from poutyne.framework.metrics.metrics_registering import do_register_metric_func, register_metric_func
label_desc: Use image node_id 2 for calling the TopKAccuracy obj's underlying member method code with example usage: obj.forward(y_pred, y_true) and returns: topk