RuntimeError: index x is out of bounds for dimension 0 with size x in GCNCONV()

Hi everyone. I am trying to work with GCNCONV() from pytorch-geometric with some artificial data produced by the following code for node classification. Nodes can be of two class labels (0,1) and the length of the node feature is 100.While training the model, I am getting an error at the end of the code.
Could you please help me to solve the problem?

import torch
from torch_geometric.data import Data
from torch_geometric.loader import DataLoader
import random
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
from tqdm import tqdm
def createGraph():
    N_Nodes = random.randint(10,20)
    N_edges = random.randint(10,N_Nodes*(N_Nodes-1)/2)
    x = torch.tensor([[random.random() for i in range(100)] for j in range(N_Nodes)],dtype=torch.float)
    e = [(random.randint(0,N_Nodes),random.randint(0,N_Nodes)) for i in range(N_edges)]
    r = []
    c = []
    for i in e:
        r.append(i[0])
        c.append(i[1])
    edge_index = torch.tensor([r, c], dtype = torch.long)
    y = torch.tensor([[random.randint(0,1)] for i in range(N_Nodes)],dtype=torch.long)
    
    return x, edge_index, y
def createDataSet(n =1000):
    L =[]
    for i in range(n):
        
        x, edge_index, y = createGraph()
        
        L.append(Data(x=x,edge_index=edge_index,y=y))
    return L
DS = createDataSet(n = 1000)
trainLoader = DataLoader(DS,batch_size=32,shuffle=False,)
class GCN(torch.nn.Module):
    def __init__(self,num_node_features,num_classes):
        super().__init__()
        self.conv1 = GCNConv(num_node_features, 16)
        self.conv2 = GCNConv(16, num_classes)

    def forward(self, data):
        x, edge_index = data.x, data.edge_index

        x = self.conv1(x, edge_index)
        x = F.relu(x)
        x = F.dropout(x, training=self.training)
        x = self.c
        onv2(x, edge_index)

        return F.log_softmax(x, dim=1)
model = GCN(100,2)
optimizer = torch.optim.Adam(model.parameters(), lr=0.01, weight_decay=5e-4)
model.train()
for epoch in tqdm(range(50)):
    for data in trainLoader:
        optimizer.zero_grad()
        out = model(data)
        loss = F.nll_loss(out, data.y)
        loss.backward()
        optimizer.step()
1, in scatter_sum(src, index, dim, out, dim_size)
     19         size[dim] = int(index.max()) + 1
     20     out = torch.zeros(size, dtype=src.dtype, device=src.device)
---> 21     return out.scatter_add_(dim, index, src)
     22 else:
     23     return out.scatter_add_(dim, index, src)

RuntimeError: index 15 is out of bounds for dimension 0 with size 15