Hello,
I do not know if my solution is elegant, but I believe it is a way to do what you want to do!
    x = torch.tensor([-1, 0, 0, 1], dtype=torch.float32)
    print(x)
    y = torch.zeros(size=(10, 10), dtype=torch.float32)
    for i in range(y.shape[0]):
        for j in range(y.shape[1]):
            choice = torch.randint(high=x.shape[0], size=(1, ))
            y[i, j] = x[choice]
    print(y)
    print(torch.sum((y == 1.0)))
    print(torch.sum((y == 0.0)))
    print(torch.sum((y == -1.0)))

Good luck!