class_docstr: GraphData Object
docstr: Create GraphData
docstr_tok: ["Create","GraphData"]
code: def create(g):
      """Create GraphData"""
      # TODO(zihao): support serialize batched graph in the future.
      assert (
          g.batch_size == 1
      ), "Batched DGLGraph is not supported for serialization"
      ghandle = g._graph
      if len(g.ndata) != 0:
          node_tensors = dict()
          for key, value in g.ndata.items():
              node_tensors[key] = F.zerocopy_to_dgl_ndarray(value)
      else:
          node_tensors = None
      if len(g.edata) != 0:
          edge_tensors = dict()
          for key, value in g.edata.items():
              edge_tensors[key] = F.zerocopy_to_dgl_ndarray(value)
      else:
          edge_tensors = None
      return _CAPI_MakeGraphData(ghandle, node_tensors, edge_tensors)
  
imports: from __future__ import absolute_import
  import os
  from ..None import backend
  from .._ffi.function import _init_api
  from .._ffi.object import ObjectBase, register_object
  from ..base import dgl_warning, DGLError
  from ..heterograph import DGLGraph
  from .heterograph_serialize import save_heterographs
label_desc: Use image node_id 1 for calling the GraphData obj's underlying member method code with example usage: obj.create(g) and returns: _CAPI_MakeGraphData