code: def test_softmax_cross_entropy_backward_with_negative_label(
      seed, axis, ctx, func_name
  ):
      from nbla_test_utils import (
          compute_analytical_and_numerical_grad_graph,
      )
  
      ishape = [2, 3, 4]
      rng = np.random.RandomState(seed)
  
      l_shape = list(ishape)
      l_shape[axis] = 1
      n_class = ishape[axis]
  
      inp0 = nn.Variable.from_numpy_array(
          rng.randn(2, 3, 4).astype(np.float32) * 2
      ).apply(need_grad=True)
      inp1 = nn.Variable.from_numpy_array(
          rng.randint(-1, n_class, size=l_shape)
      ).apply(need_grad=False)
      out = F.sum(F.softmax_cross_entropy(inp0, inp1, axis=axis))
      out.g.fill(1.0)
      inp0.g.fill(0)
      inp1.g.fill(0)
      (
          analytical_grad,
          numerical_grad,
      ) = compute_analytical_and_numerical_grad_graph(
          out, [inp0, inp1], recompute_graph=True
      )
      numerical_grad[inp0.size :] = 0
      assert_allclose(
          analytical_grad, numerical_grad, rtol=0.01, atol=0.01
      )
  
file_path: nnabla/python/test/function/test_softmax_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 4 for calling a global function with example usage: test_softmax_cross_entropy_backward_with_negative_label(seed, axis, ctx, func_name) without return types