code: def train():
      model.train()
  
      total_loss = correct_nodes = total_nodes = 0
      for i, data in tqdm(enumerate(train_loader)):
          data = data.to(device)
          optimizer.zero_grad()
          out = model(data.x, data.pos, data.batch, data.ptr)
          loss = F.nll_loss(out, data.y)
          loss.backward()
          optimizer.step()
          total_loss += loss.item()
          correct_nodes += out.argmax(dim=1).eq(data.y).sum().item()
          total_nodes += data.num_nodes
  
          if (i + 1) % 10 == 0:
              print(
                  f"[{i+1}/{len(train_loader)}] Loss: {total_loss / 10:.4f} "
                  f"Train Acc: {correct_nodes / total_nodes:.4f}"
              )
              total_loss = correct_nodes = total_nodes = 0
  
imports: import os.path
  import torch
  import torch.nn.functional
  from randlanet_classification import DilatedResidualBlock, SharedMLP, decimate
  from torch.nn import Linear
  from torchmetrics.functional import jaccard_index
  from tqdm import tqdm
  import torch_geometric.transforms
  from torch_geometric.datasets import ShapeNet
  from torch_geometric.loader import DataLoader
  from torch_geometric.nn import knn_interpolate
  from torch_geometric.typing import WITH_TORCH_CLUSTER
  from torch_geometric.utils import scatter
label_desc: Use image node_id 1 for calling a global function with example usage: train() without return types