import torch


def get_random_index(x: torch.Tensor) -> torch.Tensor:
    """Given a tensor it compute random indices between 0 and the number of the first dimension

    :param x: Tensor used to get the number of rows
    """
    batch_size = x.size()[0]
    index = torch.randperm(batch_size)
    return index