class_docstr: Base class for implementing rooted subgraph transformations.
class_docstr_tok: ["Base","class","for","implementing","rooted","subgraph","transformations","."]
code: def forward(self, data: Data) -> RootedSubgraphData:
      out = self.extract(data)
      d = RootedSubgraphData.from_dict(data.to_dict())
      (
          d.sub_edge_index,
          d.n_id,
          d.e_id,
          d.n_sub_batch,
          d.e_sub_batch,
      ) = out
      return d
  
imports: import copy
  from abc import ABC, abstractmethod
  from typing import Any, Tuple
  import torch
  from torch import Tensor
  from torch_geometric.data import Data
  from torch_geometric.transforms import BaseTransform
  from torch_geometric.utils import to_torch_csc_tensor
label_desc: Use image node_id 3 for calling the RootedSubgraph obj's underlying member method code with example usage: obj.forward(data) and returns: d