code: def test_softmax_layer() -> None:
      param = ng.p.Array(shape=(4, 3))
      param.random_state.seed(12)
      param.add_layer(_datalayers.SoftmaxSampling(arity=3))
      assert param.value.tolist() == [0, 2, 0, 1]
      assert param.value.tolist() == [
          0,
          2,
          0,
          1,
      ], "Different indices at the second call"
      del param.value
      assert param.value.tolist() == [
          0,
          2,
          2,
          0,
      ], "Same indices after resampling"
      param.value = [0, 1, 2, 0]  # type: ignore
      assert param.value.tolist() == [0, 1, 2, 0]
      expected = np.zeros((4, 3))
      expected[[0, 1, 2, 3], [0, 1, 2, 0]] = 0.6931
      np.testing.assert_array_almost_equal(
          param._value, expected, decimal=4
      )
  
imports: import pytest
  import numpy
  import nevergrad
  from nevergrad.common import testing
  import nevergrad.common.typing
  from .None import _datalayers
  from .None import helpers
label_desc: Use image node_id 10 for calling a global function with example usage: test_softmax_layer() without return types