class_docstr: SAS Rec model
  Self-Attentive Sequential Recommendation Using Transformer
  
  :Citation:
  
      Wang-Cheng Kang, Julian McAuley (2018), Self-Attentive Sequential
      Recommendation. Proceedings of IEEE International Conference on
      Data Mining (ICDM'18)
  
      Original source code from nnkkmto/SASRec-tf2,
      https://github.com/nnkkmto/SASRec-tf2
docstr: Compute the sequence and positional embeddings.
  
  Args:
      input_seq (tf.Tensor): Input sequence
  
  Returns:
      tf.Tensor, tf.Tensor:
      - Sequence embeddings.
      - Positional embeddings.
docstr_tok: ["Compute","the","sequence","and","positional","embeddings",".","Args",":","input_seq","(","tf.Tensor",")",":","Input","sequence","Returns",":","tf.Tensor",",","tf.Tensor",":","-","Sequence","embeddings",".","-","Positional","embeddings","."]
code: def embedding(self, input_seq):
      """Compute the sequence and positional embeddings.
  
      Args:
          input_seq (tf.Tensor): Input sequence
  
      Returns:
          tf.Tensor, tf.Tensor:
          - Sequence embeddings.
          - Positional embeddings.
      """
  
      seq_embeddings = self.item_embedding_layer(input_seq)
      seq_embeddings = seq_embeddings * (self.embedding_dim**0.5)
  
      # FIXME
      positional_seq = tf.expand_dims(
          tf.range(tf.shape(input_seq)[1]), 0
      )
      positional_seq = tf.tile(
          positional_seq, [tf.shape(input_seq)[0], 1]
      )
      positional_embeddings = self.positional_embedding_layer(
          positional_seq
      )
  
      return seq_embeddings, positional_embeddings
  
imports: import random
  import numpy
  from tqdm import tqdm
  import tensorflow
  from recommenders.utils.timer import Timer
label_desc: Use image node_id 2 for calling the SASREC obj's underlying member method code with example usage: obj.embedding(input_seq) and returns: seq_embeddings,  positional_embeddings