code: def train(model, device, loader, optimizer, task_type):
      model.train()
  
      for step, batch in enumerate(tqdm(loader, desc="Iteration")):
          batch = batch.to(device)
  
          if batch.x.shape[0] == 1 or batch.batch[-1] == 0:
              pass
          else:
              pred = model(batch)
              optimizer.zero_grad()
              is_labeled = batch.y == batch.y
              loss = cls_criterion(
                  pred.to(torch.float32)[is_labeled],
                  batch.y.to(torch.float32)[is_labeled],
              )
              loss.backward()
              optimizer.step()
  
file_path: AutoGL/examples/glfogb.py
imports: from torch_geometric.data import DataLoader
  import torch.optim
  from tqdm import tqdm
  from ogb.graphproppred import Evaluator
  import random
  import torch
  import numpy
  from autogl.datasets import build_dataset_from_name
  from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
  from ogb_gnn import GNN
  from autogl.backend import DependentBackend
  from torch_geometric.data import Data
label_desc: Use image node_id 1 for calling a global function with example usage: train(model, device, loader, optimizer, task_type) without return types