def METHOD_NAME(test_case, device):
    input_size = random.randint(10, 150)
    max_seq_len = random.randint(20, 300)
    batch_size = random.randint(20, 300)
    lengths = []
    lengths.append(max_seq_len)
    for i in range(batch_size - 1):
        lengths.append(random.randint(1, max_seq_len))
    lengths.sort(reverse=True)
    sequences = []
    for i in range(batch_size):
        sequences.append(flow.rand(lengths[i], input_size).to(device))
    flow_res = flow_rnn_utils.pad_sequence(sequences)
    torch_inputs = [torch.tensor(ft.numpy(), device=device) for ft in sequences]
    torch_res = torch_rnn_utils.pad_sequence(torch_inputs)
    test_case.assertTrue(
        np.allclose(
            torch_res.cpu().detach().numpy(),
            flow_res.cpu().detach().numpy(),
            atol=1e-8,
        )
    )