class_docstr: Torchscriptable version of `BertSelfAttention` from Huggingface transformers v2.3.0
  https://github.com/huggingface/transformers/blob/v2.3.0/transformers/modeling_bert.py # noqa
  
  Modifies the `forward` function and `transpose_for_scores` function
  
  Changes to `transpose_for_scores` function ::
      Changes the `new_x_shape` unpacking as static size inference is not supported
  
  Changes to `forward` function ::
      Uses scriptable `nn.functional.softmax` and also removes several static size
      inference which is not supported.
class_docstr_tok: ["Torchscriptable","version","of","`","BertSelfAttention","`","from","Huggingface","transformers","v2.3.0","https",":","\/\/github.com\/huggingface\/transformers\/blob\/v2.3.0\/transformers\/modeling_bert.py","#","noqa","Modifies","the","`","forward","`","function","and","`","transpose_for_scores","`","function","Changes","to","`","transpose_for_scores","`","function",":",":","Changes","the","`","new_x_shape","`","unpacking","as","static","size","inference","is","not","supported","Changes","to","`","forward","`","function",":",":","Uses","scriptable","`","nn.functional.softmax","`","and","also","removes","several","static","size","inference","which","is","not","supported","."]
code: def transpose_for_scores(self, x: Tensor) -> Tensor:
      new_x_shape = x.size()[:-1] + (
          self.num_attention_heads,
          self.attention_head_size,
      )
      x = x.view(new_x_shape)
      return x.permute(0, 2, 1, 3)
  
imports: import math
  from typing import List, Optional, Tuple
  import torch
  from mmf.utils.patch import restore_saved_modules, safecopy_modules
  from torch import nn, Tensor
label_desc: Use image node_id 1 for calling the BertSelfAttentionJit obj's underlying member method code with example usage: obj.transpose_for_scores(x) and returns: x