That means your mistake is in the clip
function, but the unit tests and the grader tests don’t detect the error as a problem in clip
, but it gets reported as a problem in optimize
. Here’s a thread that explains what is going on there. Sorry, the error messages are not helpful here.
We have obviously seen this before and I thought I had filed a bug report about it, but I can’t find it now. Given that it happens every few months, this really should be fixed and shouldn’t even be that hard to do: just add a test case in the notebook for the clip function to specifically catch this “error”. Although in the bigger picture, I’m not getting why they make such a big deal of this. What would be the harm of supplying an extra gradient other than a little wasted compute and memory?