class_docstr: Internal representation of minibatch data.
  
  Args:
      batch: batch input for `var`.
       It can be:
  
        * a pure Python structure (list of lists, ...),
        * a list of NumPy arrays or SciPy sparse CSR matrices
        * a :class:`~cntk.core.Value` object (e.g. returned by :func:`one_hot`)
      seq_starts (list of `bool`\ s or None): if None, every sequence is
       treated as a new sequence. Otherwise, it is interpreted as a list of
       Booleans that tell whether a sequence is a new sequence (`True`) or a
       continuation of the sequence in the same slot of the previous
       minibatch (`False`)
      device (:class:`~cntk.device.DeviceDescriptor`): device this value
       should be put on
class_docstr_tok: ["Internal","representation","of","minibatch","data",".","Args",":","batch",":","batch","input","for","`","var","`",".","It","can","be",":","*","a","pure","Python","structure","(","list","of","lists",",","...",")",",","*","a","list","of","NumPy","arrays","or","SciPy","sparse","CSR","matrices","*","a",":","class",":","`","~cntk.core.Value","`","object","(","e.g",".","returned","by",":","func",":","`","one_hot","`",")","seq_starts","(","list","of","`","bool","`","\\","s","or","None",")",":","if","None",",","every","sequence","is","treated","as","a","new","sequence",".","Otherwise",",","it","is","interpreted","as","a","list","of","Booleans","that","tell","whether","a","sequence","is","a","new","sequence","(","`","True","`",")","or","a","continuation","of","the","sequence","in","the","same","slot","of","the","previous","minibatch","(","`","False","`",")","device","(",":","class",":","`","~cntk.device.DeviceDescriptor","`",")",":","device","this","value","should","be","put","on"]
docstr: Creates a :class:`~cntk.core.Value` object.
  
  Args:
      var (:class:`~cntk.variables.Variable`): variable into which
       ``data`` is passed
      data: data for `var`.
       It can be:
  
        * a single NumPy array denoting the full minibatch
        * a list of NumPy arrays or SciPy sparse CSR matrices
        * a single NumPy array denoting one parameter or constant
      seq_starts (list of `bool`\ s or None): if None, every sequence is
       treated as a new sequence. Otherwise, it is interpreted as a list of
       Booleans that tell whether a sequence is a new sequence (`True`) or a
       continuation of the sequence in the same slot of the previous
       minibatch (`False`)
      device (:class:`~cntk.device.DeviceDescriptor`, default None): device
       this value should be put on
      read_only (bool, default False): whether the data is read only
  
  Returns:
      :class:`~cntk.core.Value` object.
