class_docstr: Multi-head attention with relative positional encoding.
  This concept was proposed in the "Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context"
  Args:
      d_model (int): The dimension of model
      num_heads (int): The number of attention heads.
  Inputs: query, key, value, pos_embedding, mask
      - **query** (batch, time, dim): Tensor containing query vector
      - **key** (batch, time, dim): Tensor containing key vector
      - **value** (batch, time, dim): Tensor containing value vector
      - **pos_embedding** (batch, time, dim): Positional embedding tensor
      - **mask** (batch, 1, time2) or (batch, time1, time2): Tensor containing indices to be masked
  Returns:
      - **outputs**: Tensor produces by relative multi head attention module.
code: def _relative_shift(
      self, pos_score: torch.Tensor
  ) -> torch.Tensor:  # pylint: disable=no-self-use
      batch_size, num_heads, seq_length1, seq_length2 = pos_score.size()
      zeros = torch.zeros(
          (batch_size, num_heads, seq_length1, 1),
          device=pos_score.device,
      )
      padded_pos_score = torch.cat([zeros, pos_score], dim=-1)
      padded_pos_score = padded_pos_score.view(
          batch_size, num_heads, seq_length2 + 1, seq_length1
      )
      pos_score = padded_pos_score[:, :, 1:].view_as(pos_score)
      return pos_score
  
imports: import math
  from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from TTS.tts.layers.delightful_tts.conv_layers import Conv1dGLU, DepthWiseConv1d, PointwiseConv1d
  from TTS.tts.layers.delightful_tts.networks import GLUActivation
label_desc: Use image node_id 3 for calling the RelativeMultiHeadAttention obj's underlying member method code with example usage: obj._relative_shift(pos_score) and returns: pos_score