The softmax_test fails for 1 our of 3 tests. Like this
Error: Wrong output
2 Tests passed
1 Tests failed
AssertionError: Not all tests were passed for softmax. Check your equations and avoid using global variables inside the function.
This is interesting since all three tests have the same input matrix into the softmax function which is the same as the demo function:
It might be helpful to see the actual output you get when you run the test case in the notebook. I modified my code to print out the intermediate values for x_exp and x_sum. Here’s what I get when I run the test case in the notebook:
Hmmm, I’m not sure what you mean here. I tried making the mistake that you describe and both the local test case in the notebook and the grader fail, as I would have expected. Can you give more detail about the case in which you believe that wrong code passed the test cases?
Thanks for the followup. Yes, that is ok: the tests check different things, e.g. the “shape” and “datatype” of your output will still be correct. But it fails the test for the actual value, meaning that the tests successfully detect your error, which is what I wanted to confirm.