class_docstr: A synthetic graph dataset generated by the stochastic block model.
  The node features of each block are sampled from normal distributions where
  the centers of clusters are vertices of a hypercube, as computed by the
  :meth:`sklearn.datasets.make_classification` method.
  
  Args:
      root (str): Root directory where the dataset should be saved.
      block_sizes ([int] or LongTensor): The sizes of blocks.
      edge_probs ([[float]] or FloatTensor): The density of edges going from
          each block to each other block. Must be symmetric if the graph is
          undirected.
      num_graphs (int, optional): The number of graphs. (default: :obj:`1`)
      num_channels (int, optional): The number of node features. If given
          as :obj:`None`, node features are not generated.
          (default: :obj:`None`)
      is_undirected (bool, optional): Whether the graph to generate is
          undirected. (default: :obj:`True`)
      transform (callable, optional): A function/transform that takes in
          an :obj:`torch_geometric.data.Data` object and returns a
          transformed version. The data object will be transformed before
          every access. (default: :obj:`None`)
      pre_transform (callable, optional): A function/transform that takes
          in an :obj:`torch_geometric.data.Data` object and returns a
          transformed version. The data object will be transformed
          before being saved to disk. (default: :obj:`None`)
      force_reload (bool, optional): Whether to re-process the dataset.
          (default: :obj:`False`)
      **kwargs (optional): The keyword arguments that are passed down to the
          :meth:`sklearn.datasets.make_classification` method for drawing
          node features.
class_docstr_tok: ["A","synthetic","graph","dataset","generated","by","the","stochastic","block","model",".","The","node","features","of","each","block","are","sampled","from","normal","distributions","where","the","centers","of","clusters","are","vertices","of","a","hypercube",",","as","computed","by","the",":","meth",":","`","sklearn.datasets.make_classification","`","method",".","Args",":","root","(","str",")",":","Root","directory","where","the","dataset","should","be","saved",".","block_sizes","(","[","int","]","or","LongTensor",")",":","The","sizes","of","blocks",".","edge_probs","(","[","[","float","]","]","or","FloatTensor",")",":","The","density","of","edges","going","from","each","block","to","each","other","block",".","Must","be","symmetric","if","the","graph","is","undirected",".","num_graphs","(","int",",","optional",")",":","The","number","of","graphs",".","(","default",":",":","obj",":","`","1","`",")","num_channels","(","int",",","optional",")",":","The","number","of","node","features",".","If","given","as",":","obj",":","`","None","`",",","node","features","are","not","generated",".","(","default",":",":","obj",":","`","None","`",")","is_undirected","(","bool",",","optional",")",":","Whether","the","graph","to","generate","is","undirected",".","(","default",":",":","obj",":","`","True","`",")","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an",":","obj",":","`","torch_geometric.data.Data","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","every","access",".","(","default",":",":","obj",":","`","None","`",")","pre_transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","an",":","obj",":","`","torch_geometric.data.Data","`","object","and","returns","a","transformed","version",".","The","data","object","will","be","transformed","before","being","saved","to","disk",".","(","default",":",":","obj",":","`","None","`",")","force_reload","(","bool",",","optional",")",":","Whether","to","re-process","the","dataset",".","(","default",":",":","obj",":","`","False","`",")","*","*","kwargs","(","optional",")",":","The","keyword","arguments","that","are","passed","down","to","the",":","meth",":","`","sklearn.datasets.make_classification","`","method","for","drawing","node","features","."]
code: def __init__(
      self,
      root: str,
      block_sizes: Union[List[int], Tensor],
      edge_probs: Union[List[List[float]], Tensor],
      num_graphs: int = 1,
      num_channels: Optional[int] = None,
      is_undirected: bool = True,
      transform: Optional[Callable] = None,
      pre_transform: Optional[Callable] = None,
      force_reload: bool = False,
      **kwargs: Any,
  ) -> None:
      if not isinstance(block_sizes, torch.Tensor):
          block_sizes = torch.tensor(block_sizes, dtype=torch.long)
      if not isinstance(edge_probs, torch.Tensor):
          edge_probs = torch.tensor(edge_probs, dtype=torch.float)
  
      assert num_graphs > 0
  
      self.block_sizes = block_sizes
      self.edge_probs = edge_probs
      self.num_graphs = num_graphs
      self.num_channels = num_channels
      self.is_undirected = is_undirected
  
      self.kwargs = {
          "n_informative": num_channels,
          "n_redundant": 0,
          "flip_y": 0.0,
          "shuffle": False,
      }
      self.kwargs.update(kwargs)
  
      super().__init__(
          root, transform, pre_transform, force_reload=force_reload
      )
      self.load(self.processed_paths[0])
  
file_path: pytorch_geometric/torch_geometric/datasets/sbm_dataset.py
imports: import os.path
  from typing import Any, Callable, List, Optional, Union
  import numpy
  import torch
  from torch import Tensor
  from torch_geometric.data import Data, InMemoryDataset
  from torch_geometric.utils import stochastic_blockmodel_graph
label_desc: Use image node_id 1 to create a new StochasticBlockModelDataset object from inherited base classes: InMemoryDataset with example: obj = StochasticBlockModelDataset(root, block_sizes, edge_probs, num_graphs, num_channels, is_undirected, transform, pre_transform, force_reload)