From 512217b1e9c004246297690557492ba3264d9f1a Mon Sep 17 00:00:00 2001 From: moneta Date: Mon, 17 Mar 2025 16:14:27 +0100 Subject: [PATCH] [tmva][sofie] Fix compilation warnings due to missing override - remove also some warning happening by variable re-declaration when not using Session in generated code - fix issue in operator Range when using verbose mode --- tmva/sofie/inc/TMVA/ROperator_Conv.hxx | 9 --------- tmva/sofie/inc/TMVA/ROperator_Elu.hxx | 2 +- tmva/sofie/inc/TMVA/ROperator_Range.hxx | 2 +- tmva/sofie/inc/TMVA/ROperator_Reduce.hxx | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/tmva/sofie/inc/TMVA/ROperator_Conv.hxx b/tmva/sofie/inc/TMVA/ROperator_Conv.hxx index 81e24c86ae7dc..72c5f6167f850 100644 --- a/tmva/sofie/inc/TMVA/ROperator_Conv.hxx +++ b/tmva/sofie/inc/TMVA/ROperator_Conv.hxx @@ -345,10 +345,6 @@ public: out << "\n//---- operator Conv " << OpName << "\n"; - // create first matrix with convolution kernels - if (!fUseSession) - out << SP << fType << " tensor_" << fNX << "_f[" << fShapeW[0] * fShapeW[1] * fAttrKernelShape[0] * fAttrKernelShape[1] << "] = {0};\n"; - // vectorize the (dilated)convolution kernels into a matrix // no need to transpose the matrix // to fix for 1d and 3d @@ -401,11 +397,6 @@ public: out << SP << "float " << OpName << "_alpha = 1.0;\n"; out << SP << "float " << OpName << "_beta = 0.0;\n"; - if (!fUseSession) { - out << SP << fType << " tensor_" << fNX << "_xcol[" - << fShapeX[1] * fAttrKernelShape[0] * fAttrKernelShape[1] * fAttrKernelShape[2] * oDepth * oHeight * oWidth - << "] = {0};\n"; - } // Loop on batch size out << SP << "for (size_t n = 0; n < " << bsize << "; n++) {\n"; diff --git a/tmva/sofie/inc/TMVA/ROperator_Elu.hxx b/tmva/sofie/inc/TMVA/ROperator_Elu.hxx index 720797113192d..eb0514408f45a 100644 --- a/tmva/sofie/inc/TMVA/ROperator_Elu.hxx +++ b/tmva/sofie/inc/TMVA/ROperator_Elu.hxx @@ -49,7 +49,7 @@ public: return ret; } - void Initialize(RModel& model){ + void Initialize(RModel& model) override { if (model.CheckIfTensorAlreadyExist(fNX) == false){ //input must be a graph input, or already initialized intermediate tensor throw std::runtime_error("TMVA SOFIE Elu Op Input Tensor is not found in model"); } diff --git a/tmva/sofie/inc/TMVA/ROperator_Range.hxx b/tmva/sofie/inc/TMVA/ROperator_Range.hxx index 23da4e7834b65..23dad1d4608f1 100644 --- a/tmva/sofie/inc/TMVA/ROperator_Range.hxx +++ b/tmva/sofie/inc/TMVA/ROperator_Range.hxx @@ -92,7 +92,7 @@ public: if (model.Verbose()) { std::cout << "Range -> output is " << fNOutput << " "; if (fIsOutputConstant) std::cout << ConvertDynamicShapeToString(fShape) << std::endl; - else std::cout << ConvertShapeToString(model.GetTensorShape(fNOutput)) << std::endl; + else std::cout << ConvertDynamicShapeToString(model.GetDynamicTensorShape(fNOutput)) << std::endl; } } diff --git a/tmva/sofie/inc/TMVA/ROperator_Reduce.hxx b/tmva/sofie/inc/TMVA/ROperator_Reduce.hxx index 1e4882e8f1726..4aad3b9d27c06 100644 --- a/tmva/sofie/inc/TMVA/ROperator_Reduce.hxx +++ b/tmva/sofie/inc/TMVA/ROperator_Reduce.hxx @@ -120,7 +120,7 @@ public: model.AddNeededStdLib("algorithm"); } - std::string Generate(std::string opName){ + std::string Generate(std::string opName) override { opName = "op_" + opName; if (fShapeX.empty() || fShapeY.empty()) { throw std::runtime_error("TMVA SOFIE Reduce Op called to Generate without being initialized first");