Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
LArDLHelper.h
Go to the documentation of this file.
1
8#ifndef LAR_DL_HELPER_H
9#define LAR_DL_HELPER_H 1
10
11#include <torch/script.h>
12#include <torch/torch.h>
13
14#include "Pandora/StatusCodes.h"
15
16namespace lar_dl_content
17{
18
23{
24public:
25 typedef torch::jit::script::Module TorchModel;
26 typedef torch::Tensor TorchInput;
27 typedef std::vector<torch::jit::IValue> TorchInputVector;
28 typedef at::Tensor TorchOutput;
29
38 static pandora::StatusCode LoadModel(const std::string &filename, TorchModel &model);
39
46 static void InitialiseInput(const at::IntArrayRef dimensions, TorchInput &tensor);
47
55 static void Forward(TorchModel &model, const TorchInputVector &input, TorchOutput &output);
56};
57
58} // namespace lar_dl_content
59
60#endif // #ifndef LAR_DL_HELPER_H
Header file defining status codes and relevant preprocessor macros.
LArDLHelper class.
Definition LArDLHelper.h:23
torch::jit::script::Module TorchModel
Definition LArDLHelper.h:25
static void InitialiseInput(const at::IntArrayRef dimensions, TorchInput &tensor)
Create a torch input tensor.
std::vector< torch::jit::IValue > TorchInputVector
Definition LArDLHelper.h:27
static pandora::StatusCode LoadModel(const std::string &filename, TorchModel &model)
Loads a deep learning model.
static void Forward(TorchModel &model, const TorchInputVector &input, TorchOutput &output)
Run a deep learning model.
StatusCode
The StatusCode enum.