code: def fused_apply_rotary_pos_emb(
      t: torch.Tensor,
      freqs: torch.Tensor,
      transpose_output_memory: bool = False,
  ) -> torch.Tensor:
      """Apply rotary positional embedding to input tensor T in `sbhd` format, where
      s: sequence length
      b: batch size
      h: head num
      d: dim of each head
  
      Args:
          t (Tensor): Input tensor T is of shape [s, b, h, d]
          freqs (Tensor): Rotary Positional embedding tensor freq is of shape [s, 1, 1, d] and
          `float` dtype
          transpose_output_memory (bool): Default to False. Whether to transpose the 's' and 'b'
          dimension of the output's underlying memory format. This is very helpful when you want to
          get a contiguous tensor after calling `output.transpose(0, 1)`.
  
      Returns:
          Tensor: The input tensor after applying RoPE
      """
      return FusedRoPEFunc.apply(t, freqs, transpose_output_memory)
  
file_path: apex/apex/transformer/functional/fused_rope.py
imports: from typing import Tuple, Union
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: fused_apply_rotary_pos_emb(t, freqs, transpose_output_memory) and returns: FusedRoPEFunc