class_docstr: TransRec is translation-based model for sequential recommendation.
  It assumes that the `prev. item` + `user`  = `next item`.
  We use the Euclidean Distance to calculate the similarity in this implementation.
class_docstr_tok: ["TransRec","is","translation-based","model","for","sequential","recommendation",".","It","assumes","that","the","`","prev",".","item","`","+","`","user","`","=","`","next","item","`",".","We","use","the","Euclidean","Distance","to","calculate","the","similarity","in","this","implementation","."]
docstr: Gathers the last_item at the specific positions over a minibatch
docstr_tok: ["Gathers","the","last_item","at","the","specific","positions","over","a","minibatch"]
code: def gather_last_items(self, item_seq, gather_index):
      """Gathers the last_item at the specific positions over a minibatch"""
      gather_index = gather_index.view(-1, 1)
      last_items = item_seq.gather(index=gather_index, dim=1)  # [B 1]
      return last_items.squeeze(-1)
  
file_path: RecBole/recbole/model/sequential_recommender/transrec.py
imports: import torch
  from torch import nn
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.model.init import xavier_normal_initialization
  from recbole.model.loss import BPRLoss, EmbLoss, RegLoss
  from recbole.utils import InputType
label_desc: Use image node_id 3 for calling the TransRec obj's underlying member method code with example usage: obj.gather_last_items(item_seq, gather_index) and returns: last_items