class_docstr: S3Rec is the first work to incorporate self-supervised learning in
  sequential recommendation.
  
  NOTE:
      Under this framework, we need reconstruct the pretraining data,
      which would affect the pre-training speed.
code: def forward(self, item_seq, bidirectional=True):
      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)
      attention_mask = self.get_attention_mask(
          item_seq, bidirectional=bidirectional
      )
      trm_output = self.trm_encoder(
          input_emb, attention_mask, output_all_encoded_layers=True
      )
      seq_output = trm_output[-1]  # [B L H]
      return seq_output
  
imports: import random
  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 7 for calling the S3Rec obj's underlying member method code with example usage: obj.forward(item_seq, bidirectional) and returns: seq_output