If model B is a class that inherits from the nn.Module it should also be included in the a.parameters() call. So yes, it should work 
Try printing the a.parameters() to see if you can spot the model B parameters just to confirm