code: def ref_categorical_cross_entropy(x, l, axis):
      orig_x = x.copy()
      x = np.rollaxis(x, axis, x.ndim).reshape(-1, x.shape[axis])
      ll = np.rollaxis(l, axis, x.ndim).flatten()
      y = -np.log(
          np.maximum(
              x[np.arange(x.shape[0]), ll], np.finfo(np.float32).tiny
          )
      )
      y[ll == -1] = 0
      return y.reshape(l.shape)
  
file_path: nnabla/python/test/function/test_categorical_cross_entropy.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: ref_categorical_cross_entropy(x, l, axis) and returns: y