Skip to content

Commit 89635fa

Browse files
committed
[tmva][sofie] Apply fixes after rebaseing to master olha profiler branch
Fix also a compiler warning due to the name of ROperator.
1 parent 88f894b commit 89635fa

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

tmva/sofie/inc/TMVA/ROperator.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public:
3939
//virtual void Forward_blas() = 0;
4040
virtual ~ROperator(){}
4141

42-
std::string name = "UnnamedOperator";
43-
const std::string &GetOperatorName() { return name; };
42+
std::string fName = "UnnamedOperator";
43+
const std::string & Name() const { return fName; };
4444

4545
protected:
4646

tmva/sofie/src/RModelProfiler.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ void RModelProfiler::Generate()
142142

143143
for (size_t op_idx = 0; op_idx < fModel.fOperators.size(); ++op_idx) {
144144
const auto& op = fModel.fOperators[op_idx];
145-
gc += " // -- Profiling for operator " + op->name + " --\n";
145+
gc += " // -- Profiling for operator " + op->Name() + " --\n";
146146
gc += " tp_start = std::chrono::steady_clock::now();\n\n";
147147

148148
// Add the actual operator inference code
149149
gc += op->Generate(std::to_string(op_idx));
150150

151151
// Add the code to stop the timer and store the result
152-
gc += "\n fProfilingResults[\"" + op->name + "\"].push_back(\n";
152+
gc += "\n fProfilingResults[\"" + op->Name() + "\"].push_back(\n";
153153
gc += " std::chrono::duration_cast<std::chrono::duration<double, std::micro>>(\n";
154154
gc += " std::chrono::steady_clock::now() - tp_start).count());\n\n";
155155
}
@@ -159,7 +159,7 @@ void RModelProfiler::Generate()
159159
for (std::string const &name : fModel.GetOutputTensorNames()) {
160160
bool isIntermediate = fModel.fIntermediateTensorInfos.count(name) > 0;
161161
std::string n = isIntermediate ? std::to_string(ConvertShapeToLength(fModel.GetTensorShape(name)))
162-
: ConvertDynamicShapeToLength(fModel.GetDynamicTensorShape(name));
162+
: ConvertDimShapeToLength(fModel.GetDynamicTensorShape(name));
163163
gc += " FillOutput(tensor_" + name + ", output_tensor_" + name + ", " + n + ");\n";
164164
}
165165

tmva/sofie_parsers/src/RModelParser_ONNX.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,9 +800,9 @@ void RModelParser_ONNX::ParseONNXGraph(RModel & rmodel, const onnx::GraphProto &
800800
continue;
801801
}
802802
const auto &nodeproto = graph.node(nodesOrder[i]);
803-
op->name = nodeproto.name();
804-
if (op->name.empty()) {
805-
op->name = op_type + "_" + std::to_string(i);
803+
op->fName = nodeproto.name();
804+
if (op->fName.empty()) {
805+
op->fName = op_type + "_" + std::to_string(i);
806806
}
807807

808808
rmodel.AddOperator(std::move(op), node_order_exec++);

0 commit comments

Comments
 (0)