class_docstr: SASRec is the first sequential recommender based on self-attentive mechanism.
  
  NOTE:
      In the author's implementation, the Point-Wise Feed-Forward Network (PFFN) is implemented
      by CNN with 1x1 kernel. In this implementation, we follows the original BERT implementation
      using Fully Connected Layer to implement the PFFN.
class_docstr_tok: ["SASRec","is","the","first","sequential","recommender","based","on","self-attentive","mechanism",".","NOTE",":","In","the","author","'s","implementation",",","the","Point-Wise","Feed-Forward","Network","(","PFFN",")","is","implemented","by","CNN","with","1x1","kernel",".","In","this","implementation",",","we","follows","the","original","BERT","implementation","using","Fully","Connected","Layer","to","implement","the","PFFN","."]
code: def forward(self, item_seq, item_seq_len):
      position_ids = torch.arange(
          item_seq.size(1), dtype=torch.long, device=item_seq.device
      )
      position_ids = position_ids.unsqueeze(0).expand_as(item_seq)
      position_embedding = self.position_embedding(position_ids)
  
      item_emb = self.item_embedding(item_seq)
      input_emb = item_emb + position_embedding
      input_emb = self.LayerNorm(input_emb)
      input_emb = self.dropout(input_emb)
  
      extended_attention_mask = self.get_attention_mask(item_seq)
  
      trm_output = self.trm_encoder(
          input_emb,
          extended_attention_mask,
          output_all_encoded_layers=True,
      )
      output = trm_output[-1]
      output = self.gather_indexes(output, item_seq_len - 1)
      return output
  
file_path: RecBole/recbole/model/sequential_recommender/sasrec.py
imports: import torch
  from torch import nn
  from recbole.model.abstract_recommender import SequentialRecommender
  from recbole.model.layers import TransformerEncoder
  from recbole.model.loss import BPRLoss
label_desc: Use image node_id 3 for calling the SASRec obj's underlying member method code with example usage: obj.forward(item_seq, item_seq_len) and returns: output