Dropout function Week 1 Assignment 2 Course 2

I had a general question regarding dropouts :

When we introduce dropout in an L layer network, do we introduce the D1, D2… in the parameters? Or we declare a new variable and then start. Like what is the best method to follow?
If that is declaring them in the parameters, should be even doing the prob check in the initialization or we should perform that in the forward propagation?

Thank you

In forward_propagation_with_dropout, dropout is done manually. D is required for each layer where dropout is applied.

Tensorflow has a Dropout layer where you can configure the rate parameter.