class_docstr: Softmax activation followed by a cross entropy loss.
class_docstr_tok: ["Softmax","activation","followed","by","a","cross","entropy","loss","."]
code: def forward_chainerx(self, inputs):
      if self.reduce == "mean" and self.normalize:
          x, t = inputs
          n_classes = x.shape[1]
          score = chainerx.log_softmax(x, axis=1)
          mask = (
              t[:, chainerx.newaxis]
              == chainerx.arange(
                  n_classes, dtype=t.dtype, device=x.device
              )
          ).astype(score.dtype)
          y = (score * mask).sum() * (-1 / mask.sum())
          return (y,)
  
      x, t = inputs
      y = chainerx.softmax_cross_entropy(x, t)
      if self.reduce == "mean":
          return (y.mean(),)
      return (y,)
  
imports: import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function_node
  from chainer.functions.activation import log_softmax
  from chainer.utils import type_check
  from chainer import variable
  import chainerx
label_desc: Use image node_id 4 for calling the SoftmaxCrossEntropy obj's underlying member method code with example usage: obj.forward_chainerx(inputs) and returns: y, y, y