docstr: x and clf_tokens_mask have shape [seq length, batch] padding_mask has shape [batch, seq length] 
docstr_tok: ["x","and","clf_tokens_mask","have","shape","[","seq","length",",","batch","]","padding_mask","has","shape","[","batch",",","seq","length","]"]
code: def forward(self, x):
      """x and clf_tokens_mask have shape [seq length, batch] padding_mask has shape [batch, seq length]"""
      clf_tokens_mask = (
          x.transpose(0, 1).contiguous().to("cpu")
          == self.tokenizer.vocab["[CLS]"]
      )
      hidden_states = self.transformer(x)
  
      lm_logits = self.lm_head(hidden_states)
      clf_tokens_states = (
          hidden_states * clf_tokens_mask.unsqueeze(-1).float()
      ).sum(dim=0)
      clf_logits = self.classification_head(clf_tokens_states)
  
      return lm_logits, clf_logits
  
imports: import torch
  from pytorch_pretrained_bert import BertTokenizer
  from transfer_nlp.plugins.config import register_plugin
label_desc: Use image node_id 4 for calling the TransformerWithClfHeadAndLMHead obj's underlying member method code with example usage: obj.forward(x) and returns: lm_logits,  clf_logits