code: def train(epoch):
      model.train()
  
      pbar = tqdm(total=len(train_loader))
      pbar.set_description(f"Training epoch: {epoch:04d}")
  
      total_loss = total_examples = 0
      for data in train_loader:
          optimizer.zero_grad()
          data = data.to(device)
          out = model(data.x, data.edge_index, data.edge_attr)
          loss = criterion(
              out[data.train_mask], data.y[data.train_mask]
          )
          loss.backward()
          optimizer.step()
  
          total_loss += float(loss) * int(data.train_mask.sum())
          total_examples += int(data.train_mask.sum())
  
          pbar.update(1)
  
      pbar.close()
  
      return total_loss / total_examples
  
file_path: pytorch_geometric/examples/ogbn_proteins_deepgcn.py
imports: import torch
  import torch.nn.functional
  from ogb.nodeproppred import Evaluator, PygNodePropPredDataset
  from torch.nn import LayerNorm, Linear, ReLU
  from tqdm import tqdm
  from torch_geometric.loader import RandomNodeLoader
  from torch_geometric.nn import DeepGCNLayer, GENConv
  from torch_geometric.utils import scatter
label_desc: Use image node_id 1 for calling a global function with example usage: train(epoch) and returns: unknown