Hello everyone. I’m trying a very basic example, in which I’m loading an MTCNN model (consists of 3 submodules onet, pnet and rnet) and trying to feed forward them. This is the code :
#include <torch/torch.h>
#include <torch/script.h> // One-stop header.
#include <iostream>
#include <memory>
#include <cstdlib>

int main(int argc, const char* argv[]) 
{

    // Create a vector of inputs.
    std::vector<torch::jit::IValue> inputs;
    inputs.push_back(torch::ones({ 1, 3, 112, 112 }));

    torch::jit::script::Module onet;
    torch::jit::script::Module pnet;
    torch::jit::script::Module rnet;
    try 
    {
        std::string mtcnn_onet_path = "G:\\Codes\\python\\MTCNN\\weights_mtcnn_onet.pt";
        std::string mtcnn_pnet_path = "G:\\Codes\\python\\MTCNN\\weights_mtcnn_pnet.pt";
        std::string mtcnn_rnet_path = "G:\\Codes\\python\\MTCNN\\weights_mtcnn_rnet.pt";

        // Deserialize the ScriptModule from a file using torch::jit::load().
        onet = torch::jit::load(mtcnn_onet_path);
        pnet = torch::jit::load(mtcnn_pnet_path);
        rnet = torch::jit::load(mtcnn_rnet_path);

        // Execute the model and turn its output into a tensor.
        at::Tensor output_o = onet.forward(inputs).toTensor();
        at::Tensor output_p = pnet.forward(output_o).toTensor();
        at::Tensor output = rnet.forward(output_p).toTensor();

        std::cout << output.sizes() << std::endl;
        std::cout << "output: " << output[0] << std::endl;
    
    }
    catch (const c10::Error& e) 
    {
        std::cerr << "error loading the model\n";
        return -1;
    }

    std::cout << "ok\n";
    std::system("pause");
    return 0;
}

but I get :
Severity	Code	Description	Project	File	Line	Suppression State
Error	C2664	'c10::IValue torch::jit::Module::forward(std::vector<c10::IValue,std::allocator<c10::IValue>>)': cannot convert argument 1 from 'at::Tensor' to 'std::vector<c10::IValue,std::allocator<c10::IValue>>'	LibtorchPort	G:\Codes\cpp\port\LibtorchPort\LibtorchPort\LibtorchPort.cpp	54	

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2664	'c10::IValue torch::jit::Module::forward(std::vector<c10::IValue,std::allocator<c10::IValue>>)': cannot convert argument 1 from 'at::Tensor' to 'std::vector<c10::IValue,std::allocator<c10::IValue>>'	LibtorchPort	G:\Codes\cpp\port\LibtorchPort\LibtorchPort\LibtorchPort.cpp	55	


Shouldnt we pass inputs as Tensors like in Python?
I couldnt find any documentation that properly explains this . any help in this regard is appreciated.
By the way these are the modules : https://gofile.io/d/DyeriF