15#include <torch/script.h>
18#include "neml2/models/Model.h"
42 virtual void to(
const torch::TensorOptions & options)
override;
47 virtual void set_value(
bool out,
bool dout_din,
bool d2out_din2)
override;
50 std::vector<const Variable<Scalar> *>
_inputs;
Evaluate a pretrained libtorch model in .pt format, such as a neural network.
virtual void request_AD() override
virtual void to(const torch::TensorOptions &options) override
Override the base implementation to additionally send the model loaded from torch script to different...
std::vector< const Variable< Scalar > * > _inputs
std::unique_ptr< torch::jit::script::Module > _surrogate
We need to use a pointer here because forward is not const qualified.
Moose::DataFileUtils::Path _file_path
virtual void set_value(bool out, bool dout_din, bool d2out_din2) override
static OptionSet expected_options()
std::vector< Variable< Scalar > * > _outputs
Representation of a data file path.