code: def test_asarray_method():
      shape = (3,)
  
      var = C.sequence.input_variable(shape, is_sparse=True)
  
      data = [csr([[1, 0, 2], [5, 0, 1]])]
      # conversion array -> value
      val = asvalue(var, data)
      as_csr = val.as_sequences(var)
      for a, d in zip(as_csr, data):
          assert (a == d).toarray().all()
  
      var = C.input_variable(shape, is_sparse=True)
  
      data = csr([[1, 0, 2], [5, 0, 1]])
      # conversion array -> value
      val = asvalue(var, data)
      for v in [
          val,  # Value
          super(C.Value, val),  # cntk_py.Value
          val.data,  # NDArrayView
          super(C.NDArrayView, val.data),  # cntk_py.NDArrayView
      ]:
          as_csr = v.asarray()
          for a, d in zip(as_csr, data):
              assert (a == d).toarray().all()
  
imports: import pytest
  import numpy
  import scipy.sparse
  import cntk
  from cntk.ops.tests.ops_test_utils import cntk_device
  from cntk.internal import _value_as_sequence_or_array
  from cntk import asvalue
  from cntk.tests.test_utils import _to_dense, _to_csr
label_desc: Use image node_id 7 for calling a global function with example usage: test_asarray_method() without return types