class_docstr: NAIS is an attention network, which is capable of distinguishing which historical items
  in a user profile are more important for a prediction. We just implement the model following
  the original author with a pointwise training mode.
  
  Note:
      instead of forming a minibatch as all training instances of a randomly sampled user which is
      mentioned in the original paper, we still train the model by a randomly sampled interactions.
docstr: forward the model by interaction
docstr_tok: ["forward","the","model","by","interaction"]
code: def inter_forward(self, user, item):
      """forward the model by interaction"""
      user_inter = self.history_item_matrix[user]
      item_num = self.history_lens[user].unsqueeze(1)
      batch_mask_mat = self.mask_mat[user]
      user_history = self.item_src_embedding(
          user_inter
      )  # batch_size x max_len x embedding_size
      target = self.item_dst_embedding(
          item
      )  # batch_size x embedding_size
      bias = self.bias[item]  # batch_size x 1
      similarity = torch.bmm(user_history, target.unsqueeze(2)).squeeze(
          2
      )  # batch_size x max_len
      logits = self.attention_mlp(user_history, target)
      scores = self.mask_softmax(
          similarity, logits, bias, item_num, batch_mask_mat
      )
      return scores
  
imports: import torch
  import torch.nn
  from torch.nn.init import constant_, normal_, xavier_normal_
  from recbole.model.abstract_recommender import GeneralRecommender
  from recbole.model.layers import MLPLayers
  from recbole.utils import InputType
label_desc: Use image node_id 9 for calling the NAIS obj's underlying member method code with example usage: obj.inter_forward(user, item) and returns: scores