code: def train(epoch, log_steps=100, eval_steps=2000):
      model.train()
  
      total_loss = 0
      for i, (pos_rw, neg_rw) in enumerate(loader):
          optimizer.zero_grad()
          loss = model.loss(pos_rw.to(device), neg_rw.to(device))
          loss.backward()
          optimizer.step()
  
          total_loss += loss.item()
          if (i + 1) % log_steps == 0:
              print(
                  (
                      f"Epoch: {epoch}, Step: {i + 1:05d}/{len(loader)}, "
                      f"Loss: {total_loss / log_steps:.4f}"
                  )
              )
              total_loss = 0
  
          if (i + 1) % eval_steps == 0:
              acc = test()
              print(
                  (
                      f"Epoch: {epoch}, Step: {i + 1:05d}/{len(loader)}, "
                      f"Acc: {acc:.4f}"
                  )
              )
  
imports: import os.path
  import torch
  from torch_geometric.datasets import AMiner
  from torch_geometric.nn import MetaPath2Vec
label_desc: Use image node_id 1 for calling a global function with example usage: train(epoch, log_steps, eval_steps) without return types