ATLAS Offline Software
Loading...
Searching...
No Matches
IAthInferenceTool.h
Go to the documentation of this file.
1// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2#ifndef AthInfer_IAthInferenceTool_H
3#define AthInfer_IAthInferenceTool_H
4
5#include "AsgTools/IAsgTool.h"
6
7#include <vector>
8#include <string>
9#include <variant>
10#include <map>
11#include <cstdint>
12
13namespace AthInfer {
14
15 using DataVariant = std::variant<std::vector<float>, std::vector<int64_t>, std::vector<uint8_t> >;
16 using InferenceData = std::pair<std::vector<int64_t>, DataVariant>;
17 using InputDataMap = std::map<std::string, InferenceData>;
18 using OutputDataMap = std::map<std::string, InferenceData>;
19
20 // class asg::IAsgTool
21 // Interface class for running inferences in Athena.
22 // @author Xiangyang Ju <xju@cern.ch>
23
24 class IAthInferenceTool : virtual public asg::IAsgTool
25 {
27 public:
28
29 // Run inference with multiple inputs and multiple outputs
30 virtual StatusCode inference(InputDataMap& inputData, OutputDataMap& outputData) const = 0;
31 };
32}
33
34#endif
#define ASG_TOOL_INTERFACE(CLASSNAME)
virtual StatusCode inference(InputDataMap &inputData, OutputDataMap &outputData) const =0
Base class for the dual-use tool interface classes.
Definition IAsgTool.h:41
std::map< std::string, InferenceData > OutputDataMap
std::variant< std::vector< float >, std::vector< int64_t >, std::vector< uint8_t > > DataVariant
std::map< std::string, InferenceData > InputDataMap
std::pair< std::vector< int64_t >, DataVariant > InferenceData