class_docstr: A plain old python object modeling a batch of
  :class:`deepsnap.graph.Graph` objects as one big (disconnected) graph,
  with :class:`torch_geometric.data.Data` being the
  base class that all its methods can also be used here.
  In addition, graphs can be reconstructed via the assignment vector
  :obj:`batch`, which maps each node to its respective graph identifier.
  
  .. note::
  
      For more detailed use of :class:`deepsnap.batch.Batch`, see the `examples 
      <https://github.com/snap-stanford/deepsnap/tree/master/examples>`_ folder.
class_docstr_tok: ["A","plain","old","python","object","modeling","a","batch","of",":","class",":","`","deepsnap.graph.Graph","`","objects","as","one","big","(","disconnected",")","graph",",","with",":","class",":","`","torch_geometric.data.Data","`","being","the","base","class","that","all","its","methods","can","also","be","used","here",".","In","addition",",","graphs","can","be","reconstructed","via","the","assignment","vector",":","obj",":","`","batch","`",",","which","maps","each","node","to","its","respective","graph","identifier",".","..","note",":",":","For","more","detailed","use","of",":","class",":","`","deepsnap.batch.Batch","`",",","see","the","`","examples","<","https",":","\/\/github.com\/snap-stanford\/deepsnap\/tree\/master\/examples",">","`","_","folder","."]
docstr: Convert a dict/Graph with list as values to a dict/Graph with
  concatenated/stacked tensor as values.
docstr_tok: ["Convert","a","dict\/Graph","with","list","as","values","to","a","dict\/Graph","with","concatenated\/stacked","tensor","as","values","."]
code: def _dict_list_to_tensor(dict_of_list, graph):
      r"""Convert a dict/Graph with list as values to a dict/Graph with
      concatenated/stacked tensor as values.
      """
      if isinstance(dict_of_list, dict):
          keys = dict_of_list.keys()
      else:
          keys = dict_of_list.keys
      for key in keys:
          if isinstance(dict_of_list[key], dict):
              # recursively convert the dictionary of list to dict of tensor
              Batch._dict_list_to_tensor(dict_of_list[key], graph)
              continue
          item = dict_of_list[key][0]
          if torch.is_tensor(item):
              if (
                  Graph._is_graph_attribute(key)
                  and item.ndim == 1
                  and (not item.dtype == torch.long)
                  and "feature" in key
              ):
                  # special consideration: 1D tensor for graph
                  # attribute (classification)
                  # named as: "graph_xx_feature"
                  # batch by stacking the first dim
                  dict_of_list[key] = torch.stack(
                      dict_of_list[key], dim=0
                  )
              else:
                  # concat at the __cat_dim__
                  dict_of_list[key] = torch.cat(
                      dict_of_list[key],
                      dim=graph.__cat_dim__(key, item),
                  )
          elif isinstance(item, (float, int)):
              dict_of_list[key] = torch.tensor(dict_of_list[key])
  
file_path: deepsnap/deepsnap/batch.py
imports: import torch
  from deepsnap.graph import Graph
  from deepsnap.hetero_graph import HeteroGraph
  from typing import Callable, Dict, List
label_desc: Use image node_id 6 for calling the Batch obj's underlying member method code with example usage: obj._dict_list_to_tensor(dict_of_list, graph) without return types