class_docstr: Adapted from
  https://github.com/HazyResearch/flash-attention/blob/main/flash_attn/bert_padding.py
code: def forward(
      ctx,
      tensor: torch.Tensor,
      indices: torch.Tensor,
      batch_size: int,
      seq_len: int,
  ):
      ctx.save_for_backward(indices)
      # [ntokens, ...]
      tensor = tensor
      out = torch.zeros(
          (batch_size * seq_len, *tensor.shape[1:]),
          dtype=tensor.dtype,
          device=tensor.device,
      )
      # [b*s, ...]
      out[indices] = tensor
      return out
  
file_path: ColossalAI/colossalai/kernel/cuda_native/mha/utils.py
imports: from dataclasses import dataclass
  from typing import Iterable, Tuple
  import torch
  import torch.nn.functional
  from einops import rearrange
  from colossalai.utils.device import get_current_device
label_desc: Use image node_id 1 for calling the Repad obj's underlying member method code with example usage: obj.forward(ctx, tensor, indices, batch_size, seq_len) and returns: out