class_docstr: Creates an empty dense internal data representation of a
  :class:`~cntk.core.Value` object.
  To create an NDArrayView from a NumPy array, use :meth:`from_dense`.
  To create an NDArrayView from a sparse array, use :meth:`from_csr`.
  
  Args:
      shape (tuple): shape of the data
      data_type (np.float32, np.float64, np.float16): data type of the data
      device (:class:`~cntk.device.DeviceDescriptor`): device this value
       should be put on
class_docstr_tok: ["Creates","an","empty","dense","internal","data","representation","of","a",":","class",":","`","~cntk.core.Value","`","object",".","To","create","an","NDArrayView","from","a","NumPy","array",",","use",":","meth",":","`","from_dense","`",".","To","create","an","NDArrayView","from","a","sparse","array",",","use",":","meth",":","`","from_csr","`",".","Args",":","shape","(","tuple",")",":","shape","of","the","data","data_type","(","np.float32",",","np.float64",",","np.float16",")",":","data","type","of","the","data","device","(",":","class",":","`","~cntk.device.DeviceDescriptor","`",")",":","device","this","value","should","be","put","on"]
docstr: Create an :class:`NDArrayView` instance from a SciPy sparse array in CSR
  format.
  
  Args:
      csr_array (scipy.sparse.csr_matrix): SciPy sparse matrix in CSR
       format
      device (:class:`~cntk.device.DeviceDescriptor`): device this value
       should be put on
      read_only (bool, optional): whether the data can be modified or
       not (default False)
      borrow (bool, default False): whether nd_array memory can be
       borrowed internally to speed up the data creation
      shape (tuple, default None): shape of the created NDArrayView.
       If unspecified, the created NDArrayView has the same shape as the csr_matrix.
       Otherwise, an NDArrayView object of specified shape is created using csr_data.
       The total size and number of rows of csr_data must match specified NDArrayView shape.
  
  Returns:
      :class:`NDArrayView` instance
docstr_tok: ["Create","an",":","class",":","`","NDArrayView","`","instance","from","a","SciPy","sparse","array","in","CSR","format",".","Args",":","csr_array","(","scipy.sparse.csr_matrix",")",":","SciPy","sparse","matrix","in","CSR","format","device","(",":","class",":","`","~cntk.device.DeviceDescriptor","`",")",":","device","this","value","should","be","put","on","read_only","(","bool",",","optional",")",":","whether","the","data","can","be","modified","or","not","(","default","False",")","borrow","(","bool",",","default","False",")",":","whether","nd_array","memory","can","be","borrowed","internally","to","speed","up","the","data","creation","shape","(","tuple",",","default","None",")",":","shape","of","the","created","NDArrayView",".","If","unspecified",",","the","created","NDArrayView","has","the","same","shape","as","the","csr_matrix",".","Otherwise",",","an","NDArrayView","object","of","specified","shape","is","created","using","csr_data",".","The","total","size","and","number","of","rows","of","csr_data","must","match","specified","NDArrayView","shape",".","Returns",":",":","class",":","`","NDArrayView","`","instance"]
code: def from_csr(
      csr_array, device=None, read_only=False, borrow=False, shape=None
  ):
      """
      Create an :class:`NDArrayView` instance from a SciPy sparse array in CSR
      format.
  
      Args:
          csr_array (scipy.sparse.csr_matrix): SciPy sparse matrix in CSR
           format
          device (:class:`~cntk.device.DeviceDescriptor`): device this value
           should be put on
          read_only (bool, optional): whether the data can be modified or
           not (default False)
          borrow (bool, default False): whether nd_array memory can be
           borrowed internally to speed up the data creation
          shape (tuple, default None): shape of the created NDArrayView.
           If unspecified, the created NDArrayView has the same shape as the csr_matrix.
           Otherwise, an NDArrayView object of specified shape is created using csr_data.
           The total size and number of rows of csr_data must match specified NDArrayView shape.
  
      Returns:
          :class:`NDArrayView` instance
      """
      if not sparse.isspmatrix_csr(csr_array):
          raise TypeError(
              "only CSR is supported as of now. Please "
              "convert your data using 'tocsr()'"
          )
  
      if shape is None:
          shape = csr_array.shape
  
      if device is None:
          device = use_default_device()
  
      if shape[-1] != csr_array.shape[-1]:
          raise ValueError(
              "csr_matrix row size (%d) does not match the least "
              "significant axis dimension (%d) of the NDArrayView shape"
              % (csr_array.shape[-1], shape[-1])
          )
  
      import functools
      import operator
  
      csr_array_size = functools.reduce(operator.mul, csr_array.shape)
      ndarrayview_size = functools.reduce(operator.mul, shape)
      if csr_array_size != ndarrayview_size:
          raise ValueError(
              "csr_matrix total size (%d) does not match the total size "
              "(%d) of the NDArrayView shape"
              % (csr_array_size, ndarrayview_size)
          )
  
      return cntk_py.NDArrayView(
          shape,
          csr_array.data,
          csr_array.indptr,
          csr_array.indices,
          device,
          read_only,
          borrow,
      )
  
imports: import warnings
  import numbers
  import numpy
  from scipy import sparse
  from .None import cntk_py
  from .device import use_default_device, cpu, DeviceKind
  from cntk.internal import typemap
  from cntk.internal.sanitize import sanitize_batch, _sparse_to_dense_network_cache, data_type_to_dtype
label_desc: Use image node_id 3 for calling the NDArrayView obj's underlying member method code with example usage: obj.from_csr(csr_array, device, read_only, borrow, shape) and returns: cntk_py