class_docstr: Appearance-Free Link Model.
class_docstr_tok: ["Appearance-Free","Link","Model","."]
code: def forward(self, x1: Tensor, x2: Tensor) -> Tensor:
      assert not self.training, "Only testing is supported for AFLink."
      x1 = x1[:, :, :, :3]
      x2 = x2[:, :, :, :3]
      x1 = self.TemporalModule_1(x1)  # [B,1,30,3] -> [B,256,6,3]
      x2 = self.TemporalModule_2(x2)
      x1 = self.FusionBlock_1(x1)
      x2 = self.FusionBlock_2(x2)
      x1 = self.pooling(x1).squeeze(-1).squeeze(-1)
      x2 = self.pooling(x2).squeeze(-1).squeeze(-1)
      y = self.classifier(x1, x2)
      y = torch.softmax(y, dim=1)[0, 1]
      return y
  
imports: from collections import defaultdict
  from typing import Tuple
  import numpy
  import torch
  from mmengine.model import BaseModule
  from mmengine.runner.checkpoint import load_checkpoint
  from scipy.optimize import linear_sum_assignment
  from torch import Tensor, nn
  from mmdet.registry import TASK_UTILS
label_desc: Use image node_id 2 for calling the AFLinkModel obj's underlying member method code with example usage: obj.forward(x1, x2) and returns: y