docstr: Convert a ndarray to a DenseTensor which would be used in Java side.
docstr_tok: ["Convert","a","ndarray","to","a","DenseTensor","which","would","be","used","in","Java","side","."]
code: def from_ndarray(cls, a_ndarray, bigdl_type="float"):
      """
      Convert a ndarray to a DenseTensor which would be used in Java side.
      """
      if a_ndarray is None:
          return None
      invalidInputError(
          isinstance(a_ndarray, np.ndarray),
          "input should be a np.ndarray, not %s" % type(a_ndarray),
      )
      return cls(a_ndarray, a_ndarray.shape, bigdl_type)
  
imports: import functools
  import glob
  import os
  import subprocess
  import tempfile
  import uuid
  from urllib.parse import urlparse
  import numpy
  from bigdl.dllib.utils.common import Sample, JTensor, JavaCreator, _get_gateway, _py2java, _java2py
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 2 for calling the JTensor obj's underlying member method code with example usage: obj.from_ndarray(cls, a_ndarray, bigdl_type) and returns: cls, None