code: def DistMult(self, head, relation, tail, mode):
      if mode == "head-batch":
          score = head * (relation * tail)
      else:
          score = (head * relation) * tail
  
      score = score.sum(dim=2)
      return score
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.data import DataLoader
  from dataloader import TestDataset
  from collections import defaultdict
  from ogb.linkproppred import Evaluator
label_desc: Use image node_id 4 for calling the KGEModel obj's underlying member method code with example usage: obj.DistMult(head, relation, tail, mode) and returns: score