ATLAS Offline Software
OnnxOutput.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 This class is used to store the configuration for a ONNX output node.
5 */
6 
7 #ifndef OUTPUTNODE_H
8 #define OUTPUTNODE_H
9 
10 #include <onnxruntime_cxx_api.h>
11 #include "nlohmann/json.hpp"
12 #include <string>
13 
14 namespace FlavorTagDiscriminants {
15 
16 class OnnxOutput {
17 
18  public:
20 
21  /* constructor for OnnxModelVersion::V1 and higher */
22  OnnxOutput(const std::string& name,
23  ONNXTensorElementDataType type,
24  int rank);
25 
26  /* constructor for OnnxModelVersion::V0 */
27  OnnxOutput(const std::string& name,
28  ONNXTensorElementDataType type,
29  const std::string& name_in_model);
30 
31  const std::string name;
32  const std::string name_in_model;
34 
35  private:
36  OutputType getOutputType(ONNXTensorElementDataType type, int rank) const;
37  const std::string getName(const std::string& name, const std::string& model_name) const;
38 
39 }; // class OnnxOutput
40 
41 } // namespace FlavorTagDiscriminants
42 
43 #endif // OUTPUTNODE_H
FlavorTagDiscriminants::OnnxOutput::OutputType::VECCHAR
@ VECCHAR
FlavorTagDiscriminants
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
FlavorTagDiscriminants::OnnxOutput::OutputType::FLOAT
@ FLOAT
FlavorTagDiscriminants::OnnxOutput::name
const std::string name
Definition: OnnxOutput.h:31
FlavorTagDiscriminants::OnnxOutput::OutputType::VECFLOAT
@ VECFLOAT
FlavorTagDiscriminants::OnnxOutput::getOutputType
OutputType getOutputType(ONNXTensorElementDataType type, int rank) const
Definition: OnnxOutput.cxx:36
FlavorTagDiscriminants::OnnxOutput::type
const OutputType type
Definition: OnnxOutput.h:33
FlavorTagDiscriminants::OnnxOutput::name_in_model
const std::string name_in_model
Definition: OnnxOutput.h:32
FlavorTagDiscriminants::OnnxOutput
Definition: OnnxOutput.h:16
FlavorTagDiscriminants::OnnxOutput::getName
const std::string getName(const std::string &name, const std::string &model_name) const
Definition: OnnxOutput.cxx:27
FlavorTagDiscriminants::OnnxOutput::OnnxOutput
OnnxOutput(const std::string &name, ONNXTensorElementDataType type, int rank)
Definition: OnnxOutput.cxx:12
FlavorTagDiscriminants::OnnxOutput::OutputType
OutputType
Definition: OnnxOutput.h:19
FlavorTagDiscriminants::OnnxOutput::OutputType::UNKNOWN
@ UNKNOWN