code: def make_dl_tensor(obj):
      try:
          data, size = obj.buffer_info()
          typecode = obj.typecode
          itemsize = obj.itemsize
      except AttributeError:
          data = obj.ctypes.data
          size = obj.size
          typecode = obj.dtype.char
          itemsize = obj.itemsize
  
      device = DLDevice(DLDeviceType.kDLCPU, 0)
      datatype = make_dl_datatype(typecode, itemsize)
      ndim, shape, strides = make_dl_shape(size)
  
      dltensor = DLTensor()
      dltensor.data = data if size > 0 else 0
      dltensor.device = device
      dltensor.ndim = ndim
      dltensor.dtype = datatype
      dltensor.shape = shape
      dltensor.strides = strides
      dltensor.byte_offset = 0
      return dltensor
  
imports: import sys
  import ctypes
  from enum import IntEnum
label_desc: Use image node_id 3 for calling a global function with example usage: make_dl_tensor(obj) and returns: dltensor