class_docstr: Module representing users through stacked causal atrous convolutions ([3]_, [4]_).
  
  To represent a sequence, it runs a 1D convolution over the input sequence,
  from left to right. At each timestep, the output of the convolution is
  the representation of the sequence up to that point. The convolution is causal
  because future states are never part of the convolution's receptive field;
  this is achieved by left-padding the sequence.
  
  In order to increase the receptive field (and the capacity to encode states
  further back in the sequence), one can increase the kernel width, stack
  more layers, or increase the dilation factor.
  Input dimensionality is preserved from layer to layer.
  
  Residual connections can be added between all layers.
  
  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 filters
      in each convolutional layer.
  kernel_width: tuple or int, optional
      The kernel width of the convolutional layers. If tuple, should contain
      the kernel widths for all convolutional layers. If int, it will be
      expanded into a tuple to match the number of layers.
  dilation: tuple or int, optional
      The dilation factor for atrous convolutions. Setting this to a number
      greater than 1 inserts gaps into the convolutional layers, increasing
      their receptive field without increasing the number of parameters.
      If tuple, should contain the dilation factors for all convolutional
      layers. If int, it will be expanded into a tuple to match the number
      of layers.
  num_layers: int, optional
      Number of stacked convolutional layers.
  nonlinearity: string, optional
      One of ('tanh', 'relu'). Denotes the type of non-linearity to apply
      after each convolutional layer.
  residual_connections: boolean, optional
      Whether to use residual connections between convolutional layers.
  item_embedding_layer: an embedding layer, optional
      If supplied, will be used as the item embedding layer
      of the network.
  
  References
  ----------
  
  .. [3] Oord, Aaron van den, et al. "Wavenet: A generative model for raw audio."
     arXiv preprint arXiv:1609.03499 (2016).
  .. [4] Kalchbrenner, Nal, et al. "Neural machine translation in linear time."
     arXiv preprint arXiv:1610.10099 (2016).
class_docstr_tok: ["Module","representing","users","through","stacked","causal","atrous","convolutions","(","[","3","]","_",",","[","4","]","_",")",".","To","represent","a","sequence",",","it","runs","a","1D","convolution","over","the","input","sequence",",","from","left","to","right",".","At","each","timestep",",","the","output","of","the","convolution","is","the","representation","of","the","sequence","up","to","that","point",".","The","convolution","is","causal","because","future","states","are","never","part","of","the","convolution","'s","receptive","field",";","this","is","achieved","by","left-padding","the","sequence",".","In","order","to","increase","the","receptive","field","(","and","the","capacity","to","encode","states","further","back","in","the","sequence",")",",","one","can","increase","the","kernel","width",",","stack","more","layers",",","or","increase","the","dilation","factor",".","Input","dimensionality","is","preserved","from","layer","to","layer",".","Residual","connections","can","be","added","between","all","layers",".","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","filters","in","each","convolutional","layer",".","kernel_width",":","tuple","or","int",",","optional","The","kernel","width","of","the","convolutional","layers",".","If","tuple",",","should","contain","the","kernel","widths","for","all","convolutional","layers",".","If","int",",","it","will","be","expanded","into","a","tuple","to","match","the","number","of","layers",".","dilation",":","tuple","or","int",",","optional","The","dilation","factor","for","atrous","convolutions",".","Setting","this","to","a","number","greater","than","1","inserts","gaps","into","the","convolutional","layers",",","increasing","their","receptive","field","without","increasing","the","number","of","parameters",".","If","tuple",",","should","contain","the","dilation","factors","for","all","convolutional","layers",".","If","int",",","it","will","be","expanded","into","a","tuple","to","match","the","number","of","layers",".","num_layers",":","int",",","optional","Number","of","stacked","convolutional","layers",".","nonlinearity",":","string",",","optional","One","of","(","'tanh","'",",","'relu","'",")",".","Denotes","the","type","of","non-linearity","to","apply","after","each","convolutional","layer",".","residual_connections",":","boolean",",","optional","Whether","to","use","residual","connections","between","convolutional","layers",".","item_embedding_layer",":","an","embedding","layer",",","optional","If","supplied",",","will","be","used","as","the","item","embedding","layer","of","the","network",".","References","--","--","--","--","--","..","[","3","]","Oord",",","Aaron","van","den",",","et","al",".","``","Wavenet",":","A","generative","model","for","raw","audio",".","''","arXiv","preprint","arXiv:1609.03499","(","2016",")",".","..","[","4","]","Kalchbrenner",",","Nal",",","et","al",".","``","Neural","machine","translation","in","linear","time",".","''","arXiv","preprint","arXiv:1610.10099","(","2016",")","."]
docstr: Compute predictions for target items given user representations.
  
  Parameters
  ----------
  
  user_representations: tensor
      Result of the user_representation_method.
  targets: tensor
      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","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
          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 CNNNet obj's underlying member method code with example usage: obj.forward(user_representations, targets) and returns: unknown