code: def _forward(self, xp, inputs):
      y, t = inputs
  
      if self.ignore_label is not None:
          mask = t == self.ignore_label
          ignore_cnt = mask.sum()
  
          # will always be true when the true label is ignore_label
          # TODO(henry0312)
          #   If cupy.where returns indexes, we could make the code better.
          #   Also, we would need Advanced Indexing.
          pred = xp.where(
              mask, self.ignore_label, y.argmax(axis=1).reshape(t.shape)
          )
          count = (pred == t).sum() - ignore_cnt
          total = t.size - ignore_cnt
  
          if xp is numpy:
              # Avoid warning of `divide by zero`
              if total == 0:
                  acc = xp.asarray(0.0, dtype=y.dtype)
              else:
                  acc = xp.asarray(float(count) / total, dtype=y.dtype)
          else:
              acc = xp.where(
                  total == 0,
                  xp.asarray(0.0, dtype=y.dtype),
                  xp.asarray(count / total, dtype=y.dtype),
              )
      else:
          pred = y.argmax(axis=1).reshape(t.shape)
          if xp is chainerx:
              # TODO(niboshi): ChainerX mean() does not support dtype
              # argument. Support it.
              acc = xp.asarray(
                  (pred == t).astype(y.dtype, False).mean()
              )
          else:
              acc = xp.asarray((pred == t).mean(dtype=y.dtype))
      return (acc,)
  
file_path: chainer/chainer/functions/evaluation/accuracy.py
imports: import numpy
  import six
  from chainer.backends import cuda
  from chainer import function_node
  from chainer.utils import type_check
  import chainerx
label_desc: Use image node_id 6 for calling the Accuracy obj's underlying member method code with example usage: obj._forward(xp, inputs) and returns: acc