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 generate_data(self) -> HeteroData:
      data = HeteroData()
  
      iterator = zip(self.node_types, self.num_channels)
      for i, (node_type, num_channels) in enumerate(iterator):
          num_nodes = get_num_nodes(self.avg_num_nodes, self.avg_degree)
  
          store = data[node_type]
  
          if num_channels > 0:
              store.x = torch.randn(num_nodes, num_channels)
          else:
              store.num_nodes = num_nodes
  
          if self._num_classes > 0 and self.task == "node" and i == 0:
              store.y = torch.randint(self._num_classes, (num_nodes,))
  
      for src, rel, dst in self.edge_types:
          store = data[(src, rel, dst)]
  
          store.edge_index = get_edge_index(
              data[src].num_nodes,
              data[dst].num_nodes,
              self.avg_degree,
              is_undirected=False,
              remove_loops=False,
          )
  
          if self.edge_dim > 1:
              store.edge_attr = torch.rand(
                  store.num_edges, self.edge_dim
              )
          elif self.edge_dim == 1:
              store.edge_weight = torch.rand(store.num_edges)
  
          pass
  
      if self._num_classes > 0 and self.task == "graph":
          data.y = torch.tensor(
              [random.randint(0, self._num_classes - 1)]
          )
  
      for feature_name, feature_shape in self.kwargs.items():
          setattr(data, feature_name, torch.randn(feature_shape))
  
      return data
  
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 2 for calling the FakeHeteroDataset obj's underlying member method code with example usage: obj.generate_data() and returns: data