code: def fused_apply_rotary_pos_emb_thd(
      t: torch.Tensor,
      cu_seqlens: torch.Tensor,
      freqs: torch.Tensor,
  ) -> torch.Tensor:
      """Apply rotary positional embedding to input tensor T in `thd` format, where
      t: cumulative sum of sequence lengths
      h: head num
      d: dim of each head
  
      Args:
          t (Tensor): Input tensor T is of shape [t, h, d]
          cu_seqlens (Tensor): Cumulative sum of sequence lengths in a batch for `t`,
          with shape [b + 1] and dtype torch.int32.
          freqs (Tensor): Rotary Positional embedding tensor freq is of shape [max_s, 1, 1, d] and
          `float` dtype
  
      Returns:
          Tensor: The input tensor after applying RoPE
      """
      return FusedRoPETHDFunc.apply(t, cu_seqlens, freqs)
  
file_path: apex/apex/transformer/functional/fused_rope.py
imports: from typing import Tuple, Union
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: fused_apply_rotary_pos_emb_thd(t, cu_seqlens, freqs) and returns: FusedRoPETHDFunc