code: def test_categorical_cross_entropy_forward_backward(
      seed, axis, ctx, func_name
  ):
      from nbla_test_utils import function_tester
  
      ishape = [2, 3, 4]
      rng = np.random.RandomState(seed)
  
      l_shape = list(ishape)
      l_shape[axis] = 1
      n_class = ishape[axis]
  
      inputs = [
          rng.rand(2, 3, 4).astype(np.float32) * 0.9 + 0.05,
          rng.randint(-1, n_class, size=l_shape).astype(int),
      ]
  
      function_tester(
          rng,
          F.categorical_cross_entropy,
          ref_categorical_cross_entropy,
          inputs,
          atol_b=5e-2,
          func_args=[axis],
          backward=[True, False],
          ctx=ctx,
          func_name=func_name,
      )
  
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 2 for calling a global function with example usage: test_categorical_cross_entropy_forward_backward(seed, axis, ctx, func_name) without return types