Okay, I was also thinking the same as I can wrap those functions into a class and then instantiate those classes into the primary class. Something like,
import torch
import torch.nn as nn

class Module1(nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self,a,b):
    ## Body of the module
        return 

class Module2(nn.Module):
    def __init__(self):
        super().__init__()

    def forward(self,a,b):
    ## Body of the module
        return 

class Something(nn.Module):
    def __init__(self,a):
        super().__init__()
        self.something = Module1(a)
        self.module2 = Module2()

    def forward(self,a,b):
        x = self.module2(a,b)

One more thing do I need to inherit the secondary classes into the primary class Something