rivet is hosted by Hepforge, IPPP Durham
Rivet 4.0.0
Rivet::RivetONNXrt Class Reference

Simple interface class to take care of basic ONNX networks. More...

#include <RivetONNXrt.hh>

Public Member Functions

 RivetONNXrt (const string &filename, const string &runname="RivetONNXrt")
 Constructor.
 
vector< vector< float > > compute (vector< vector< float > > &inputs) const
 Given a multi-node input vector, populate and return the multi-node output vector.
 
vector< float > compute (const vector< float > &inputs) const
 Given a single-node input vector, populate and return the single-node output vector.
 
bool hasKey (const std::string &key) const
 Method to check if key exists in network metatdata.
 
template<typename T , typename std::enable_if_t<!is_iterable_v< T >|is_cstring_v< T > > >
retrieve (const std::string &key) const
 
std::string retrieve (const std::string &key) const
 Template specialisation of retrieve for std::string.
 
template<typename T >
vector< T > retrieve (const std::string &key) const
 Overload of retrieve for vector<T>
 
template<typename T >
vector< T > retrieve (const std::string &key, const vector< T > &defaultreturn) const
 Overload of retrieve for vector<T>, with a default return.
 
std::string retrieve (const std::string &key, const std::string &defaultreturn) const
 
template<typename T , typename std::enable_if_t<!is_iterable_v< T >|is_cstring_v< T > > >
retrieve (const std::string &key, const T &defaultreturn) const
 
LoggetLog () const
 Logger.
 

Friends

std::ostream & operator<< (std::ostream &os, const RivetONNXrt &rort)
 Printing function for debugging.
 

Detailed Description

Simple interface class to take care of basic ONNX networks.

See analyses/examples/EXAMPLE_ONNX.cc for how to use this.

Note
A node is not a neuron but a single tensor of arbitrary dimension size

Member Function Documentation

◆ compute()

vector< vector< float > > Rivet::RivetONNXrt::compute ( vector< vector< float > > &  inputs) const
inline

Given a multi-node input vector, populate and return the multi-node output vector.

Check that number of input nodes matches what the model expects

Referenced by compute().

◆ retrieve() [1/2]

template<typename T , typename std::enable_if_t<!is_iterable_v< T >|is_cstring_v< T > > >
T Rivet::RivetONNXrt::retrieve ( const std::string &  key) const
inline

Method to retrieve value associated with key from network metadata and return value as type T

Referenced by retrieve().

◆ retrieve() [2/2]

template<typename T , typename std::enable_if_t<!is_iterable_v< T >|is_cstring_v< T > > >
T Rivet::RivetONNXrt::retrieve ( const std::string &  key,
const T &  defaultreturn 
) const
inline

Variation of retrieve method that falls back to defaultreturn if key cannot be found


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