10#ifdef MOOSE_LIBTORCH_ENABLED
30 virtual void execute()
override;
35 const std::unique_ptr<Moose::TorchScriptModule> &
modulePtr()
const
51 torch::Tensor
evaluate(
const torch::Tensor & input)
const;
const InputParameters & parameters() const
Get the parameters of the object.
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.
virtual void finalize() override
Finalize.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
static InputParameters validParams()
Moose::TorchScriptModule & module()
Get non-const access to the module. Could be used for further training within MOOSE.
torch::Tensor evaluate(const torch::Tensor &input) const
Function to evaluate the torch script module at certain input.
const Moose::TorchScriptModule & module() const
Get const access to the module.
std::unique_ptr< Moose::TorchScriptModule > & modulePtr()
Get non-const access to the module pointer. Could be used for further training within MOOSE.
const FileName & _filename
The file name that specifies the torch script model.
const std::unique_ptr< Moose::TorchScriptModule > & modulePtr() const