Multilevel inheritance for Mask R-CNN-Calling the base class (GeneralizedRCNN)

Pytorch implementation of Mask R-CNN is multilevel inheritance:

class GeneralizedRCNN(nn.Module):
     def __init__(self, sm inputs):
     def forward(self, x):
           return sm_outputs

class FasterRCNN(GeneralizedRCNN):
     def __init__(self, sm_cool_inputs):
           super(FasterRCNN, self).__init__(sm_inputs=sm_cool_inputs)

class MaskRCNN(FasterRCNN):
     def __init__(self, sm_awsm_inputs):
           super(MaskRCNN, self).__init__(sm_cool_inputs=sm_awsm_inputs)
           self.sm_module.sm_more = sm_awsm_inputs.sm_awsm_input

Finally, you write a script where you call


So how does one actually get to run the forward method in the base class? I think it is some ‘magic method’ like __getitem__ for dataset interfaces. Is this correct?