docstr_tok: ["Creates","a",":","class",":","`","~cntk.core.Value","`","object",".","Args",":","var","(",":","class",":","`","~cntk.variables.Variable","`",")",":","variable","into","which","``","data","``","is","passed","data",":","data","for","`","var","`",".","It","can","be",":","*","a","single","NumPy","array","denoting","the","full","minibatch","*","a","list","of","NumPy","arrays","or","SciPy","sparse","CSR","matrices","*","a","single","NumPy","array","denoting","one","parameter","or","constant","seq_starts","(","list","of","`","bool","`","\\","s","or","None",")",":","if","None",",","every","sequence","is","treated","as","a","new","sequence",".","Otherwise",",","it","is","interpreted","as","a","list","of","Booleans","that","tell","whether","a","sequence","is","a","new","sequence","(","`","True","`",")","or","a","continuation","of","the","sequence","in","the","same","slot","of","the","previous","minibatch","(","`","False","`",")","device","(",":","class",":","`","~cntk.device.DeviceDescriptor","`",",","default","None",")",":","device","this","value","should","be","put","on","read_only","(","bool",",","default","False",")",":","whether","the","data","is","read","only","Returns",":",":","class",":","`","~cntk.core.Value","`","object","."]
code: def create(var, data, seq_starts=None, device=None, read_only=False):
      """
      Creates a :class:`~cntk.core.Value` object.
  
      Args:
          var (:class:`~cntk.variables.Variable`): variable into which
           ``data`` is passed
          data: data for `var`.
           It can be:
  
            * a single NumPy array denoting the full minibatch
            * a list of NumPy arrays or SciPy sparse CSR matrices
            * a single NumPy array denoting one parameter or constant
          seq_starts (list of `bool`\\ s or None): if None, every sequence is
           treated as a new sequence. Otherwise, it is interpreted as a list of
           Booleans that tell whether a sequence is a new sequence (`True`) or a
           continuation of the sequence in the same slot of the previous
           minibatch (`False`)
          device (:class:`~cntk.device.DeviceDescriptor`, default None): device
           this value should be put on
          read_only (bool, default False): whether the data is read only
  
      Returns:
          :class:`~cntk.core.Value` object.
      """
      if not isinstance(var, cntk_py.Variable):
          raise TypeError('Variable expected, but got "%s"' % type(var))
  
      if not var.dynamic_axes:
          # No dynamic axes -> we can pass everything in one go
          data = Value._as_best_data_type(var, data)
          # Since the core API's Value does not copy single NDArrayViews,
          # we cannot borrow the memory here.
          ndav = NDArrayView.from_data(
              data, device=device, borrow=False
          )
  
          return cntk_py.Value(ndav)
  
      elif (
          len(var.dynamic_axes) <= 1
          and isinstance(data, list)
          and len(data) > 1
      ):
          warnings.warn(
              "you provided the minibatch data as a list, but "
              'your corresponding input variable (uid "%s") has '
              "only one dynamic axis (batch axis). To speed up "
              "graph execution, please convert the data "
              "beforehand into one NumPy array to speed up "
              "training." % var.uid
          )
  
      if isinstance(data, cntk_py.NDArrayView):
          return cntk_py.Value(data)
  
      if isinstance(data, np.ndarray):
          # The outermost axis has to be Python list. If the user passes a
          # full minibatch as one NumPy array, we have to convert it.
          if data.dtype == object:
              raise ValueError(
                  "dtype object is not supported. If this is a "
                  "batch of sequences, you need to pass them as a "
                  "pure-Python list of NumPy arrays"
              )
  
          if seq_starts:
              data = list(np.atleast_1d(data))
          else:
              data = Value._as_best_data_type(var, data)
              ndav = NDArrayView.from_data(data, device)
  
              return cntk_py.Value(ndav)
  
      if isinstance(data, sparse.csr_matrix):
          if seq_starts:
              raise ValueError(
                  "seq_starts are not supported with data specified as a single "
                  "SciPy sparse CSR matrix. Please provide a list instead"
              )
          else:
              data = Value._as_best_data_type(var, data)
              ndav = NDArrayView.from_data(data, device)
  
              return cntk_py.Value(ndav)
  
      if not isinstance(data, list):
          raise ValueError(
              "batch must be a list of NumPy arrays or "
              "SciPy CSR matrices"
          )
  
      # NDArrayViews are all created on CPU. The Value object later then will
      # move it to the requested device.
      # As Value will later create copies anyways, we do not create copies in
      # NDArrayView itself. Because of that, we need to keep around the
      # instances _as_best_data_type() until we have passed them to
      # Value_create() where it will be copied further.
      data = [Value._as_best_data_type(var, sample) for sample in data]
      device = device or use_default_device()
      borrow = device.type() == DeviceKind.CPU
      list_of_ndavs = [
          NDArrayView.from_data(sample, device=cpu(), borrow=borrow)
          for sample in data
      ]
  
      from cntk.internal import sanitize_shape
  
      value = cntk_py.Value_create(
          sanitize_shape(var.shape),
          list_of_ndavs,
          seq_starts or [],
          device,
          read_only,
          True,
      )  # always create a copy in Value
  
      return value
  
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 4 for calling the Value obj's underlying member method code with example usage: obj.create(var, data, seq_starts, device, read_only) and returns: value, cntk_py, cntk_py, cntk_py, cntk_py