Skip to content

Commit dd1159f

Browse files
committed
remove adding broadcasting tensors to memory optimization
1 parent 6a1f90c commit dd1159f

File tree

9 files changed

+0
-12
lines changed

9 files changed

+0
-12
lines changed

tmva/sofie/inc/TMVA/ROperator_BasicBinary.hxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ public:
115115
} else {
116116
// Add an intermediate tensor for broadcasting A
117117
model.AddIntermediateTensor(fNBroadcastedA, model.GetTensorType(fNA), fShapeY);
118-
fOutputTensorNames.emplace_back(fNBroadcastedA);
119118
}
120119
}
121120
// Broadcast B to Y
@@ -136,7 +135,6 @@ public:
136135
} else {
137136
// Add an intermediate tensor for broadcasting B
138137
model.AddIntermediateTensor(fNBroadcastedB, model.GetTensorType(fNB), fShapeY);
139-
fOutputTensorNames.emplace_back(fNBroadcastedB);
140138
}
141139
}
142140
} else {

tmva/sofie/inc/TMVA/ROperator_BasicNary.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public:
137137
std::string name = "Broadcasted" + fNInputs[i];
138138
model.AddIntermediateTensor(name, model.GetTensorType(fNInputs[0]), fShapeY);
139139
fNBroadcastedInputs.emplace_back("tensor_" + name);
140-
fOutputTensorNames.emplace_back(name);
141140
} else {
142141
fNBroadcastedInputs.emplace_back("tensor_" + fNInputs[i]);
143142
}

tmva/sofie/inc/TMVA/ROperator_Comparision.hxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ public:
123123
// Add an intermediate tensor for broadcasting A
124124
fNBroadcastedX1 = "Broadcasted" + fNX1;
125125
model.AddIntermediateTensor(fNBroadcastedX1, model.GetTensorType(fNX1), fShapeY);
126-
fOutputTensorNames.emplace_back(fNBroadcastedX1);
127126
}
128127
}
129128
// Broadcast B to Y
@@ -140,7 +139,6 @@ public:
140139
// Add an intermediate tensor for broadcasting B
141140
fNBroadcastedX2 = "Broadcasted" + fNX2;
142141
model.AddIntermediateTensor(fNBroadcastedX2, model.GetTensorType(fNX2), fShapeY);
143-
fOutputTensorNames.emplace_back(fNBroadcastedX2);
144142
}
145143
}
146144
} else {

tmva/sofie/inc/TMVA/ROperator_Conv.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ public:
263263
// we need to add a new intermediate tensor for broadcasted bias tensor
264264
fNB2 = fNB + "bcast";
265265
model.AddIntermediateTensor(fNB2, model.GetTensorType(fNB), targetShape);
266-
fOutputTensorNames.push_back(fNB2);
267266
}
268267
}
269268
}

tmva/sofie/inc/TMVA/ROperator_ConvTranspose.icc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ void ROperator_ConvTranspose<T>::Initialize(RModel& model){
167167
// we need to add a new intermediate tensor for broadcasted bias tensor
168168
fNBroadcastedB = "Broadcasted" + fNB;
169169
model.AddIntermediateTensor(fNBroadcastedB, model.GetTensorType(fNB), fShapeY);
170-
fOutputTensorNames.emplace_back(fNBroadcastedB);
171170
}
172171
}
173172
else {

tmva/sofie/inc/TMVA/ROperator_Gemm.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ namespace SOFIE{
233233
// In case of session add broadcasting code in Session constructor and in GenerateInitCode
234234
// we need to add a new intermediate tensor for broadcasted bias tensor
235235
fNC2 = fNC + "bcast";
236-
fOutputTensorNames.emplace_back(fNC2);
237236
if (!fIsDynamic) {
238237
model.AddIntermediateTensor(fNC2, model.GetTensorType(fNC), shapeY);
239238
}

tmva/sofie/inc/TMVA/ROperator_LayerNormalization.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ public:
136136
if (isDynamic || lengthB < static_cast<size_t>(std::stoi(fLength))) {
137137
fNBroadcastedB = "Broadcasted" + fNB;
138138
model.AddIntermediateTensor(fNBroadcastedB, ConvertStringToType(fType), fShapeX);
139-
fOutputTensorNames.emplace_back(fNBroadcastedB);
140139
}
141140
}
142141
model.AddNeededStdLib("cmath");

tmva/sofie/inc/TMVA/ROperator_Where.hxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public:
113113
} else {
114114
// Add an intermediate tensor for broadcasting A
115115
model.AddIntermediateTensor(fNBroadcastedA, model.GetTensorType(fNA), fShapeY);
116-
fOutputTensorNames.push_back(fNBroadcastedA);
117116
}
118117
}
119118
// Broadcast B to Y
@@ -130,7 +129,6 @@ public:
130129
} else {
131130
// Add an intermediate tensor for broadcasting B
132131
model.AddIntermediateTensor(fNBroadcastedB, model.GetTensorType(fNB), fShapeY);
133-
fOutputTensorNames.push_back(fNBroadcastedB);
134132
}
135133
}
136134
// Broadcast C to Y

tmva/sofie/src/RModel.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,6 @@ void RModel::HeadInitializedTensors(std::string name, int n_print) {
13811381
void RModel::OutputGenerated(std::string filename, bool append) {
13821382

13831383
RModel_Base::OutputGenerated(filename, append);
1384-
13851384
// write weights in a text file
13861385
if (fUseWeightFile) {
13871386
if (!filename.empty()) {

0 commit comments

Comments
 (0)