10 #ifdef 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 torch::optional< size_t > size() const override
Return the number of samples this data set contains.
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::Tensor _data_tensor
Tensor containing the data (inputs)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
torch::Tensor _response_tensor
Tensor containing the responses (outputs) for the data.