~/work/release/W4A1/test_utils.py in multiple_test(test_cases, target)
140 print(’\033[92m’, success," Tests passed")
141 print(’\033[91m’, len(test_cases) - success, " Tests failed")
→ 142 raise AssertionError(“Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.”.format(target.name))
143
AssertionError: Not all tests were passed for linear_backward. Check your equations and avoid using global variables inside the function.
What is the purpose of using both keepdims = True and then np.squeeze on the result? The squeeze will defeat the purpose of the keepdims, right? Check the shape of your db. It should be the same shape as b, but I will predict it comes out to be a 1D array not a 2D array.
Also just as a programming style point, they already gave you the code to extract the elements of the cache parameter in the template code. Your code will be clearer if you use those variables rather than indexing cache as you do.
Just for future reference, the error message did tell you that your db was the wrong shape. I tried making your “squeeze” mistake and here is the earlier part of the error trace that I got: