docstr: Splits hidden dim into attn_head_size and num_attention_heads
docstr_tok: ["Splits","hidden","dim","into","attn_head_size","and","num_attention_heads"]
code: def _split_heads(cls, tensor, num_attention_heads, attn_head_size):
      """
      Splits hidden dim into attn_head_size and num_attention_heads
      """
      # tensor: [bs, seq_len, hidden_size]
      new_shape = tensor.size()[:-1] + (
          num_attention_heads,
          attn_head_size,
      )
      # -> [bs, seq_len, num_attention_heads, attn_head_size]
      tensor = tensor.view(new_shape)
      # -> [bs, num_attention_heads, seq_len, attn_head_size]
      tensor = tensor.permute(0, 2, 1, 3)
      return tensor
  
imports: import os
  import pdb
  import copy
  import math
  import numpy
  from dataclasses import dataclass
  from typing import Optional, Tuple, Union
  import torch
  from torch import nn
  import torch.utils.checkpoint
  import torch.nn.functional
  from torch.cuda.amp import autocast
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from transformers.models.gpt_neox.modeling_gpt_neox import RotaryEmbedding, GPTNeoXAttention, apply_rotary_pos_emb
label_desc: Use image node_id 4 for calling the GPTNeoXAttention_Mask obj's underlying member method code with example usage: obj._split_heads(cls, tensor, num_attention_heads, attn_head_size) and returns: tensor