code: def _batch_feat_dicts(frames, keys, feat_dict_name):
      """Internal function to batch feature dictionaries.
  
      Parameters
      ----------
      frames : list[Frame]
          List of frames
      keys : list[str]
          Feature keys. Can be '__ALL__', meaning batching all features.
      feat_dict_name : str
          Name of the feature dictionary for reporting errors.
  
      Returns
      -------
      dict[str, Tensor]
          New feature dict.
      """
      if len(frames) == 0:
          return {}
      schemas = [frame.schemes for frame in frames]
      # sanity checks
      if is_all(keys):
          utils.check_all_same_schema(schemas, feat_dict_name)
          keys = schemas[0].keys()
      else:
          utils.check_all_same_schema_for_keys(
              schemas, keys, feat_dict_name
          )
      # concat features
      ret_feat = {k: F.cat([fd[k] for fd in frames], 0) for k in keys}
      return ret_feat
  
file_path: dgl/python/dgl/batch.py
imports: from collections.abc import Mapping
  from .None import backend, convert, utils
  from .base import ALL, DGLError, EID, is_all, NID
  from .heterograph import DGLGraph
  from .heterograph_index import disjoint_union, slice_gidx
label_desc: Use image node_id 2 for calling a global function with example usage: _batch_feat_dicts(frames, keys, feat_dict_name) and returns: ret_feat, dict