Hi Thomas,
Thanks for your answer. Unfortunately your solution does not compile, e.g.
'output() is not a member a torch::jit::Module and more.
In the end I solved it by passing dummy input through the module like this:
    auto outputs = m_ptrModule->forward(inputs);
    if (outputs.isTuple())
    {
        m_nNumOutputs = outputs.toTuple()->elements().size();
    }
    else
    {
        m_nNumOutputs = 1;
    }

But personally I think this is a hack. I can ask the number of inputs:
m_ptrModule->get_method("forward").num_inputs();

But not the number of outputs…
Greetings,
Roos