thanks @KarthikR.
your snippet works fine for hierarchical architectures where all children are structured properly below their parents.
I am looking for a way to list all parents that would work also for complex scenarios such as resnets, where the connection scheme have multiple parents in non-sequential order.
try:

import torchvision.models as models
model = models.resnet18()

I think this would require the inspection of the actual tensor flow along the net.