Nice detective work, @Stuart_Fong1! I’ll report this to course staff so they can update the assignment.
FYI, I tried submitting my implementation, which passed fine, so you can implement this so that it works with w being an array or a scalar. I suspect the developers of the assignment might have even intended that it should work with both, since I see a test in the public tests, compute_cost_test where it tests with: initial_w = np.array([2.]). But, of course, everything in the assignment says w is a scalar, so either the assignment needs to be updated to say it should support both, or the grader needs to be updated to only test with scalars.
If you’re curious, you might want to click on the “Click for hints” link in the assignment to see an approach that should work even if w is an array
Hi, I didn’t have the issue but I’m curious about why this happened for some people.
Please, could we maybe have any follow-up on this issue?
Thank you!