Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
lar_dl_content::LArDLHelper Class Reference

LArDLHelper class. More...

#include "LArDLHelper.h"

Public Types

typedef torch::jit::script::Module TorchModel
 
typedef torch::Tensor TorchInput
 
typedef std::vector< torch::jit::IValue > TorchInputVector
 
typedef at::Tensor TorchOutput
 

Static Public Member Functions

static pandora::StatusCode LoadModel (const std::string &filename, TorchModel &model)
 Loads a deep learning model.
 
static void InitialiseInput (const at::IntArrayRef dimensions, TorchInput &tensor)
 Create a torch input tensor.
 
static void Forward (TorchModel &model, const TorchInputVector &input, TorchOutput &output)
 Run a deep learning model.
 

Detailed Description

LArDLHelper class.

Definition at line 22 of file LArDLHelper.h.

Member Typedef Documentation

◆ TorchInput

Definition at line 26 of file LArDLHelper.h.

◆ TorchInputVector

typedef std::vector<torch::jit::IValue> lar_dl_content::LArDLHelper::TorchInputVector

Definition at line 27 of file LArDLHelper.h.

◆ TorchModel

typedef torch::jit::script::Module lar_dl_content::LArDLHelper::TorchModel

Definition at line 25 of file LArDLHelper.h.

◆ TorchOutput

Definition at line 28 of file LArDLHelper.h.

Member Function Documentation

◆ Forward()

void lar_dl_content::LArDLHelper::Forward ( TorchModel model,
const TorchInputVector input,
TorchOutput output 
)
static

Run a deep learning model.

Parameters
modelthe model to run
inputthe input to run over
outputthe tensor to store the output in

Definition at line 41 of file LArDLHelper.cc.

Here is the caller graph for this function:

◆ InitialiseInput()

void lar_dl_content::LArDLHelper::InitialiseInput ( const at::IntArrayRef  dimensions,
TorchInput tensor 
)
static

Create a torch input tensor.

Parameters
dimensionsthe size of each dimension of the tensor: pass as {a, b, c, d} for example
tensorthe tensor to be initialised

Definition at line 34 of file LArDLHelper.cc.

Here is the caller graph for this function:

◆ LoadModel()

StatusCode lar_dl_content::LArDLHelper::LoadModel ( const std::string &  filename,
LArDLHelper::TorchModel model 
)
static

Loads a deep learning model.

Parameters
filenamethe filename of the model to load
modelthe TorchModel in which to store the loaded model
Returns
STATUS_CODE_SUCCESS upon successful loading of the model. STATUS_CODE_FAILURE otherwise.

Definition at line 16 of file LArDLHelper.cc.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: