class_docstr: A fake dataset that returns randomly generated
  :class:`~torch_geometric.data.HeteroData` objects.
  
  Args:
      num_graphs (int, optional): The number of graphs. (default: :obj:`1`)
      num_node_types (int, optional): The number of node types.
          (default: :obj:`3`)
      num_edge_types (int, optional): The number of edge types.
          (default: :obj:`6`)
      avg_num_nodes (int, optional): The average number of nodes in a graph.
          (default: :obj:`1000`)
      avg_degree (float, optional): The average degree per node.
          (default: :obj:`10.0`)
      avg_num_channels (int, optional): The average number of node features.
          (default: :obj:`64`)
      edge_dim (int, optional): The number of edge features.
          (default: :obj:`0`)
      num_classes (int, optional): The number of classes in the dataset.
          (default: :obj:`10`)
      task (str, optional): Whether to return node-level or graph-level
          labels (:obj:`"node"`, :obj:`"graph"`, :obj:`"auto"`).
          If set to :obj:`"auto"`, will return graph-level labels if
          :obj:`num_graphs > 1`, and node-level labels other-wise.
          (default: :obj:`"auto"`)
      transform (callable, optional): A function/transform that takes in
          an :obj:`torch_geometric.data.HeteroData` object and returns a
          transformed version. The data object will be transformed before
          every access. (default: :obj:`None`)
      **kwargs (optional): Additional attributes and their shapes
          *e.g.* :obj:`global_features=5`.
class_docstr_tok: ["A","fake","dataset","that","returns","randomly","generated",":","class",":","`","~torch_geometric.data.HeteroData","`","objects",".","Args",":","num_graphs","(","int",",","optional",")",":","The","number","of","graphs",".","(","default",":",":","obj",":","`","1","`",")","num_node_types","(","int",",","optional",")",":","The","number","of","node","types",".","(","default",":",":","obj",":","`","3","`",")","num_edge_types","(","int",",","optional",")",":","The","number","of","edge","types",".","(","default",":",":","obj",":","`","6","`",")","avg_num_nodes","(","int",",","optional",")",":","The","average","number","of","nodes","in","a","graph",".","(","default",":",":","obj",":","`","1000","`",")","avg_degree","(","float",",","optional",")",":","The","average","degree","per","node",".","(","default",":",":","obj",":","`","10.0","`",")","avg_num_channels","(","int",",","optional",")",":","The","average","number","of","node","features",".","(","default",":",":","obj",":","`","64","`",")","edge_dim","(","int",",","optional",")",":","The","number","of","edge","features",".","(","default",":",":","obj",":","`","0","`",")","num_classes","(","int",",","optional",")",":","The","number","of","classes","in","the","dataset",".","(","default",":",":","obj",":","`","10","`",")","task","(","str",",","optional",")",":","Whether","to","return","node-level","or","graph-level","labels","(",":","obj",":","`","``","node","''","`",",",":","obj",":","`","``","graph","''","`",",",":","obj",":","`","``","auto","''","`",")",".","If","set","to",":","obj",":","`","``","auto","''","`",",","will","return","graph-level","labels","if",":","obj",":","`","num_graphs",">","1","`",",","and","node-level","labels","other-wise",".","(","default",":",":","obj",":","`","``","auto","''","`",")","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an",":","obj",":","`","torch_geometric.data.HeteroData","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","every","access",".","(","default",":",":","obj",":","`","None","`",")","*","*","kwargs","(","optional",")",":","Additional","attributes","and","their","shapes","*","e.g",".","*",":","obj",":","`","global_features=5","`","."]
code: def __init__(
      self,
      num_graphs: int = 1,
      num_node_types: int = 3,
      num_edge_types: int = 6,
      avg_num_nodes: int = 1000,
      avg_degree: float = 10.0,
      avg_num_channels: int = 64,
      edge_dim: int = 0,
      num_classes: int = 10,
      task: str = "auto",
      transform: Optional[Callable] = None,
      pre_transform: Optional[Callable] = None,
      **kwargs: Union[int, Tuple[int, ...]],
  ) -> None:
      super().__init__(None, transform)
  
      if task == "auto":
          task = "graph" if num_graphs > 1 else "node"
      assert task in ["node", "graph"]
  
      self.node_types = [f"v{i}" for i in range(max(num_node_types, 1))]
  
      edge_types: List[Tuple[str, str]] = []
      edge_type_product = list(
          product(self.node_types, self.node_types)
      )
      while len(edge_types) < max(num_edge_types, 1):
          edge_types.extend(edge_type_product)
      random.shuffle(edge_types)
  
      self.edge_types: List[Tuple[str, str, str]] = []
      count: Dict[Tuple[str, str], int] = defaultdict(lambda: 0)
      for edge_type in edge_types[: max(num_edge_types, 1)]:
          rel = f"e{count[edge_type]}"
          count[edge_type] += 1
          self.edge_types.append((edge_type[0], rel, edge_type[1]))
  
      self.avg_num_nodes = max(avg_num_nodes, int(avg_degree))
      self.avg_degree = max(avg_degree, 1)
      self.num_channels = [
          get_num_channels(avg_num_channels) for _ in self.node_types
      ]
      self.edge_dim = edge_dim
      self._num_classes = num_classes
      self.task = task
      self.kwargs = kwargs
  
      data_list = [
          self.generate_data() for _ in range(max(num_graphs, 1))
      ]
      self.data, self.slices = self.collate(data_list)
  
file_path: pytorch_geometric/torch_geometric/datasets/fake.py
imports: import random
  from collections import defaultdict
  from itertools import product
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch_geometric.data import Data, HeteroData, InMemoryDataset
  from torch_geometric.utils import coalesce, remove_self_loops, to_undirected
label_desc: Use image node_id 1 to create a new FakeHeteroDataset object from inherited base classes: InMemoryDataset with example: obj = FakeHeteroDataset(num_graphs, num_node_types, num_edge_types, avg_num_nodes, avg_degree, avg_num_channels, edge_dim, num_classes, task, transform, pre_transform)