The C++ wrapper inspects the TorchScript forward() schema and builds the
argument list accordingly, ensuring backward compatibility with legacy models
(forward(input) or forward(input, layers)) while supporting the new extended
signature:
forward(input, layersCount, imageStats, imageDirection)