17#ifndef TFCSONNXHANDLER_H
18#define TFCSONNXHANDLER_H
26#include <onnxruntime_cxx_api.h>
142 virtual void print(std::ostream &strm)
const override;
236#if ORT_API_VERSION > 11
243 std::vector<Ort::AllocatedStringPtr> m_storeInputNodeNames;
260#if ORT_API_VERSION > 11
267 std::vector<Ort::AllocatedStringPtr> m_storeOutputNodeNames;
300 template <
typename Tin,
typename Tout>
313 OrtArenaAllocator, OrtMemTypeDefault);
ClassDefOverride(TFCSONNXHandler, 1)
Do not persistify.
void readSerializedSession()
Do not persistify.
virtual void print(std::ostream &strm) const override
Write a short description of this net to the string stream.
VNetworkBase()
VNetworkBase default constructor.
std::vector< const char * > m_inputNodeNames
names that index the input nodes
void setupPersistedVariables() override
Perform actions that prep data to create the net.
NetworkOutputs computeTemplate(NetworkInputs const &input)
Do not persistify.
std::vector< char > getSerializedSession(const std::string &tree_name=m_defaultTreeName)
Return content of the proto (.onnx) file in memory.
std::vector< std::string > getOutputLayers() const override
List the names of the outputs.
std::vector< const char * > m_outputNodeNames
Do not persistify.
NetworkOutputs compute(NetworkInputs const &inputs) const override
Function to pass values to the network.
std::vector< std::vector< int64_t > > m_outputNodeDims
Do not persistify.
std::unique_ptr< Ort::Session > m_session
The network session itself.
Ort::MemoryInfo m_memoryInfo
Do not persistify.
std::vector< std::string > m_outputLayers
Do not persistify.
TFCSONNXHandler(const std::string &inputFile)
TFCSONNXHandler constructor.
void setupNet() override
Perform actions that prepare network for use.
std::vector< char > readBytesFromTTree(TTree &tree)
Retrieve the content of the proto file from a TTree.
std::vector< int64_t > m_outputNodeSize
Do not persistify.
std::function< NetworkOutputs(NetworkInputs)> m_computeLambda
computeTemplate with apropreate types selected.
void writeNetToTTree(TTree &tree) override
Save the network to a TTree.
void deleteAllButNet() override
Get rid of any memory objects that arn't needed to run the net.
void writeBytesToTTree(TTree &tree, const std::vector< char > &bytes)
Write the content of the proto file to a TTree as a branch.
std::vector< char > m_bytes
Content of the proto file.
std::vector< std::vector< int64_t > > m_inputNodeDims
Do not persistify.
static const std::string m_defaultTreeName
Default name for the TTree to save in.
VNetworkBase()
VNetworkBase default constructor.
std::map< std::string, std::map< std::string, double > > NetworkInputs
Format for network inputs.
virtual void writeNetToTTree(TTree &tree)=0
Save the network to a TTree.
std::map< std::string, double > NetworkOutputs
Format for network outputs.