code: def rotate_half(x):
      """Rotates half the hidden dims of the input."""
      x1 = x[..., : x.shape[-1] // 2]
      x2 = x[..., x.shape[-1] // 2 :]
      return torch.cat((-x2, x1), dim=-1)
  
file_path: long-lora/gptneox_attn_replace.py
imports: from typing import Optional, Tuple
  import warnings
  import torch
  import transformers
  from einops import rearrange
  from flash_attn import flash_attn_varlen_qkvpacked_func, flash_attn_varlen_func
  from flash_attn.bert_padding import unpad_input, pad_input
label_desc: Use image node_id 1 for calling a global function with example usage: rotate_half(x) and returns: torch