class_docstr: Fused RoPE function for `thd` format.
  
  This implementation accepts arbitrary memory layouts to avoid the expensive
  `.contiguous()` calls, thus it may not achieve the best memory access pattern.
class_docstr_tok: ["Fused","RoPE","function","for","`","thd","`","format",".","This","implementation","accepts","arbitrary","memory","layouts","to","avoid","the","expensive","`",".contiguous","(",")","`","calls",",","thus","it","may","not","achieve","the","best","memory","access","pattern","."]
code: def forward(
      ctx,
      t: torch.Tensor,
      cu_seqlens: torch.Tensor,
      freqs: torch.Tensor,
  ) -> torch.Tensor:
      import fused_rotary_positional_embedding
  
      output = fused_rotary_positional_embedding.forward_thd(
          t, cu_seqlens, freqs
      )
      ctx.save_for_backward(cu_seqlens, freqs)
  
      return output
  
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 the FusedRoPETHDFunc obj's underlying member method code with example usage: obj.forward(ctx, t, cu_seqlens, freqs) and returns: output