ROOT
master
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 "
Rtypes.h
"
34
#include "
TString.h
"
35
36
37
namespace
TMVA::Experimental::SOFIE::PyTorch
{
38
39
/// Parser function for translating PyTorch .pt model into a RModel object.
40
/// Accepts the file location of a PyTorch model, shapes and data-types of input tensors
41
/// and returns the equivalent RModel object.
42
RModel
Parse
(std::string
filepath
, std::vector<std::vector<size_t>>
inputShapes
, std::vector<ETensorType>
dtype
);
43
44
/// Overloaded Parser function for translating PyTorch .pt model into a RModel object.
45
/// Accepts the file location of a PyTorch model and the shapes of input tensors.
46
/// Builds the vector of data-types for input tensors and calls the `Parse()` function to
47
/// return the equivalent RModel object.
48
RModel
Parse
(std::string
filepath
, std::vector<std::vector<size_t>>
inputShapes
);
49
50
}
// namespace TMVA::Experimental::SOFIE::PyTorch
51
52
#endif
//TMVA_PYMVA_RMODELPARSER_PYTORCH
OperatorList.hxx
RModel.hxx
Rtypes.h
SOFIE_common.hxx
TString.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:312
TMVA::Experimental::SOFIE::RModel
Definition
RModel.hxx:12
TMVA::Experimental::SOFIE::PyTorch
Definition
RModelParser_PyTorch.h:37
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:381
Types.h
tmva
sofie_parsers
inc
TMVA
RModelParser_PyTorch.h
ROOT master - Reference Guide Generated on Mon Dec 1 2025 14:37:04 (GVA Time) using Doxygen 1.10.0