No attribute as torch.sqaure

C1W3_WGAN_GP:

Getting error while submitting as torch does not have attribute square but it worked while compiling. And the tests also passed.

It turns out that the grader in some cases uses an older version of Pytorch that does not include the square attribute. Here’s a thread which discusses this. Of course it would have been better if the versions were consistent between the notebook and the grader, but we can work around this as shown on that other thread. It has also been reported to the course staff.

Just as a general note, you posted this under General Discussion, but I was able to recognize it. You’ll have better luck if you file things under the appropriate category. I’ve used the little “edit pencil” on the title to move the category to GANs C1.

Thank you.

Hi @Lalit_Mahajan, is it now solved?

I changed the code to x*x and submitted the assignment.