10 #ifdef 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;
std::unique_ptr< Moose::TorchScriptModule > _torchscript_module
The libtorch neural network that is currently stored here.
const Moose::TorchScriptModule & module() const
Get const access to the module.
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.
TorchScriptUserObject(const InputParameters ¶meters)
Moose::TorchScriptModule & module()
Get non-const access to the module. Could be used for further training within MOOSE.
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.
virtual void finalize() override
Finalize.
const std::unique_ptr< Moose::TorchScriptModule > & modulePtr() const
const InputParameters & parameters() const
Get the parameters of the object.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
torch::Tensor evaluate(const torch::Tensor &input) const
Function to evaluate the torch script module at certain input.