I’m guessing you’re talking about the sample() function. No, that is not the correct shape for y, but this is a pretty common error on this function. I added print statements to show the shapes of the matrices and the outputs there. Here’s what I see:
vocab_size = 27
Wax (100, 27) x (27, 1) Waa (100, 100) a_prev (100, 1)
Wya (27, 100) x (100, 1) + by (27, 1)
y.shape (27, 1)
len(y) 27
len(y.ravel()) 27
type(y.ravel()) <class 'numpy.ndarray'>