gradients
is a dictionary with keys as the grad name like dW, dZ etc. You can see this with gradients.keys()
gradients_to_vector
converts this dictionary into a vector by arranging terms in a uniform fashion to help with vectorization.
Please follow a similar line of reasoning for dictionary_to_vector
# A good place to try to get this information is to look at the docstring for the functions.eg:
help(gradients_to_vector)
# to see how the dictionary items are arranged in a vector
from inspect import getsource
print(getsource(gradients_to_vector))