docstr: Faster encoding that ignores any padding.
docstr_tok: ["Faster","encoding","that","ignores","any","padding","."]
code: def _forward_unpadded(self, x, x_mask):
      """Faster encoding that ignores any padding."""
      # Transpose batch and sequence dims
      x = x.transpose(0, 1)
  
      # Encode all layers
      outputs = [x]
      for i in range(self.num_layers):
          rnn_input = outputs[-1]
  
          # Apply dropout to hidden input
          #            if self.dropout_rate > 0:
          #                rnn_input = F.dropout(rnn_input,
          #                                      p=self.dropout_rate,
          #                                      training=self.training)
          # Forward
          rnn_output = self.rnns[i](rnn_input)[0]
          outputs.append(rnn_output)
  
      # Concat hidden layers
      if self.concat_layers:
          output = torch.cat(outputs[1:], 2)
      else:
          output = outputs[-1]
  
      # Transpose back
      output = output.transpose(0, 1)
  
      # Dropout on output layer
      if self.dropout_output and self.dropout_rate > 0:
          output = F.dropout(
              output, p=self.dropout_rate, training=self.training
          )
      return output.contiguous()
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.autograd import Variable
  import sru
label_desc: Use image node_id 3 for calling the StackedBRNN obj's underlying member method code with example usage: obj._forward_unpadded(x, x_mask) and returns: output