code: def _to_dense(val, is_sequence=False):
      if is_sequence:
          x = C.sequence.input_variable(val.shape[2:], is_sparse=True)
      else:
          x = C.input_variable(val.shape[1:], is_sparse=True)
  
      dense = C.times(
          x, C.constant(value=np.eye(val.shape[-1], dtype=np.float32))
      )
      return dense.eval({x: val}, device=val.device)
  
file_path: CNTK/bindings/python/cntk/tests/test_utils.py
imports: import numpy
  import scipy
  import pytest
  import cntk
label_desc: Use image node_id 2 for calling a global function with example usage: _to_dense(val, is_sequence) and returns: dense