code: def score(model, layers, device, history_items):
      model.eval()
      H = []
      for i in range(len(layers)):
          H.append(
              torch.zeros(
                  (1, layers[i]),
                  dtype=torch.float32,
                  requires_grad=False,
                  device=device,
              )
          )
      for iid in history_items:
          O = model.forward(
              torch.tensor([iid], requires_grad=False, device=device),
              H,
              None,
              training=False,
          )
      return O.squeeze().cpu().detach().numpy()
  
imports: from collections import Counter
  import numpy
  import torch
  from torch import nn
  from torch.autograd import Variable
  from torch.optim import Optimizer
  from cornac.utils.common import get_rng
label_desc: Use image node_id 3 for calling a global function with example usage: score(model, layers, device, history_items) and returns: O