The first theory is that there is something wrong with the type of your Z value. So the first question is, “what type is it?” Then the next question is “how did it get that way?”
I added the following print statement in a cell after the test cell (you can’t modify the test cell):
print(f"type(Z) = {type(Z)}")
And here’s what I get from that:
type(Z) = <class 'numpy.float64'>
What do you see when you do that?
One other thing to add here: there is an assertion in the test cell after the call to conv_single_step_test that makes it look like either np.float64 or np.float32 are ok for the type of Z. But that is not true: the test function requires it to be of type np.float64.