#include "FlavorTagInference/SaltModelTriton.h"
#include "FlavorTagInference/SaltModelGraphConfig.h"
#include "FlavorTagInference/SaltModelOutput.h"
#include "CxxUtils/checker_macros.h"
#include <onnxruntime_cxx_api.h>
#include <stdexcept>
#include <tuple>
#include <set>
#include <memory>
Go to the source code of this file.
|
| | FlavorTagInference |
| | This file contains "getter" functions used for accessing tagger inputs from the EDM.
|
| |
|
| template<typename T > |
| bool | prepareInput (const std::string &name, const std::vector< int64_t > &shape, const std::vector< T > &data, std::vector< std::shared_ptr< tc::InferInput >> &inputs) |
| |
| template<typename T > |
| bool | extractOutput (const std::string &name, const std::shared_ptr< tc::InferResult > &result, std::vector< T > &outputVec) |
| |
◆ extractOutput()
template<typename T >
| bool extractOutput |
( |
const std::string & |
name, |
|
|
const std::shared_ptr< tc::InferResult > & |
result, |
|
|
std::vector< T > & |
outputVec |
|
) |
| |
Definition at line 55 of file SaltModelTriton.cxx.
59 const uint8_t* rawData =
nullptr;
67 std::cerr <<
"Unable to get raw output for: " +
name << std::endl;
71 outputVec.resize(
size /
sizeof(
T));
72 std::memcpy(outputVec.data(), rawData,
size);
◆ prepareInput()
template<typename T >
| bool prepareInput |
( |
const std::string & |
name, |
|
|
const std::vector< int64_t > & |
shape, |
|
|
const std::vector< T > & |
data, |
|
|
std::vector< std::shared_ptr< tc::InferInput >> & |
inputs |
|
) |
| |
Definition at line 22 of file SaltModelTriton.cxx.
28 tc::InferInput* rawInputPtr =
nullptr;
33 std::cerr <<
"Unable to create input: " +
name << std::endl;
42 std::shared_ptr<tc::InferInput>
input(rawInputPtr);
44 data.size() *
sizeof(
T));
46 std::cerr <<
"Unable to set input data for: " +
name << std::endl;