Week1 Sample function through error: parameters a and p are not the same size

In the sample function, it throws the parameters a and p are not the same size error. I followed the suggestion from this post to print the dimension of each parameter, but it seems I have the correct dimension for all parameters. Any suggestion? Thank you so much!

Why did you subtract 1 from vocab_size?

To get a list ranging from [0,vocab_size-1]. Now I get what is the problem, thanks!