class_docstr: Module representing users through running a recurrent neural network
  over the sequence, using the hidden state at each timestep as the
  sequence representation, a'la [2]_
  
  During training, representations for all timesteps of the sequence are
  computed in one go. Loss functions using the outputs will therefore
  be aggregating both across the minibatch and across time in the sequence.
  
  Parameters
  ----------
  
  num_items: int
      Number of items to be represented.
  embedding_dim: int, optional
      Embedding dimension of the embedding layer, and the number of hidden
      units in the LSTM layer.
  item_embedding_layer: an embedding layer, optional
      If supplied, will be used as the item embedding layer
      of the network.
  
  References
  ----------
  
  .. [2] Hidasi, Balazs, et al. "Session-based recommendations with
     recurrent neural networks." arXiv preprint arXiv:1511.06939 (2015).
class_docstr_tok: ["Module","representing","users","through","running","a","recurrent","neural","network","over","the","sequence",",","using","the","hidden","state","at","each","timestep","as","the","sequence","representation",",","a'la","[","2","]","_","During","training",",","representations","for","all","timesteps","of","the","sequence","are","computed","in","one","go",".","Loss","functions","using","the","outputs","will","therefore","be","aggregating","both","across","the","minibatch","and","across","time","in","the","sequence",".","Parameters","--","--","--","--","--","num_items",":","int","Number","of","items","to","be","represented",".","embedding_dim",":","int",",","optional","Embedding","dimension","of","the","embedding","layer",",","and","the","number","of","hidden","units","in","the","LSTM","layer",".","item_embedding_layer",":","an","embedding","layer",",","optional","If","supplied",",","will","be","used","as","the","item","embedding","layer","of","the","network",".","References","--","--","--","--","--","..","[","2","]","Hidasi",",","Balazs",",","et","al",".","``","Session-based","recommendations","with","recurrent","neural","networks",".","''","arXiv","preprint","arXiv:1511.06939","(","2015",")","."]
docstr: Compute predictions for target items given user representations.
  
  Parameters
  ----------
  
  user_representations: tensor
      Result of the user_representation_method.
  targets: tensor
      A minibatch of item sequences of shape
      (minibatch_size, sequence_length).
  
  Returns
  -------
  
  predictions: tensor
      of shape (minibatch_size, sequence_length)
docstr_tok: ["Compute","predictions","for","target","items","given","user","representations",".","Parameters","--","--","--","--","--","user_representations",":","tensor","Result","of","the","user_representation_method",".","targets",":","tensor","A","minibatch","of","item","sequences","of","shape","(","minibatch_size",",","sequence_length",")",".","Returns","--","--","--","-","predictions",":","tensor","of","shape","(","minibatch_size",",","sequence_length",")"]
code: def forward(self, user_representations, targets):
      """
      Compute predictions for target items given user representations.
  
      Parameters
      ----------
  
      user_representations: tensor
          Result of the user_representation_method.
      targets: tensor
          A minibatch of item sequences of shape
          (minibatch_size, sequence_length).
  
      Returns
      -------
  
      predictions: tensor
          of shape (minibatch_size, sequence_length)
      """
  
      target_embedding = (
          self.item_embeddings(targets).permute(0, 2, 1).squeeze()
      )
      target_bias = self.item_biases(targets).squeeze()
  
      dot = (user_representations * target_embedding).sum(1).squeeze()
  
      return target_bias + dot
  
imports: import torch
  from torch.backends import cudnn
  import torch.nn
  import torch.nn.functional
  from spotlight.layers import ScaledEmbedding, ZeroEmbedding
label_desc: Use image node_id 3 for calling the LSTMNet obj's underlying member method code with example usage: obj.forward(user_representations, targets) and returns: unknown