code: def _cosine_similarity(self, a, b):
      a_norm = a / a.norm(dim=1)[:, None]
      b_norm = b / b.norm(dim=1)[:, None]
      return th.mm(a_norm, b_norm.transpose(0, 1))
  
imports: import logging
  import torch
  from ..attention_cell import gen_self_attn_mask
  from .transformer import TransformerEncoderLayer
  from ..layers import get_activation, sequence_mask
  from ...utils.registry import Registry
  from ...models.bert import bert_cfg_reg
label_desc: Use image node_id 4 for calling the QTBertForPretrain obj's underlying member method code with example usage: obj._cosine_similarity(a, b) and returns: th