class_docstr: Self-attention mechanism.
class_docstr_tok: ["Self-attention","mechanism","."]
code: def transpose_for_scores(self, x):
      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: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import logging
  import math
  import torch
  from torch import nn
  from towhee.models.layers.activations import swish, gelu
label_desc: Use image node_id 2 for calling the BertSelfAttention obj's underlying member method code with example usage: obj.transpose_for_scores(x) and returns: x