import torch
import random


def get_random_inputs(batch_size: int, sequence_length: int, input_size: int):
    """
    Creates and returns random masked input data for an RNN.
    """
    input_data = torch.randn(batch_size, sequence_length, input_size)
    mask = torch.ones(batch_size, sequence_length, dtype=torch.uint8)
    # Start with 1 to make sure one of the inputs is not masked at all
    for i in range(1, batch_size):
        index = random.randint(1, sequence_length)
        mask[i, index:] = 0
    return input_data, mask