Exercise 2: conv_single_step

I’m getting the following error but the value for Z looks correct. np.dtype for W b and Z are all np.float64:

Z = -6.999089450680221
Error: Datatype mismatch
2 Tests passed
1 Tests failed

1 Like

Hi @avsharp,
Have you tried running your assignment with np.float32 consistently for all variables?

W and a_slice_prev are both float64 so I changed them to make everything consistent. Here are the dtypes:

s dtype float32
W dtype float32
b dtype float32
Z dtype float32
a_slice_prev float32
Z = -6.999089
s dtype float32
W dtype float32
b dtype float32
Z dtype float32
a_slice_prev float32
Error: Datatype mismatch

OK - I got it to work with everything np.float64:

s.dtype = float64
b.dtype = float64
Z.dtype = float64
Z = -6.999089450680221
s.dtype = float64
b.dtype = float64
Z.dtype = float64
s.dtype = float64
b.dtype = float64
Z.dtype = float64
s.dtype = float64
b.dtype = float64
Z.dtype = float64
All tests passed.

2 Likes