I’m trying to write a simple function in c++ and then call in python but when I do that I’m getting the error that incompatible function arguments. The following argument types are supported: 1. (ag:0 at::Tensor)  ->  at::Tensor. What I am doing wrong?
This is my function:
#include <torch/script.h> // One-stop header.
#include <pybind11/pybind11.h>
#include <ATen/ATen.h>
at::Tensor test( at::Tensor& img){
    return img;
}
PYBIND11_MODULE(example, m) {
    m.doc() = "test function!";
    m.def("test", &test, "CudaTorch");
#ifdef VERSION_INFO
    m.attr("__version__") = VERSION_INFO;
#else
    m.attr("__version__") = "dev";
#endif
}

This is output:
Screenshot from 2020-07-22 18-20-5a2733×439 43.4 KB