Solved by Matej_Kompanek in post #3 
              
              
                You could try something like this -> 
struct MLP : public torch::nn::Module
{
	torch::nn::Linear fc1{ nullptr }, fc2{ nullptr }, fc3{ nullptr };

	MLP()
	{
		fc1 = register_module("fc1", torch::nn::Linear(2, 10));
		fc2 = register_module("fc2", torch::nn::Linear(10, 10));
		fc3 = register_module("fc…