Gradient Checking doubt - course 2

You can examine the source code for the routines dictionary_to_vector and vector_to_dictionary to see the details of how the conversions are done (see the FAQ Thread for how to find and open the relevant file). But it is creating theta as a simple vector with all the elements of the various W and b values concatenated. That means that theta[i] is one element from one of the various W or b values.