class_docstr: Partition the graph structure and its features of a
  :class:`~torch_geometric.data.Data` or
  :class:`~torch_geometric.data.HeteroData` object.
  
  Partitioned data output will be structured like this:
  
  **Homogeneous graphs:**
  
  .. code-block::
  
      root/
      |-- META.json
      |-- node_map.pt
      |-- edge_map.pt
      |-- part0/
          |-- graph.pt
          |-- node_feats.pt
          |-- edge_feats.pt
      |-- part1/
          |-- graph.pt
          |-- node_feats.pt
          |-- edge_feats.pt
  
  **Heterogeneous graphs:**
  
  .. code-block::
  
      root/
      |-- META.json
      |-- node_map/
          |-- ntype1.pt
          |-- ntype2.pt
      |-- edge_map/
          |-- etype1.pt
          |-- etype2.pt
      |-- part0/
          |-- graph.pt
          |-- node_feats.pt
          |-- edge_feats.pt
      |-- part1/
          |-- graph.pt
          |-- node_feats.pt
          |-- edge_feats.pt
  
  Args:
      data (Data or HeteroData): The data object.
      num_parts (int): The number of partitions.
      recursive (bool, optional): If set to :obj:`True`, will use multilevel
          recursive bisection instead of multilevel k-way partitioning.
          (default: :obj:`False`)
      root (str): Root directory where the partitioned dataset should be
          saved.
class_docstr_tok: ["Partition","the","graph","structure","and","its","features","of","a",":","class",":","`","~torch_geometric.data.Data","`","or",":","class",":","`","~torch_geometric.data.HeteroData","`","object",".","Partitioned","data","output","will","be","structured","like","this",":","*","*","Homogeneous","graphs",":","*","*","..","code-block",":",":","root\/","|","--","META.json","|","--","node_map.pt","|","--","edge_map.pt","|","--","part0\/","|","--","graph.pt","|","--","node_feats.pt","|","--","edge_feats.pt","|","--","part1\/","|","--","graph.pt","|","--","node_feats.pt","|","--","edge_feats.pt","*","*","Heterogeneous","graphs",":","*","*","..","code-block",":",":","root\/","|","--","META.json","|","--","node_map\/","|","--","ntype1.pt","|","--","ntype2.pt","|","--","edge_map\/","|","--","etype1.pt","|","--","etype2.pt","|","--","part0\/","|","--","graph.pt","|","--","node_feats.pt","|","--","edge_feats.pt","|","--","part1\/","|","--","graph.pt","|","--","node_feats.pt","|","--","edge_feats.pt","Args",":","data","(","Data","or","HeteroData",")",":","The","data","object",".","num_parts","(","int",")",":","The","number","of","partitions",".","recursive","(","bool",",","optional",")",":","If","set","to",":","obj",":","`","True","`",",","will","use","multilevel","recursive","bisection","instead","of","multilevel","k-way","partitioning",".","(","default",":",":","obj",":","`","False","`",")","root","(","str",")",":","Root","directory","where","the","partitioned","dataset","should","be","saved","."]
code: def edge_types(self) -> Optional[List[EdgeType]]:
      return self.data.edge_types if self.is_hetero else None
  
file_path: pytorch_geometric/torch_geometric/distributed/partition.py
imports: import json
  import logging
  import os
  import os.path
  from typing import List, Optional, Union
  import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.distributed.utils import as_str
  from torch_geometric.loader.cluster import ClusterData
  from torch_geometric.typing import Dict, EdgeType, EdgeTypeStr, NodeType, Tuple
  from torch_geometric.utils import index_sort
label_desc: Use image node_id 4 for calling the Partitioner obj's underlying member method code with example usage: obj.edge_types() and returns: unknown