ROOT
v6-32
Reference Guide
Loading...
Searching...
No Matches
RModelParser_PyTorch.h
Go to the documentation of this file.
1
// @(#)root/tmva/pymva $Id$
2
// Author: Sanjiban Sengupta, 2021
3
4
/**********************************************************************************
5
* Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6
* Package: TMVA *
7
* *
8
* *
9
* Description: *
10
* Functionality for parsing a saved PyTorch .PT model into RModel object *
11
* *
12
* Authors (alphabetical): *
13
* Sanjiban Sengupta <sanjiban.sg@gmail.com> *
14
* *
15
* Copyright (c) 2021: *
16
* CERN, Switzerland *
17
* *
18
* *
19
* Redistribution and use in source and binary forms, with or without *
20
* modification, are permitted according to the terms listed in LICENSE *
21
* (see tmva/doc/LICENSE) *
22
**********************************************************************************/
23
24
25
#ifndef TMVA_SOFIE_RMODELPARSER_PYTORCH
26
#define TMVA_SOFIE_RMODELPARSER_PYTORCH
27
28
#include "
TMVA/RModel.hxx
"
29
#include "
TMVA/SOFIE_common.hxx
"
30
#include "
TMVA/Types.h
"
31
#include "
TMVA/OperatorList.hxx
"
32
33
#include "
TMVA/PyMethodBase.h
"
34
35
#include "
Rtypes.h
"
36
#include "
TString.h
"
37
38
39
namespace
TMVA
{
40
namespace
Experimental{
41
namespace
SOFIE{
42
namespace
PyTorch{
43
44
/// Parser function for translating PyTorch .pt model into a RModel object.
45
/// Accepts the file location of a PyTorch model, shapes and data-types of input tensors
46
/// and returns the equivalent RModel object.
47
RModel
Parse
(std::string
filepath
,std::vector<std::vector<size_t>>
inputShapes
, std::vector<ETensorType>
dtype
);
48
49
/// Overloaded Parser function for translating PyTorch .pt model into a RModel object.
50
/// Accepts the file location of a PyTorch model and the shapes of input tensors.
51
/// Builds the vector of data-types for input tensors and calls the `Parse()` function to
52
/// return the equivalent RModel object.
53
RModel
Parse
(std::string
filepath
,std::vector<std::vector<size_t>>
inputShapes
);
54
55
}
//PyTorch
56
}
//SOFIE
57
}
//Experimental
58
}
//TMVA
59
60
#endif
//TMVA_PYMVA_RMODELPARSER_PYTORCH
OperatorList.hxx
PyMethodBase.h
RModel.hxx
Rtypes.h
SOFIE_common.hxx
TString.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TMVA::Experimental::SOFIE::RModel
Definition
RModel.hxx:12
TMVA::Experimental::SOFIE::PyTorch::Parse
RModel Parse(std::string filepath, std::vector< std::vector< size_t > > inputShapes, std::vector< ETensorType > dtype)
Parser function for translating PyTorch .pt model into a RModel object.
Definition
RModelParser_PyTorch.cxx:357
TMVA
create variable transformations
Definition
GeneticMinimizer.h:22
Types.h
tmva
pymva
inc
TMVA
RModelParser_PyTorch.h
ROOT v6-32 - Reference Guide Generated on Mon Feb 24 2025 14:13:13 (GVA Time) using Doxygen 1.10.0