Week 4 Assignment 1 exercise 5

I have been trying to get the L-layer forward propagation function correctly but I keep getting this error. Can someone help me or point me where I am going wrong
Edit: I made the changes suggested but while running it as a seperate code block I am getting the desired result but not in the function. Any possible mistake I am making because I cant get there

[code removed - moderator]

Forward pass of the output layer is incorrect. You should perform forward pass of the last linear layer with the output activation function. This has nothing to do with caches.