I am also looking for this answer. Most of the online sources only talk about the in-built dataset but to apply GNN we need to synthesize our own data. if you have found the answer do share. Thanks.
I think the following method from the PyG doc will work but it is not an efficient way to do::
from torch_geometric.data import Data
from torch_geometric.loader import DataLoader

data_list = [Data(...), ..., Data(...)]
loader = DataLoader(data_list, batch_size=32)


Here, each Data object should be created in a loop.