code: def asarray(x, dtype=None, order=None, chunk_size=None):
      """Convert the input to an array.
  
      Parameters
      ----------
      a : array_like
          Input data, in any form that can be converted to a tensor.  This
          includes lists, lists of tuples, tuples, tuples of tuples, tuples
          of lists and tensors.
      dtype : data-type, optional
          By default, the data-type is inferred from the input data.
      order : {'C', 'F'}, optional
          Whether to use row-major (C-style) or
          column-major (Fortran-style) memory representation.
      chunk_size: int, tuple, optional
          Specifies chunk size for each dimension.
  
      Returns
      -------
      out : Tensor
          Tensor interpretation of `a`.  No copy is performed if the input
          is already an ndarray with matching dtype and order.  If `a` is a
          subclass of ndarray, a base class ndarray is returned.
  
      See Also
      --------
      ascontiguousarray : Convert input to a contiguous tensor.
      asfortranarray : Convert input to a tensor with column-major
                       memory order.
  
      Examples
      --------
      Convert a list into a tensor:
  
      >>> import mars.tensor as mt
  
      >>> a = [1, 2]
      >>> mt.asarray(a).execute()
      array([1, 2])
  
      Existing arrays are not copied:
  
      >>> a = mt.array([1, 2])
      >>> mt.asarray(a) is a
      True
  
      If `dtype` is set, array is copied only if dtype does not match:
  
      >>> a = mt.array([1, 2], dtype=mt.float32)
      >>> mt.asarray(a, dtype=mt.float32) is a
      True
      >>> mt.asarray(a, dtype=mt.float64) is a
      False
      """
      return array(
          x, dtype=dtype, copy=False, order=order, chunk_size=chunk_size
      )
  
imports: import numpy
  from ...None import opcodes
  from ...lib.sparse.core import issparse, get_array_module, cp, cps, sps
  from ...lib.sparse import SparseNDArray
  from ...serialization.serializables import FieldTypes, AnyField, NDArrayField, TupleField
  from ...utils import on_serialize_shape, on_deserialize_shape
  from ..core import TENSOR_TYPE, TensorOrder, TensorData, Tensor
  from ..utils import get_chunk_slices
  from ..array_utils import array_module, is_array, is_cupy
  from .core import TensorNoInput
  from .scalar import scalar
label_desc: Use image node_id 4 for calling a global function with example usage: asarray(x, dtype, order, chunk_size) and returns: array