class_docstr: A simple Device/CPU Array object in runtime.
docstr: Produce an array from a DLPack Tensor without copying memory
  
  Args
  -------
  alignment: int, default to be 0
  Indicates the alignment requirement when converting to dlpack. Will copy to a
  new tensor if the alignment requirement is not satisfied.
  0 means no alignment requirement.
  
  
  Returns
  -------
  dlpack : DLPack tensor view of the array data
docstr_tok: ["Produce","an","array","from","a","DLPack","Tensor","without","copying","memory","Args","--","--","--","-","alignment",":","int",",","default","to","be","0","Indicates","the","alignment","requirement","when","converting","to","dlpack",".","Will","copy","to","a","new","tensor","if","the","alignment","requirement","is","not","satisfied",".","0","means","no","alignment","requirement",".","Returns","--","--","--","-","dlpack",":","DLPack","tensor","view","of","the","array","data"]
code: def to_dlpack(self, alignment=0):
      """Produce an array from a DLPack Tensor without copying memory
  
      Args
      -------
      alignment: int, default to be 0
      Indicates the alignment requirement when converting to dlpack. Will copy to a
      new tensor if the alignment requirement is not satisfied.
      0 means no alignment requirement.
  
  
      Returns
      -------
      dlpack : DLPack tensor view of the array data
      """
      ptr = ctypes.c_void_p()
      check_call(
          _LIB.DGLArrayToDLPack(
              self.handle, ctypes.byref(ptr), alignment
          )
      )
      return ctypes.pythonapi.PyCapsule_New(
          ptr, _c_str_dltensor, _c_dlpack_deleter
      )
  
file_path: dgl/python/dgl/_ffi/_ctypes/ndarray.py
imports: from __future__ import absolute_import
  import ctypes
  from ..base import _LIB, c_str, check_call
  from ..runtime_ctypes import DGLArrayHandle
  from .types import _return_handle, _wrap_arg_func, C_TO_PY_ARG_SWITCH, RETURN_SWITCH
label_desc: Use image node_id 4 for calling the NDArrayBase obj's underlying member method code with example usage: obj.to_dlpack(alignment) and returns: ctypes