10 #ifdef LIBTORCH_ENABLED 22 "The file name which contains the torch script module.");
25 "load_during_construction",
27 "If we want to load this neural network while we are constructing this object.");
38 _filename(getParam<FileName>(
"filename")),
39 _torchscript_module(
std::make_unique<
Moose::TorchScriptModule>(_filename))
std::unique_ptr< Moose::TorchScriptModule > _torchscript_module
The libtorch neural network that is currently stored here.
A MultiMooseEnum object to hold "execute_on" flags.
static InputParameters validParams()
static InputParameters validParams()
const ExecFlagType EXEC_NONE
A user object the loads a torch module using the torch script format and just-in-time compilation...
virtual void execute() override
Execute method.
TorchScriptUserObject(const InputParameters ¶meters)
registerMooseObject("MooseApp", TorchScriptUserObject)
const FileName & _filename
The file name that specifies the torch script model.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
torch::Tensor evaluate(const torch::Tensor &input) const
Function to evaluate the torch script module at certain input.