Calling a scripting method from libtorch (other than forward)


I would like to know how can I call other methods of ScriptModule?

For example, I have a python module which has 2 scripting methods.

class MyScriptModule(torch.jit.ScriptModule):
def init(self):
super(MyScriptModule, self).init()
# torch.jit.trace produces a ScriptModule’s conv1 and conv2
self.conv1 = torch.jit.trace(nn.Conv2d(1, 20, 5), torch.rand(1, 1, 16, 16))
self.conv2 = torch.jit.trace(nn.Conv2d(20, 20, 5), torch.rand(1, 20, 16, 16))

def regressor(self, input):
    input = F.relu(self.conv1(input))
    return input

def forward(self, input):
  input = self.regressor(input)
  input = F.relu(self.conv2(input))
  return input

my_script_module = MyScriptModule(), ‘’)

How could I call ‘regressor’ in c++ ?