thanks so we have to pass list of param dict where dict represents a group here.
few more things


if there are sub children like in resnet ,how do i check if layer has sub children
Resnet is made up of multiple layers where each layer itself is a sequence of models.
so if i send some layer and want to validate if it has children or not ?


If below is my model


Sequential(
(0): Lambda()
(1): Conv2d(1, 8, kernel_size=(5, 5), stride=(2, 2), padding=(2, 2))
(2): ReLU()
(3): Conv2d(8, 16, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(4): ReLU()
(5): Conv2d(16, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(6): ReLU()
(7): Conv2d(32, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
(8): ReLU()
(9): AdaptiveAvgPool2d(output_size=1)
(10): Lambda()
(11): Linear(in_features=32, out_features=10, bias=False)
)
Is there a way to check  by name of  layer that i have reached adaptiveavgpool2d
i intend to form group dynamically  ,user will give some indices  & by default  if no indices given then default groups would be Input and all layers after input  till last classification layer .If i give indices then three group minimum

input
after input to till a layer before Avg layer 
from Avg to last layer

some more peace of excercise for you