Function scripted by jit.export in с++

Hello. I scripted by torch.jit.export function init_state() but can’t use it in c++ code.

class my_class(torch.nn.Module):
def forward …

def init_state():

a = torch.jit.script(my_class)
a.init_state(). #is working‘’)

In c++:
auto b =torch:jit:load(“”);
b.init_state(); //error

‘Struct torch:jit:Module’ has no member "init-state’’
Please help me use init_state in c++.

Works, without () in the end. Thank you very much)))

Thank you. I understand. My class and function are more complicate than i show, i can’t run program, but it compiles with run_method and with get_method without (). I see now, that init_state not need jit.export in my case(forward use init_state)
get_method with () //error
no match for call to ‘(torch::jit::method)()’

Thank you. It is working! Excellent)