10#ifdef MOOSE_LIBTORCH_ENABLED
14#include <torch/torch.h>
31 torch::data::Example<>
get(
size_t index)
override
33 mooseAssert(index <
size(),
"Index is out of range!");
38 torch::optional<size_t>
size()
const override
This class is a wrapper around a libtorch dataset which can be used by the data loaders in the neural...
LibtorchDataset(torch::Tensor dt, torch::Tensor rt)
Construct using the input and output tensors.
torch::data::Example get(size_t index) override
Get a sample pair from the input and output tensors.
torch::Tensor _data_tensor
Tensor containing the data (inputs)
torch::optional< size_t > size() const override
Return the number of samples this data set contains.
torch::Tensor _response_tensor
Tensor containing the responses (outputs) for the data.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...