Wants help with C2W3 UNQ_C3

I have: noise_shape = (test_noise_samples, test_noise_channels, 10, 10)
and the test assert torch.abs((inject_noise(fake_images) - fake_images).std(2)).mean() < 1e-4 fails.
I find that strange. This part should not be hard.

Whats the issue here?

Well, I tried to write my problem without giving too many details. But, here comes many more details.
The code is like this:

UNQ_C3 (UNIQUE CELL IDENTIFIER, DO NOT EDIT)

GRADED CELL: InjectNoise

class InjectNoise(nn.Module):
‘’’
Inject Noise Class
Values:
channels: the number of channels the image has, a scalar
‘’’

[YOU CANNOT POST CODE SOLUTIONS HERE]

The problem is that is does not pass this test:

assert torch.abs((inject_noise(fake_images) - fake_images).std(2)).mean() < 1e-4

as I think it should. So, what could cause this error?

Well thats more clear of what the issue is now, hopefully a mentor of this course will pick it up as I am not familiar with it!

Hi, @Stefan_Persson.

Oddly enough, the assert statement in the test code cell is wrong. It should be
assert torch.abs((inject_noise(fake_images) - fake_images).std(2)).mean() > 1e-4 (more than rather than less than 1e-4). I’m able to reproduce the assert failure if I change to less than sign.
Perhaps you’ve accidentally changed the test code. Please make sure you’re using the default version of the assignment.

Kind regards,
DK.