Hi @GuyMerf,
As a hint - since the test is checking if the ratio is right, take a look at your line
quest = torch.randn(len(real)) > p_real
What would this give you if p_real is 0 (meaning you want no reals)? What would it give you if p_real is 1 (meaning you want all reals)? Is this what you’ll get in your next line of code with your current implementation?
Another thing you can try is to print out quest to see if the ratio looks right. Then think about what you need to change to fix it.
Once you fix that issue, I see another thing you’ll run into with your current code. Take a look at the “Optional Hints” - in particular the point about using clone()