Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RInferenceUtils.hxx
Go to the documentation of this file.
1#ifndef TMVA_RINFERENCEUTILS
2#define TMVA_RINFERENCEUTILS
3
4#include <utility> // std::forward, std::index_sequence
5
6namespace TMVA {
7namespace Experimental {
8
9namespace Internal {
10
11/// Compute helper
12template <typename I, typename T, typename F>
14
15template <std::size_t... N, typename T, typename F>
16class ComputeHelper<std::index_sequence<N...>, T, F> {
17 template <std::size_t Idx>
18 using AlwaysT = T;
19 F fFunc;
20
21public:
22 ComputeHelper(F &&f) : fFunc(std::forward<F>(f)) {}
23 auto operator()(AlwaysT<N>... args) -> decltype(fFunc.Compute({args...})) {
24 return fFunc.Compute({args...});
25 }
26};
27
28} // namespace Internal
29
30/// Helper to pass TMVA model to RDataFrame.Define nodes
31template <std::size_t N, typename T, typename F>
33{
34 return Internal::ComputeHelper<std::make_index_sequence<N>, T, F>(std::forward<F>(f));
35}
36
37} // namespace Experimental
38} // namespace TMVA
39
40#endif // TMVA_RINFERENCEUTILS
#define f(i)
Definition RSha256.hxx:104
#define N
TRObject operator()(const T1 &t1) const
#define F(x, y, z)
void forward(const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
apply the weights (and functions) in forward direction of the DNN
auto Compute(F &&f) -> Internal::ComputeHelper< std::make_index_sequence< N >, T, F >
Helper to pass TMVA model to RDataFrame.Define nodes.
create variable transformations