code: def train():
      model.train()
  
      total_loss = total_examples = 0
      for data in train_loader:
          data = data.to(device)
          optimizer.zero_grad()
  
          out = model(data.x, data.adj_t, data.batch)
          loss = F.binary_cross_entropy_with_logits(
              out, data.y.to(torch.float)
          )
          loss.backward()
          optimizer.step()
  
          total_loss += float(loss) * data.num_graphs
          total_examples += data.num_graphs
  
      return total_loss / total_examples
  
file_path: pytorch_geometric/examples/egc.py
imports: import argparse
  import os.path
  import torch
  import torch.nn.functional
  from ogb.graphproppred import Evaluator
  from ogb.graphproppred import PygGraphPropPredDataset
  from ogb.graphproppred.mol_encoder import AtomEncoder
  from torch.nn import BatchNorm1d, Linear, ReLU, Sequential
  from torch.optim.lr_scheduler import ReduceLROnPlateau
  import torch_geometric.transforms
  from torch_geometric.loader import DataLoader
  from torch_geometric.nn import EGConv, global_mean_pool
  from torch_geometric.typing import WITH_TORCH_SPARSE
label_desc: Use image node_id 1 for calling a global function with example usage: train() and returns: unknown