10#ifdef MOOSE_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))
const ExecFlagType EXEC_NONE
registerMooseObject("MooseApp", TorchScriptUserObject)
A MultiMooseEnum object to hold "execute_on" flags.
static InputParameters validParams()
A user object the loads a torch module using the torch script format and just-in-time compilation.
virtual void execute() override
Execute method.
std::unique_ptr< Moose::TorchScriptModule > _torchscript_module
The libtorch neural network that is currently stored here.
static InputParameters validParams()
TorchScriptUserObject(const InputParameters ¶meters)
torch::Tensor evaluate(const torch::Tensor &input) const
Function to evaluate the torch script module at certain input.
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...