class_docstr: Fused RoPE function
  
  This implementation assumes the input tensor to be in `sbhd` format and the RoPE tensor to be
  of shape (s, 1, 1, d). It 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","This","implementation","assumes","the","input","tensor","to","be","in","`","sbhd","`","format","and","the","RoPE","tensor","to","be","of","shape","(","s",",","1",",","1",",","d",")",".","It","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,
      freqs: torch.Tensor,
      transpose_output_memory: bool = False,
  ) -> torch.Tensor:
      import fused_rotary_positional_embedding
  
      output = fused_rotary_positional_embedding.forward(
          t, freqs, transpose_output_memory
      )
      ctx.save_for_backward(freqs)
      ctx.transpose_output_memory = transpose_output_memory
  
      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 FusedRoPEFunc obj's underlying member method code with example usage: obj.forward(ctx, t, freqs, transpose_output_memory) and returns: output