Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROperator_Pool.hxx
Go to the documentation of this file.
1#ifndef TMVA_SOFIE_ROPERATOR_POOL
2#define TMVA_SOFIE_ROPERATOR_POOL
3
5#include "TMVA/ROperator.hxx"
6#include "TMVA/RModel.hxx"
7
8#include <memory>
9#include <sstream>
10#include <algorithm>
11#include <stdexcept>
12#include <vector>
13#include <cassert>
14
15namespace TMVA {
16namespace Experimental {
17namespace SOFIE {
18
20 // structure that contains Pool attribute
21 std::string auto_pad = "NOTSET";
22 int ceil_mode = 0;
23 int count_include_pad = 0; // not for MaxPool
24 int storage_order = 0; // not for AveragePool
25 std::vector<size_t> dilations; // not for AveragePool
26 std::vector<size_t> kernel_shape;
27 std::vector<size_t> pads;
28 std::vector<size_t> strides;
29};
30
32
33template<typename T>
35{
36
37private:
38
40
44 std::string fAttrAutopad;
45 std::vector<size_t> fAttrDilations;
46 std::vector<size_t> fAttrKernelShape;
47 std::vector<size_t> fAttrPads;
48 std::vector<size_t> fAttrStrides;
49
50 std::string fNX;
51 std::string fNY;
52
53 std::vector<size_t> fShapeX;
54 std::vector<size_t> fShapeY;
55
56 std::string fType;
57
58 size_t fDim; // dimension of the MaxPool
59 bool fUseSession = false;
60
61public:
62
63 std::string Name() {
64 if (fPoolMode == AveragePool) return "AveragePool";
65 if (fPoolMode == MaxPool) return "MaxPool";
66 return "Invalid";
67 }
68
70
72 : fPoolMode(mode), fAttrCeilMode(attr.ceil_mode), fAttrCountIncludePad(attr.count_include_pad),
73 fAttrStorageOrder(attr.storage_order), fAttrAutopad(attr.auto_pad),
74 fAttrDilations(attr.dilations), fAttrKernelShape(attr.kernel_shape), fAttrPads(attr.pads), fAttrStrides(attr.strides),
75 fNX(UTILITY::Clean_name(nameX)), fNY(UTILITY::Clean_name(nameY))
76 {
77 if(std::is_same<T, float>::value) {
78 fType = "float";
79 } else {
80 throw
81 std::runtime_error("TMVA SOFIE Encountered unsupported type parsing a Pool operator");
82 }
85 }
86
87 // return input type (defined abstract in ROperator class )
88 std::vector<ETensorType> TypeInference(std::vector<ETensorType> input) override {
89 // only one input in Pool operators
90 return input;
91 }
92
93 // function returning output shape given input
94 std::vector<std::vector<size_t>> ShapeInference(std::vector<std::vector<size_t>> input) override {
95 // shape of pooling input has to be (according to ONNX): NxCxHxW
96 // Where N is batch size, C : input channels, H : input height, W = input width
97 // or it can be [N, C, F1,F2,....FN] . Minimum dimension is 3
98 if (input.size() != 1 ) {
99 throw std::runtime_error("TMVA SOFIE" + Name() + "Op Shape inference need 1 input tensor");
100 }
101 if (input[0].size() < 3) {
102 throw std::runtime_error("TMVA SOFIE" + Name() + "Op Shape inference only accept tensor with at least 3 dimensions");
103 }
104 // support only input tensors with dim = 3,4,5
105 if (input[0].size() < 3 || input[0].size() > 5) {
106 throw std::runtime_error("TMVA SOFIE" + Name() + "Op : tensors with dimension " + std::to_string(input[0].size()) + " are not yet supported");
107 }
108
109 if (input[0].size() -2 != fDim) {
110 throw
111 std::runtime_error("TMVA SOFIE Pool Op Shape inference - invalid inputs ");
112 }
113 // kernel shape
114 size_t k1 = ((fAttrKernelShape.empty())? input[0][2] : fAttrKernelShape[0]);
115 size_t k2 = (fDim > 1) ? ((fAttrKernelShape.empty()) ? input[0][3] : fAttrKernelShape[1]) : 1;
116 size_t k3 = (fDim > 2) ? ((fAttrKernelShape.empty()) ? input[0][4] : fAttrKernelShape[2]) : 1;
117
118
119 size_t i1 = (fDim > 1) ? ((fDim > 2) ? 3 : 2) : 1;
120 size_t i2 = (fDim > 2) ? 4 : 3;
121 size_t i3 = 5;
122
123 if (fAttrDilations.empty()) {
124 fAttrDilations = {1, 1, 1};
125 }
126 fAttrDilations.resize(3);
127 if (fDim < 3) {
128 fAttrDilations.resize(3, 1);
129 }
130 // Shape of the kernel
131 fAttrKernelShape = {k1 + (fAttrDilations[0] - 1) * (k1 - 1),
132 k2 + (fAttrDilations[1] - 1) * (k2 - 1),
133 k3 + (fAttrDilations[2] - 1) * (k3 - 1)};
134
135 if (fAttrStrides.empty()) {
136 fAttrStrides = {1, 1, 1};
137 }
138 if (fDim < 3)
139 fAttrStrides.resize(3, 1);
140
141 if (fAttrAutopad == "NOTSET") {
142 // in auto_pad is NOTSET then fAttrPads should have been set or default zero is used
143 if (fAttrPads.empty()) {
144 fAttrPads = {0, 0, 0, 0, 0, 0};
145 }
146 } else if (fAttrAutopad == "SAME_UPPER" || fAttrAutopad == "SAME_LOWER") {
147 // ONNX SAME padding: total_pad = max(0, (ceil(in/stride)-1)*stride + kernel - in)
148 // SAME_UPPER places extra padding at end, SAME_LOWER at beginning
149 fAttrPads.assign(6, 0);
150 for (size_t d = 0; d < fDim; ++d) {
151 size_t inSize = input[0][d + 2];
152 size_t stride_d = fAttrStrides[d];
153 size_t outSize = (inSize + stride_d - 1) / stride_d;
154 int totalPad = std::max(0, (int)((outSize - 1) * stride_d + fAttrKernelShape[d]) - (int)inSize);
155 if (fAttrAutopad == "SAME_UPPER") {
156 fAttrPads[d] = (size_t)(totalPad / 2);
157 fAttrPads[d + fDim] = (size_t)(totalPad - totalPad / 2);
158 } else {
159 fAttrPads[d] = (size_t)(totalPad - totalPad / 2);
160 fAttrPads[d + fDim] = (size_t)(totalPad / 2);
161 }
162 }
163 } else if (fAttrAutopad != "VALID") {
164 throw
165 std::runtime_error("TMVA SOFIE" + Name() + "Op invalid Autopad value : " + fAttrAutopad);
166 }
167 // to be sure pad is vector of size 6
168 if (fDim < 3) fAttrPads.resize(6, 0);
169
170 size_t input1 = input[0][2];
171 size_t input2 = (fDim > 1) ? input[0][3] : 1;
172 size_t input3 = (fDim > 2) ? input[0][4] : 1;
173
174 // use ceiling division when ceil_mode=1, floor otherwise. With ceil_mode the rounding up can add
175 // a window that starts past the end of the input (i.e. entirely in the right padding or in the
176 // overhang region); ONNX ignores such a window, so clip to the number of valid window starts.
177 auto poolOutDim = [this](size_t in, size_t padBegin, size_t padEnd, size_t kern, size_t stride) -> size_t {
178 size_t n = in + padBegin + padEnd - kern;
179 if (!fAttrCeilMode)
180 return n / stride + 1;
181 return std::min((n + stride - 1) / stride, (in - 1 + padBegin) / stride) + 1;
182 };
183
185
186 size_t batch_size = input[0][0]; // first element in input tensor
187 size_t output_channels = input[0][1]; // first element in output tensor
188
189 std::vector<std::vector<size_t>> ret({{ batch_size, output_channels, output1 }});
190
191 if (fDim == 1)
192 return ret;
193
195 // output is N x C x OH x OW
196 ret[0].push_back(output2);
197 if (fDim == 2)
198 return ret;
199
201
202 // output is N x C x OH x OW x OD
203 ret[0].push_back(output3);
204 return ret;
205 }
206
207 void Initialize(RModel& model) override {
208
209 fUseSession = model.UseSession();
210
211 if (!model.CheckIfTensorAlreadyExist(fNX)) {
212 throw
213 std::runtime_error("TMVA SOFIE Pool op Input Tensor " + fNX + " is not found in model");
214 }
215 fShapeX = model.GetTensorShape(fNX);
216 if (fShapeX.size() < 3 || fShapeX.size() > 5) {
217 std::cout << fNX << " : " << ConvertShapeToString(fShapeX) << std::endl;
218 throw
219 std::runtime_error("TMVA SOFIE Pool Op input data tensor" + fNX + " is not of 3,4 or 5 dimensions");
220 }
221 fDim = fShapeX.size() - 2;
222 // case of GlobalAveragePool. It is a pool case with kernel shape == image shape
225 fAttrKernelShape.resize(3);
227 if (fDim > 1)
229 if (fDim > 2)
231 fAttrAutopad = "VALID";
232 fAttrPads = {0, 0, 0, 0, 0, 0 };
233 assert(fAttrStrides.empty());
234 }
235 // find shape of Y and add it in the list of intermediate tensors
238
239 // need cmath for INFINITY when using MaxPool
240 if (fPoolMode == MaxPool) model.AddNeededStdLib("cmath");
241
242 }
243
244 std::string GenerateInitCode() override {
245 std::stringstream out;
246 return out.str();
247 }
248
249 // generate code for Session data members (e.g. internal vectors)
250 virtual std::string GenerateSessionMembersCode(std::string opName) override {
251 opName = "op_" + opName;
252 std::stringstream out;
253 // input matrix padded with zero
254 if(fDim == 1){
255 out << "std::vector<" << fType << "> fVec_" << opName << "_xpad = std::vector<" << fType << ">("
256 << fShapeX[1] * (fShapeX[2] + fAttrPads[0] + fAttrPads[2]) << ");\n";
257 }
258 else if(fDim == 2){
259 out << "std::vector<" << fType << "> fVec_" << opName << "_xpad = std::vector<" << fType << ">("
260 << fShapeX[1] * (fShapeX[2] + fAttrPads[0] + fAttrPads[2]) * (fShapeX[3] + fAttrPads[1] + fAttrPads[3])
261 << ");\n";
262 }
263 else{ //dim is 3D
264 out << "std::vector<" << fType << "> fVec_" << opName << "_xpad = std::vector<" << fType << ">("
265 << fShapeX[1] * (fShapeX[2] + fAttrPads[0] + fAttrPads[2]) * (fShapeX[3] + fAttrPads[1] + fAttrPads[3]) *
266 (fShapeX[4] + fAttrPads[2] + fAttrPads[4]) << ");\n";
267 }
268
269 return out.str();
270 }
271
272 std::string Generate(std::string OpName) override {
273 OpName = "op_" + OpName;
274
275 if (fShapeX.empty() || fShapeY.empty()) {
276 throw std::runtime_error("TMVA SOFIE Pool Op called to Generate without being initialized first");
277 }
278
279 std::stringstream out;
280
281 out << "\n//---- operator " << Name() << " " << OpName << "\n";
282 out << "{\n"; // create a new scope to avoid name clash
283
284 assert(fShapeX[0] == fShapeY[0]);
285 assert(fShapeX[1] == fShapeY[1]);
286 assert(fAttrPads.size() == 6);
287 assert(fAttrKernelShape.size() == 3);
288 // A window must start inside the input: with ceil_mode the loop bound below can otherwise run one
289 // window too far, which ONNX ignores. This mirrors the clipping done in ShapeInference.
290 auto clipToInput = [this](int upper, size_t size) {
291 return (fAttrCeilMode && upper > (int)size) ? (int)size : upper;
292 };
293 // find lower bounds of filtered area
294 int hmin = - fAttrPads[0]; // minimum lower bound value of filter area
295 // use stride instead of 1 when ceil_mode=1, so the loop covers the extra partial window
297 fShapeX[2]);
298 int wmin,wmax,dmin,dmax;
299
300 if(fDim >= 2){
301 wmin = -fAttrPads[1]; // minimum lower bound value of filter area
303 fShapeX[3]);
304 }
305 else{
306 wmin=1;
307 wmax=1;
308 }
309 if(fDim == 3){
310 dmin = -fAttrPads[2]; // minimum lower bound value of filter area
312 fShapeX[4]);
313 }
314 else{
315 dmin=1;
316 dmax=1;
317 }
318 out << SP << "constexpr int hsize = " << fShapeX[2] << ";\n";
319 out << SP << "constexpr int hmin = " << hmin << ";\n";
320 out << SP << "constexpr int hmax = " << hmax << ";\n";
321 out << SP << "constexpr int kh = " << fAttrKernelShape[0] << ";\n";
322 if (fDim > 1) {
323 size_t wsize = fShapeX[3];
324 out << SP << "constexpr int wsize = " << wsize << ";\n";
325 out << SP << "constexpr int wmin = " << wmin << ";\n";
326 out << SP << "constexpr int wmax = " << wmax << ";\n";
327 out << SP << "constexpr int kw = " << fAttrKernelShape[1] << ";\n";
328 if (fDim > 2) {
329 size_t dsize = fShapeX[4];
330 out << SP << "constexpr int dsize = " << dsize << ";\n";
331 out << SP << "constexpr int dwsize = " << dsize*wsize << ";\n"; // hstride
332 out << SP << "constexpr int dmin = " << dmin << ";\n";
333 out << SP << "constexpr int dmax = " << dmax << ";\n";
334 out << SP << "constexpr int kd = " << fAttrKernelShape[2] << ";\n";
335 }
336 }
337
338
339 bool doPadding = false;
340 for ( auto & e : fAttrPads)
341 doPadding |= (e > 0);
342
343 // An AveragePool window can cover fewer cells than the kernel area either because it overlaps the
344 // padding region or because ceil_mode lets the last window overhang the input. In both cases the
345 // divisor has to be computed per window instead of being the constant kernel area.
347 // Number of cells the window starting at "var" covers along one dimension: the kernel extent
348 // clipped to [0, size) when count_include_pad = 0, and to the padded input [-padBegin, size +
349 // padEnd) otherwise. The lower bound needs no clipping in the latter case, since "var" starts at
350 // -padBegin. Note that the cells the window overhangs past the padded input are never counted.
351 auto windowExtent = [this](const std::string &var, const std::string &kern, size_t size, size_t padEnd) {
352 std::string hi = std::to_string(fAttrCountIncludePad ? size + padEnd : size);
353 std::string lo = fAttrCountIncludePad ? var : "(" + var + " > 0 ? " + var + " : 0)";
354 return "((" + var + " + " + kern + " < " + hi + " ? " + var + " + " + kern + " : " + hi + ")"
355 " - " + lo + ")";
356 };
357
358
359 if(fDim==1){
360 // loop on batches and channels
361 out << SP << "size_t outIndex = 0;\n";
362 out << SP << "for (size_t n = 0; n < " << fShapeX[0]*fShapeX[1] << "; n++) {\n";
363 out << SP << SP << "size_t inputOffset = n*" << fShapeX[2] << ";\n";
364 out << SP << SP << "for (int i = hmin; i < hmax; i+=" << fAttrStrides[0] << ") {\n";
365 // loop on elements of filter region to compute maximum
366 if (fPoolMode == MaxPool)
367 out << SP << SP << SP << SP << "float value = -INFINITY;\n";
368 else if (fPoolMode == AveragePool) {
369 out << SP << SP << SP << SP << "float value = 0;\n";
370 if (dynamicDivisor)
371 out << SP << SP << SP << SP << "const int nsum = "
372 << windowExtent("i", "kh", fShapeX[2], fAttrPads[fDim]) << ";\n";
373 else // every window is full, so the divisor is the kernel area
374 out << SP << SP << SP << SP << "constexpr int nsum = kh;\n";
375 }
376 // loop on rows of filtered region
377 out << SP << SP << SP << SP << "for (int l = i; l < i + kh; l++) {\n";
378 out << SP << SP << SP << SP << SP << "if (l < 0 || l >= hsize) continue;\n";
379 out << SP << SP << SP << SP << SP << SP << "int index = inputOffset + l;\n";
380 if (fPoolMode == MaxPool) {
381 out << SP << SP << SP << SP << SP << SP << "auto xval = tensor_" << fNX << "[index];\n";
382 out << SP << SP << SP << SP << SP << SP << "if (xval > value) value = xval;\n";
383 }
384 else if (fPoolMode == AveragePool) {
385 // compute sum of values
386 out << SP << SP << SP << SP << SP << SP << "value += tensor_" << fNX << "[index];\n";
387 }
388 out << SP << SP << SP << SP << SP << "}\n"; // end loop on region elements
389 if (fPoolMode == AveragePool) {
390 // compute average
391 out << SP << SP << SP << SP << "value /= float(nsum);\n";
392 }
393
394 out << SP << SP << SP << SP << "tensor_" << fNY << "[outIndex++] = value;\n";
395
396 out << SP << SP << "}\n"; // end loop on i (image rows)
397 out << SP << "}\n"; // end loop on c*b
398 }
399 else if(fDim==2){
400 // loop on batches and channels
401 out << SP << "size_t outIndex = 0;\n";
402 out << SP << "for (size_t n = 0; n < " << fShapeX[0]*fShapeX[1] << "; n++) {\n";
403 out << SP << SP << "size_t inputOffset = n*" << fShapeX[2]*fShapeX[3] << ";\n";
404 out << SP << SP << "for (int i = hmin; i < hmax; i+=" << fAttrStrides[0] << ") {\n";
405 out << SP << SP << SP << "for (int j = wmin; j < wmax; j+=" << fAttrStrides[1] << ") {\n";
406 // loop on elements of filter region to compute maximum
407 if (fPoolMode == MaxPool)
408 out << SP << SP << SP << SP << "float value = -INFINITY;\n";
409 else if (fPoolMode == AveragePool) {
410 out << SP << SP << SP << SP << "float value = 0;\n";
411 if (dynamicDivisor)
412 out << SP << SP << SP << SP << "const int nsum = "
413 << windowExtent("i", "kh", fShapeX[2], fAttrPads[fDim]) << " * "
414 << windowExtent("j", "kw", fShapeX[3], fAttrPads[fDim + 1]) << ";\n";
415 else // every window is full, so the divisor is the kernel area
416 out << SP << SP << SP << SP << "constexpr int nsum = kw*kh;\n";
417 }
418 // loop on rows of filtered region
419 out << SP << SP << SP << SP << "for (int l = i; l < i + kh; l++) {\n";
420 out << SP << SP << SP << SP << SP << "if (l < 0 || l >= hsize) continue;\n";
421 // loop on columns of filtered region
422 out << SP << SP << SP << SP << SP << "for (int m = j; m < j + kw; m++) {\n";
423 out << SP << SP << SP << SP << SP << SP << "if (m < 0 || m >= wsize) continue;\n";
424 out << SP << SP << SP << SP << SP << SP << SP << "int index = inputOffset + l*wsize + m;\n";
425 if (fPoolMode == MaxPool) {
426 out << SP << SP << SP << SP << SP << SP << SP << "auto xval = tensor_" << fNX << "[index];\n";
427 out << SP << SP << SP << SP << SP << SP << SP << "if (xval > value) value = xval;\n";
428 }
429 else if (fPoolMode == AveragePool) {
430 // compute sum of values
431 out << SP << SP << SP << SP << SP << SP << SP << "value += tensor_" << fNX << "[index];\n";
432 }
433 out << SP << SP << SP << SP << SP << SP << "}\n";
434 out << SP << SP << SP << SP << SP << "}\n"; // end loop on region elements
435 if (fPoolMode == AveragePool) {
436 // compute average
437 out << SP << SP << SP << SP << "value /= float(nsum);\n";
438 }
439 out << SP << SP << SP << SP << "tensor_" << fNY << "[outIndex++] = value;\n";
440 out << SP << SP << SP << "}\n"; // end loop on j (columns of image)
441 out << SP << SP << "}\n"; // end loop on i (image rows)
442 out << SP << "}\n"; // end loop on c*b
443 }
444 else if(fDim==3){
445 // loop on batches and channels
446 out << SP << "size_t outIndex = 0;\n";
447 out << SP << "for (size_t n = 0; n < " << fShapeX[0]*fShapeX[1] << "; n++) {\n";
448 out << SP << SP << "size_t inputOffset = n*" << fShapeX[2]*fShapeX[3]*fShapeX[4] << ";\n";
449 out << SP << SP << "for (int i = hmin; i < hmax; i+=" << fAttrStrides[0] << ") {\n";
450 out << SP << SP << SP << "for (int j = wmin; j < wmax; j+=" << fAttrStrides[1] << ") {\n";
451 out << SP << SP << SP << SP << "for (int k = dmin; k < dmax; k+=" << fAttrStrides[2] << ") {\n";
452 // loop on elements of filter region to compute maximum
453 if (fPoolMode == MaxPool)
454 out << SP << SP << SP << SP << "float value = -INFINITY;\n";
455 else if (fPoolMode == AveragePool) {
456 out << SP << SP << SP << SP << "float value = 0;\n";
457 if (dynamicDivisor)
458 out << SP << SP << SP << SP << "const int nsum = "
459 << windowExtent("i", "kh", fShapeX[2], fAttrPads[fDim]) << " * "
460 << windowExtent("j", "kw", fShapeX[3], fAttrPads[fDim + 1]) << " * "
461 << windowExtent("k", "kd", fShapeX[4], fAttrPads[fDim + 2]) << ";\n";
462 else // every window is full, so the divisor is the kernel area
463 out << SP << SP << SP << SP << "constexpr int nsum = kw*kh*kd;\n";
464 }
465 // loop on rows of filtered region
466 out << SP << SP << SP << SP << "for (int l = i; l < i + kh; l++) {\n";
467 out << SP << SP << SP << SP << SP << "if (l < 0 || l >= hsize) continue;\n";
468 // loop on columns of filtered region
469 out << SP << SP << SP << SP << SP << "for (int m = j; m < j + kw; m++) {\n";
470 out << SP << SP << SP << SP << SP << SP << "if (m < 0 || m >= wsize) continue;\n";
471 // loop on layers of filtered region
472 out << SP << SP << SP << SP << SP << SP << "for (int p = k; p < k + kd; p++) {\n";
473 out << SP << SP << SP << SP << SP << SP << SP << "if (p < 0 || p >= dsize) continue;\n";
474 out << SP << SP << SP << SP << SP << SP << SP << SP << "int index = inputOffset + l*dwsize + m*dsize + p;\n";
475
476 if (fPoolMode == MaxPool) {
477 out << SP << SP << SP << SP << SP << SP << SP << SP << "auto xval = tensor_" << fNX << "[index];\n";
478 out << SP << SP << SP << SP << SP << SP << SP << SP << "if (xval > value) value = xval;\n";
479 }
480 else if (fPoolMode == AveragePool) {
481 // compute sum of values
482 out << SP << SP << SP << SP << SP << SP << SP << SP << "value += tensor_" << fNX << "[index];\n";
483 }
484 out << SP << SP << SP << SP << SP << SP << "}\n";
485 out << SP << SP << SP << SP << SP << "}\n";
486 out << SP << SP << SP << SP << "}\n"; // end loop on region elements
487 if (fPoolMode == AveragePool) {
488 // compute average
489 out << SP << SP << SP << SP << "value /= float(nsum);\n";
490 }
491
492 out << SP << SP << SP << SP << "tensor_" << fNY << "[outIndex++] = value;\n";
493 out << SP << SP << SP << SP << "}\n" ; // end loop on k (layers of image)
494 out << SP << SP << SP << "}\n"; // end loop on j (columns of image)
495 out << SP << SP << "}\n"; // end loop on i (image rows)
496 out << SP << "}\n"; // end loop on c*b
497 }
498 // end scope
499 out << SP << "}\n";
500
501
502 return out.str();
503 }
504};
505
506} // namespace SOFIE
507} // namespace Experimental
508} // namespace TMVA
509
510
511#endif
#define d(i)
Definition RSha256.hxx:102
#define e(i)
Definition RSha256.hxx:103
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t hmax
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
#define hi
void AddNeededStdLib(std::string libname)
std::vector< size_t > GetTensorShape(const std::string &name) const
Definition RModel.cxx:64
void AddIntermediateTensor(std::string tensor_name, ETensorType type, std::vector< Dim > dim_shape)
Definition RModel.cxx:311
bool CheckIfTensorAlreadyExist(std::string tensor_name)
Definition RModel.cxx:157
ETensorType GetTensorType(std::string name) const
Definition RModel.cxx:125
virtual std::string GenerateSessionMembersCode(std::string opName) override
std::vector< std::vector< size_t > > ShapeInference(std::vector< std::vector< size_t > > input) override
void Initialize(RModel &model) override
std::vector< ETensorType > TypeInference(std::vector< ETensorType > input) override
std::string Generate(std::string OpName) override
ROperator_Pool(PoolOpMode mode, RAttributes_Pool attr, std::string nameX, std::string nameY)
std::vector< std::string_view > fInputTensorNames
Definition ROperator.hxx:50
const std::string SP
space used to correctly indent the generated C++ code
Definition ROperator.hxx:45
std::vector< std::string_view > fOutputTensorNames
Definition ROperator.hxx:51
const Int_t n
Definition legend1.C:16
std::string ConvertShapeToString(const std::vector< size_t > &shape)
create variable transformations