The error seems to be at the line: push_back(Functional(torch::log_softmax, 1, torch::nullopt));.
Things I’ve changed: I’m using my own Dataset class and dataset. The network is exactly the same.
no matching function for call to ‘torch::nn::Functional::Functional(<unresolved overloaded function type>, int, const c10::nullopt_t&)’
push_back(Functional(torch::log_softmax, 1, torch::nullopt));
One thing to keep in mind is that you likely need to use a very new version of PyTorch (i.e. compiled from the master git branch or nightly releases).
The example you linked was added just a week ago, so it might need features from very recent PyTorch. The background is that some bits of the C++ API still have some catch-up to do to achieve parity with “classic” PyTorch.