code: def train(model, optimizer, train_loader):
      model.train()
      optimizer.zero_grad()
      for batch in train_loader:
          batch.to(device)
          emb = model(batch)
          loss = model.loss(
              emb, batch.node_label, batch.node_label_index
          )
          loss.backward()
      optimizer.step()
      return loss.item()
  
file_path: deepsnap/examples/node_classification_hetero/node_classification_syn_tensor.py
imports: import copy
  import torch
  import torch.nn
  import torch.nn.functional
  from utils import generate_convs, concatenate_citeseer_cora
  from deepsnap.hetero_gnn import HeteroConv, HeteroSAGEConv, forward_op, loss_op
  from torch_geometric.datasets import Planetoid
  from deepsnap.dataset import GraphDataset
  from deepsnap.batch import Batch
  from deepsnap.hetero_graph import HeteroGraph
  from torch.utils.data import DataLoader
label_desc: Use image node_id 1 for calling a global function with example usage: train(model, optimizer, train_loader) and returns: loss