#include <TorchScriptModule.h>
Public Member Functions | |
TorchScriptModule () | |
Construct using a filename which contains the source code in torchscript format. More... | |
TorchScriptModule (const std::string &filename) | |
Construct using a filename which contains the source code in torchscript format. More... | |
void | loadNeuralNetwork (const std::string &filename) |
Construct the neural network. More... | |
virtual torch::Tensor | forward (const torch::Tensor &x) override |
Overriding the forward substitution function for the neural network, unfortunately this cannot be const since it creates a graph in the background. More... | |
Definition at line 24 of file TorchScriptModule.h.
Moose::TorchScriptModule::TorchScriptModule | ( | ) |
Construct using a filename which contains the source code in torchscript format.
Definition at line 19 of file TorchScriptModule.C.
Moose::TorchScriptModule::TorchScriptModule | ( | const std::string & | filename | ) |
Construct using a filename which contains the source code in torchscript format.
filename | The name of the file that contains the neural net |
Definition at line 21 of file TorchScriptModule.C.
|
overridevirtual |
Overriding the forward substitution function for the neural network, unfortunately this cannot be const since it creates a graph in the background.
x | Input tensor for the evaluation |
Implements Moose::LibtorchNeuralNetBase.
Definition at line 38 of file TorchScriptModule.C.
void Moose::TorchScriptModule::loadNeuralNetwork | ( | const std::string & | filename | ) |
Construct the neural network.
Definition at line 24 of file TorchScriptModule.C.
Referenced by TorchScriptModule().