Thank you for your kind reply.
The idea is simple.
let say a,b,c are the same model architecures (eg, simple  a nn.Linear layer). These three models are trained on the specific classes samples from a single batch. The final output is d = a+b+c (all the indiviual model outputs are mutually exclusives) i.e. a is trained on first 15 samples, b is trained on next 20 samples and c is trained on last 15 samples.  The final loss (sum of indiviual losses) backward for updating the respective model parameters. In keras, we can create a single model with 3 different dictionaries. Each dictionary model can be updated by specific training samples of the current batch i.e. all the individual dictionary models are trained separately based on specific training samples.
For the pytorch solution, I have created a main model in which the 3 submodels (a,b,c) are assigned by nn.ModuleList(). That means, all the indiviual models are sharing the same structure but mutually exclusive in nature. Now, the mask is defined for selecting the models from the main models. The final output passed through nn.mse loss. If I update the optimizer steps, the  models will be updated based on selecting samples. Am I do something wrong? Please tell me. If I am wrong then how do I solve the problem?