It does fix my issue, thank you for your time.
I have a quick follow up: I wish to store my Optimser within a struct, like this:
struct Cascai_Network : torch::nn::Module 
{
    Cascai_Network()
    {
        
    }

    Cascai_Network(int n_features, int n_outputs);

    torch::Tensor forward(torch::Tensor x);

    //

    torch::nn::Linear fc1{nullptr};
    torch::nn::Linear fc2{nullptr};
    torch::nn::Linear fc3{nullptr};

    torch::optim::Adam optimiser;
};

But I get a compile error in the default constructor which states
“torch::optim::Adam::Adam()’ is private within this context”
Have you any advice on how to structure my program to solve this?
Thank you.