def METHOD_NAME(inp, offsets, max_seq_len, pad_value):
    res = torch.full(
        (offsets.shape[0] - 1, max_seq_len, inp.shape[1]),
        pad_value,
        device=inp.device,
        dtype=inp.dtype,
    )
    for b in range(offsets.shape[0] - 1):
        for r in range(offsets[b + 1] - offsets[b]):
            res[b][r] = inp[offsets[b] + r]
    return res