ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
FlavorTagInference
FlavorTagInference
SaltModelOutput.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 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 FLAVORTAGDISCRIMINANTS_SALTMODELOUTPUT_H
8
#define FLAVORTAGDISCRIMINANTS_SALTMODELOUTPUT_H
9
10
#include <onnxruntime_cxx_api.h>
11
#include "nlohmann/json.hpp"
12
#include <string>
13
14
namespace
FlavorTagInference
{
15
16
class
SaltModelOutput
{
17
18
public
:
19
enum class
OutputType
{
UNKNOWN
,
FLOAT
,
VECCHAR
,
VECFLOAT
,
VECINT
,
VECTRUNCFLOAT
};
20
21
/* constructor for SaltModelVersion::V1 and higher */
22
SaltModelOutput
(
const
std::string&
name
,
23
ONNXTensorElementDataType
type
,
24
int
rank);
25
26
/* constructor for SaltModelVersion::V0 */
27
SaltModelOutput
(
const
std::string&
name
,
28
ONNXTensorElementDataType
type
,
29
const
std::string&
name_in_model
);
30
31
/* constructor for parametric reduced-precision float32 (VECTRUNCFLOAT with explicit E,M) */
32
SaltModelOutput
(
const
std::string&
name
,
33
OutputType
type
,
34
float
scale
,
35
int
exp_bits
,
36
int
man_bits
);
37
38
const
std::string
name
;
39
const
std::string
name_in_model
;
40
const
OutputType
type
;
41
const
float
scale
{1.0f};
42
int
exp_bits
{8};
// exponent bits for VECTRUNCFLOAT (default: bf16-equivalent)
43
int
man_bits
{7};
// mantissa bits for VECTRUNCFLOAT (default: bf16-equivalent)
44
45
private
:
46
OutputType
getOutputType
(ONNXTensorElementDataType
type
,
int
rank)
const
;
47
static
const
std::string
getName
(
const
std::string&
name
,
const
std::string& model_name);
48
49
};
// class SaltModelOutput
50
51
}
// namespace FlavorTagInference
52
53
#endif
// FLAVORTAGDISCRIMINANTS_SALTMODELOUTPUT_H
FlavorTagInference::SaltModelOutput::man_bits
int man_bits
Definition
SaltModelOutput.h:43
FlavorTagInference::SaltModelOutput::getOutputType
OutputType getOutputType(ONNXTensorElementDataType type, int rank) const
Definition
SaltModelOutput.cxx:49
FlavorTagInference::SaltModelOutput::type
const OutputType type
Definition
SaltModelOutput.h:40
FlavorTagInference::SaltModelOutput::name
const std::string name
Definition
SaltModelOutput.h:38
FlavorTagInference::SaltModelOutput::scale
const float scale
Definition
SaltModelOutput.h:41
FlavorTagInference::SaltModelOutput::SaltModelOutput
SaltModelOutput(const std::string &name, ONNXTensorElementDataType type, int rank)
Definition
SaltModelOutput.cxx:12
FlavorTagInference::SaltModelOutput::getName
static const std::string getName(const std::string &name, const std::string &model_name)
Definition
SaltModelOutput.cxx:40
FlavorTagInference::SaltModelOutput::name_in_model
const std::string name_in_model
Definition
SaltModelOutput.h:39
FlavorTagInference::SaltModelOutput::exp_bits
int exp_bits
Definition
SaltModelOutput.h:42
FlavorTagInference::SaltModelOutput::OutputType
OutputType
Definition
SaltModelOutput.h:19
FlavorTagInference::SaltModelOutput::OutputType::VECTRUNCFLOAT
@ VECTRUNCFLOAT
Definition
SaltModelOutput.h:19
FlavorTagInference::SaltModelOutput::OutputType::VECCHAR
@ VECCHAR
Definition
SaltModelOutput.h:19
FlavorTagInference::SaltModelOutput::OutputType::UNKNOWN
@ UNKNOWN
Definition
SaltModelOutput.h:19
FlavorTagInference::SaltModelOutput::OutputType::VECINT
@ VECINT
Definition
SaltModelOutput.h:19
FlavorTagInference::SaltModelOutput::OutputType::VECFLOAT
@ VECFLOAT
Definition
SaltModelOutput.h:19
FlavorTagInference::SaltModelOutput::OutputType::FLOAT
@ FLOAT
Definition
SaltModelOutput.h:19
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition
CaloClusterLoader.h:27
type
Generated on
for ATLAS Offline Software by
1.17.0