Hi, thanks for the prompt reply.
I will have C++ gateways to call the libtorch, compiled and link so that it becomes a native function in Scilab. In user end, they will just call sth like : trained_model = torch_train(data, target, model_arch, configs) .
Option 1 - Correct me if I am wrong but  this will require the recompiling the codes every time a model being define in header, so It might be not flexible, unless the model could be parse as the input to the function.
Option 2 - I will explore more of this options, I remember there are some changes in 1.1 and 1.2, will try out this on 1.2 and get back to you on this. My previous test on mnist examples giving error sth like “forward method not define” during runtime, will confirm this again.
Again, thanks for your details reply and useful suggestions.
Regards,
Chin Luh