code: def test_2d_sequence_sparse_one_hot():
      x = C.sequence.input_variable((2,))
      num_classes = 3
      sparse_one_hot = C.one_hot(x, num_classes, sparse_output=True)
      indices = [np.asarray([[2, 1], [0, 2]]), np.asarray([[1, 0]])]
      result = sparse_one_hot.eval({x: indices}, as_numpy=False)
  
      result_dense = _to_dense(result, True)
      assert np.array_equal(
          result_dense[0],
          np.eye(num_classes, dtype=np.float32)[indices[0]],
      )
      assert np.array_equal(
          result_dense[1],
          np.eye(num_classes, dtype=np.float32)[indices[1]],
      )
  
imports: import numpy
  import scipy
  import pytest
  import cntk
  from .ops_test_utils import cntk_device
  from cntk.axis import Axis
  from ..None import constant
  from cntk.tests.test_utils import _to_dense
label_desc: Use image node_id 9 for calling a global function with example usage: test_2d_sequence_sparse_one_hot() without return types