class_docstr: Rationale generator module
      
class_docstr_tok: ["Rationale","generator","module"]
docstr: Forward pass in the DepGenerator
  
  :param X_embeddings: input sequence of word embeddings
  :type X_embeddings: (batch_size, sequence_length, embedding_dim)
  :param h0: initial RNN weights, defaults to None
  :type h0: torch.FloatTensor, optional
  :param mask: mask indicating word tokens (1) and padding (0)
      with shape (batch_size, length), defaults to None
  :type mask: torch.FloatTensor, optional
  :return: scores of the importance of each word in X_embeddings
  :rtype: torch.FloatTensor
docstr_tok: ["Forward","pass","in","the","DepGenerator",":","param","X_embeddings",":","input","sequence","of","word","embeddings",":","type","X_embeddings",":","(","batch_size",",","sequence_length",",","embedding_dim",")",":","param","h0",":","initial","RNN","weights",",","defaults","to","None",":","type","h0",":","torch.FloatTensor",",","optional",":","param","mask",":","mask","indicating","word","tokens","(","1",")","and","padding","(","0",")","with","shape","(","batch_size",",","length",")",",","defaults","to","None",":","type","mask",":","torch.FloatTensor",",","optional",":","return",":","scores","of","the","importance","of","each","word","in","X_embeddings",":","rtype",":","torch.FloatTensor"]
code: def forward(self, X_embeddings, h0=None, mask=None):
      """Forward pass in the DepGenerator
  
      :param X_embeddings: input sequence of word embeddings
      :type X_embeddings: (batch_size, sequence_length, embedding_dim)
      :param h0: initial RNN weights, defaults to None
      :type h0: torch.FloatTensor, optional
      :param mask: mask indicating word tokens (1) and padding (0)
          with shape (batch_size, length), defaults to None
      :type mask: torch.FloatTensor, optional
      :return: scores of the importance of each word in X_embeddings
      :rtype: torch.FloatTensor
      """
      """
          Outputs:
              z -- output rationale, "binary" mask, (batch_size, sequence_length)
          """
      # hiddens' dimensions: (batch_size, sequence_length, hidden_dim)
      hiddens = (
          self.generator_model(X_embeddings, mask, h0)
          .transpose(1, 2)
          .contiguous()
      )
      # scores' dimensions: (batch_size, sequence_length, 2)
      scores = self.output_layer(hiddens)
      return scores
  
imports: import os
  import logging
  import numpy
  import torch
  import torch.nn
  from torch.autograd import Variable
  from tqdm import tqdm
  from interpret_text.experimental.common.utils_introspective_rationale import generate_data
label_desc: Use image node_id 2 for calling the DepGenerator obj's underlying member method code with example usage: obj.forward(X_embeddings, h0, mask) and returns: scores