Week 4 - Programming Assignment -1 - Exercise 9 - L_model_backward

I get this error when I initialized caches. I’m not sure what should I initiate in current_cache

File “”, line 62
current_cache = caches
^
IndentationError: expected an indented block

Now I get this error

IndexError: boolean index did not match indexed array along dimension 0; dimension is 1 but corresponding boolean dimension is 3

You don’t show us the actual exception trace, so we can’t see the operands on the line that is “throwing”. That is the place to look. You’ve got a shape mismatch of some sort, so the first step is to understand what you think the shapes should be at that point in the code. Start by doing the “dimensional analysis” on the test case. Here’s a thread with an example of how to do that, but it is for the L_model_forward test. But apply the same ideas to this test case.

Also note that your previous line with the initialization of current_cache is wrong even once you get it indented correctly. caches is an array with one entry per layer, right? You need to select the entry for the current layer.