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.