Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
onnx.hxx
Go to the documentation of this file.
1// TMVA SOFIE — minimal, dependency-free ONNX protobuf reader.
2//
3// Drop-in replacement for the protoc-generated onnx_proto3.pb.h. Provides the
4// subset of the onnx:: message API that the SOFIE ONNX parser actually uses,
5// backed by a hand-written protobuf wire-format decoder. No libprotobuf, no
6// protoc, no codegen.
7//
8// Only the read-side accessors used by RModelParser_ONNX and the Parse*.cxx
9// operator parsers are implemented.
10
11#ifndef TMVA_SOFIE_ONNX_LITE
12#define TMVA_SOFIE_ONNX_LITE
13
14#include <cstdint>
15#include <cstring>
16#include <istream>
17#include <memory>
18#include <utility>
19#include <sstream>
20#include <string>
21#include <vector>
22
23// The messages live in TMVA::Experimental::SOFIE::onnx, not in the global onnx
24// namespace the protoc-generated headers use. The real ONNX C++ library ships
25// inside the `onnx` Python wheel, and when that extension module is loaded in
26// the same process (as any PyTorch ONNX export does) its exported symbols
27// interpose ours on ELF platforms: SOFIE would then call protobuf's
28// onnx::TensorProto destructor on an object with this file's layout.
29// Unqualified `onnx::` inside namespace SOFIE still names these classes, so
30// the parser sources need no change.
31namespace TMVA {
32namespace Experimental {
33namespace SOFIE {
34
35namespace onnx {
36
37// ---------------------------------------------------------------------------
38// Protobuf wire-format reader (proto3 subset: varint, 64-bit, len, 32-bit)
39// ---------------------------------------------------------------------------
40namespace detail {
41
44 WT_I64 = 1,
45 WT_LEN = 2,
46 WT_I32 = 5
47};
48
50 const uint8_t *fP;
51 const uint8_t *fEnd;
52 bool fOk = true;
53
54public:
55 WireReader(const char *data, std::size_t n) : fP(reinterpret_cast<const uint8_t *>(data)), fEnd(fP + n) {}
56
57 bool ok() const { return fOk; }
58 bool eof() const { return fP >= fEnd; }
59
60 uint64_t ReadVarint()
61 {
62 uint64_t result = 0;
63 int shift = 0;
64 while (fP < fEnd && shift < 64) {
65 uint8_t b = *fP++;
66 result |= uint64_t(b & 0x7F) << shift;
67 if (!(b & 0x80))
68 return result;
69 shift += 7;
70 }
71 fOk = false;
72 return result;
73 }
74
75 // Fixed-width fields are little-endian on the wire. Assemble them byte-wise
76 // so the result is a correct host-order value on both little- and big-endian
77 // machines (ROOT CI covers big-endian s390x). Varints need no such handling.
78 uint32_t ReadFixed32()
79 {
80 if (fP + 4 > fEnd) {
81 fOk = false;
82 return 0;
83 }
84 uint32_t v = uint32_t(fP[0]) | (uint32_t(fP[1]) << 8) | (uint32_t(fP[2]) << 16) | (uint32_t(fP[3]) << 24);
85 fP += 4;
86 return v;
87 }
88
89 uint64_t ReadFixed64()
90 {
91 if (fP + 8 > fEnd) {
92 fOk = false;
93 return 0;
94 }
95 uint64_t v = 0;
96 for (int k = 0; k < 8; ++k)
97 v |= uint64_t(fP[k]) << (8 * k);
98 fP += 8;
99 return v;
100 }
101
102 // Length-delimited payload returned as a (ptr,len) view into the buffer.
103 std::pair<const char *, std::size_t> ReadLen()
104 {
105 uint64_t n = ReadVarint();
106 if (fP + n > fEnd) {
107 fOk = false;
108 return {nullptr, 0};
109 }
110 auto ptr = reinterpret_cast<const char *>(fP);
111 fP += n;
112 return {ptr, std::size_t(n)};
113 }
114
115 bool ReadTag(uint32_t &field, uint32_t &wire)
116 {
117 if (eof())
118 return false;
119 uint64_t tag = ReadVarint();
120 if (!fOk)
121 return false;
122 field = uint32_t(tag >> 3);
123 wire = uint32_t(tag & 7);
124 return true;
125 }
126
127 void SkipField(uint32_t wire)
128 {
129 switch (wire) {
130 case WT_VARINT: ReadVarint(); break;
131 case WT_I64: ReadFixed64(); break;
132 case WT_LEN: ReadLen(); break;
133 case WT_I32: ReadFixed32(); break;
134 default: fOk = false; break; // groups (3,4) unsupported / not used by ONNX
135 }
136 }
137};
138
139// Read a repeated numeric field that may be packed (single WT_LEN block) or
140// written as individual entries.
141inline void ReadPackedVarint(WireReader &r, uint32_t wire, std::vector<int64_t> &out)
142{
143 if (wire == WT_LEN) {
144 auto s = r.ReadLen();
145 WireReader rr(s.first, s.second);
146 while (!rr.eof())
147 out.push_back(int64_t(rr.ReadVarint()));
148 } else {
149 out.push_back(int64_t(r.ReadVarint()));
150 }
151}
152inline void ReadPackedI32(WireReader &r, uint32_t wire, std::vector<int32_t> &out)
153{
154 if (wire == WT_LEN) {
155 auto s = r.ReadLen();
156 WireReader rr(s.first, s.second);
157 while (!rr.eof())
158 out.push_back(int32_t(rr.ReadVarint()));
159 } else {
160 out.push_back(int32_t(r.ReadVarint()));
161 }
162}
163inline void ReadPackedFloat(WireReader &r, uint32_t wire, std::vector<float> &out)
164{
165 auto one = [](uint32_t bits) {
166 float f;
167 std::memcpy(&f, &bits, 4);
168 return f;
169 };
170 if (wire == WT_LEN) {
171 auto s = r.ReadLen();
172 WireReader rr(s.first, s.second);
173 while (!rr.eof())
174 out.push_back(one(rr.ReadFixed32()));
175 } else {
176 out.push_back(one(r.ReadFixed32()));
177 }
178}
179inline void ReadPackedDouble(WireReader &r, uint32_t wire, std::vector<double> &out)
180{
181 auto one = [](uint64_t bits) {
182 double d;
183 std::memcpy(&d, &bits, 8);
184 return d;
185 };
186 if (wire == WT_LEN) {
187 auto s = r.ReadLen();
188 WireReader rr(s.first, s.second);
189 while (!rr.eof())
190 out.push_back(one(rr.ReadFixed64()));
191 } else {
192 out.push_back(one(r.ReadFixed64()));
193 }
194}
195
196inline std::string Str(std::pair<const char *, std::size_t> v)
197{
198 return std::string(v.first, v.second);
199}
200
201} // namespace detail
202
203// ---------------------------------------------------------------------------
204// Message types (subset). Each exposes the generated-protobuf-style accessors.
205// ---------------------------------------------------------------------------
206
207class GraphProto; // fwd
208class TensorProto; // fwd
209
210// --- TensorShapeProto::Dimension (flattened name: TensorShapeProto_Dimension)
212public:
213 enum class ValueCase {
214 VALUE_NOT_SET = 0,
215 kDimValue = 1,
216 kDimParam = 2
217 };
218
219 ValueCase value_case() const { return fCase; }
220 int64_t dim_value() const { return fDimValue; }
221 const std::string &dim_param() const { return fDimParam; }
222
224 {
225 uint32_t f, wt;
226 while (r.ReadTag(f, wt)) {
227 switch (f) {
228 case 1:
229 fDimValue = int64_t(r.ReadVarint());
231 break;
232 case 2:
233 fDimParam = detail::Str(r.ReadLen());
235 break;
236 default: r.SkipField(wt); break;
237 }
238 }
239 }
240
241private:
243 int64_t fDimValue = 0;
244 std::string fDimParam;
245};
246
248public:
249 int dim_size() const { return int(fDim.size()); }
250 const TensorShapeProto_Dimension &dim(int i) const { return fDim[i]; }
251
253 {
254 uint32_t f, wt;
255 while (r.ReadTag(f, wt)) {
256 if (f == 1 && wt == detail::WT_LEN) {
257 auto s = r.ReadLen();
258 fDim.emplace_back();
259 fDim.back().ParseFrom(detail::WireReader(s.first, s.second));
260 } else {
261 r.SkipField(wt);
262 }
263 }
264 }
265
266private:
267 std::vector<TensorShapeProto_Dimension> fDim;
268};
269
270// TypeProto::Tensor
272public:
273 int elem_type() const { return fElemType; }
274 bool has_shape() const { return fHasShape; }
275 const TensorShapeProto &shape() const { return fShape; }
276
278 {
279 uint32_t f, wt;
280 while (r.ReadTag(f, wt)) {
281 switch (f) {
282 case 1: fElemType = int(r.ReadVarint()); break;
283 case 2: {
284 auto s = r.ReadLen();
285 fShape.ParseFrom(detail::WireReader(s.first, s.second));
286 fHasShape = true;
287 break;
288 }
289 default: r.SkipField(wt); break;
290 }
291 }
292 }
293
294private:
295 int fElemType = 0;
296 bool fHasShape = false;
298};
299
301public:
302 const TypeProto_Tensor &tensor_type() const { return fTensorType; }
303
305 {
306 uint32_t f, wt;
307 while (r.ReadTag(f, wt)) {
308 if (f == 1 && wt == detail::WT_LEN) { // tensor_type
309 auto s = r.ReadLen();
310 fTensorType.ParseFrom(detail::WireReader(s.first, s.second));
311 } else {
312 r.SkipField(wt);
313 }
314 }
315 }
316
317private:
319};
320
322public:
323 const std::string &name() const { return fName; }
324 const TypeProto &type() const { return fType; }
325
327 {
328 uint32_t f, wt;
329 while (r.ReadTag(f, wt)) {
330 switch (f) {
331 case 1: fName = detail::Str(r.ReadLen()); break;
332 case 2: {
333 auto s = r.ReadLen();
334 fType.ParseFrom(detail::WireReader(s.first, s.second));
335 break;
336 }
337 default: r.SkipField(wt); break;
338 }
339 }
340 }
341
342private:
343 std::string fName;
345};
346
348public:
349 const std::string &key() const { return fKey; }
350 const std::string &value() const { return fValue; }
351
353 {
354 uint32_t f, wt;
355 while (r.ReadTag(f, wt)) {
356 switch (f) {
357 case 1: fKey = detail::Str(r.ReadLen()); break;
358 case 2: fValue = detail::Str(r.ReadLen()); break;
359 default: r.SkipField(wt); break;
360 }
361 }
362 }
363
364private:
365 std::string fKey, fValue;
366};
367
369public:
370 enum DataType {
372 FLOAT = 1,
373 UINT8 = 2,
374 INT8 = 3,
376 INT16 = 5,
377 INT32 = 6,
378 INT64 = 7,
380 BOOL = 9,
382 DOUBLE = 11,
383 UINT32 = 12,
384 UINT64 = 13,
387 BFLOAT16 = 16
388 };
391 EXTERNAL = 1
392 };
393
394 const std::string &name() const { return fName; }
395 int data_type() const { return fDataType; }
396 int dims_size() const { return int(fDims.size()); }
397 int64_t dims(int i) const { return fDims[i]; }
398 const std::string &raw_data() const { return fRawData; }
400 const std::vector<StringStringEntryProto> &external_data() const { return fExternalData; }
401
402 int float_data_size() const { return int(fFloatData.size()); }
403 int double_data_size() const { return int(fDoubleData.size()); }
404 int int32_data_size() const { return int(fInt32Data.size()); }
405 int int64_data_size() const { return int(fInt64Data.size()); }
406 const std::vector<float> &float_data() const { return fFloatData; }
407 const std::vector<double> &double_data() const { return fDoubleData; }
408 const std::vector<int32_t> &int32_data() const { return fInt32Data; }
409 const std::vector<int64_t> &int64_data() const { return fInt64Data; }
410 // Indexed element accessors (the generated protobuf API exposes both forms).
411 float float_data(int i) const { return fFloatData[i]; }
412 double double_data(int i) const { return fDoubleData[i]; }
413 int32_t int32_data(int i) const { return fInt32Data[i]; }
414 int64_t int64_data(int i) const { return fInt64Data[i]; }
415
417 {
418 uint32_t f, wt;
419 while (r.ReadTag(f, wt)) {
420 switch (f) {
421 case 1: detail::ReadPackedVarint(r, wt, fDims); break;
422 case 2: fDataType = int(r.ReadVarint()); break;
423 case 4: detail::ReadPackedFloat(r, wt, fFloatData); break;
424 case 5: detail::ReadPackedI32(r, wt, fInt32Data); break;
425 case 7: detail::ReadPackedVarint(r, wt, fInt64Data); break;
426 case 8: fName = detail::Str(r.ReadLen()); break;
427 case 9: fRawData = detail::Str(r.ReadLen()); break;
428 case 10: detail::ReadPackedDouble(r, wt, fDoubleData); break;
429 case 13: {
430 auto s = r.ReadLen();
431 fExternalData.emplace_back();
432 fExternalData.back().ParseFrom(detail::WireReader(s.first, s.second));
433 break;
434 }
435 case 14: fDataLocation = DataLocation(r.ReadVarint()); break;
436 default: r.SkipField(wt); break;
437 }
438 }
439 }
440
441private:
442 std::string fName;
443 int fDataType = 0;
444 std::vector<int64_t> fDims;
445 std::string fRawData;
447 std::vector<StringStringEntryProto> fExternalData;
448 std::vector<float> fFloatData;
449 std::vector<double> fDoubleData;
450 std::vector<int32_t> fInt32Data;
451 std::vector<int64_t> fInt64Data;
452};
453
455public:
471
472 const std::string &name() const { return fName; }
473 AttributeType type() const { return fType; }
474 float f() const { return fF; }
475 int64_t i() const { return fI; }
476 const std::string &s() const { return fS; }
477 const TensorProto &t() const { return fT; }
478 const GraphProto &g() const; // defined after GraphProto
479 bool has_g() const { return fHasG; }
480 bool has_t() const { return fHasT; }
481
482 const std::vector<float> &floats() const { return fFloats; }
483 const std::vector<int64_t> &ints() const { return fInts; }
484 const std::vector<std::string> &strings() const { return fStrings; }
485
486 void ParseFrom(detail::WireReader r); // defined after GraphProto (needs g())
487
488private:
489 std::string fName;
491 float fF = 0.f;
492 int64_t fI = 0;
493 std::string fS;
494 bool fHasG = false, fHasT = false;
495 std::vector<float> fFloats;
496 std::vector<int64_t> fInts;
497 std::vector<std::string> fStrings;
499 // graph attribute held by shared_ptr to break the cyclic type dependency
500 // (a subgraph contains nodes, whose attributes may again hold subgraphs)
501 std::shared_ptr<GraphProto> fG;
502};
503
505public:
506 const std::string &op_type() const { return fOpType; }
507 const std::string &name() const { return fName; }
508 int input_size() const { return int(fInput.size()); }
509 const std::string &input(int i) const { return fInput[i]; }
510 const std::vector<std::string> &input() const { return fInput; }
511 int output_size() const { return int(fOutput.size()); }
512 const std::string &output(int i) const { return fOutput[i]; }
513 const std::vector<std::string> &output() const { return fOutput; }
514 int attribute_size() const { return int(fAttribute.size()); }
515 const AttributeProto &attribute(int i) const { return fAttribute[i]; }
516
518 {
519 uint32_t f, wt;
520 while (r.ReadTag(f, wt)) {
521 switch (f) {
522 case 1: fInput.push_back(detail::Str(r.ReadLen())); break;
523 case 2: fOutput.push_back(detail::Str(r.ReadLen())); break;
524 case 3: fName = detail::Str(r.ReadLen()); break;
525 case 4: fOpType = detail::Str(r.ReadLen()); break;
526 case 5: {
527 auto s = r.ReadLen();
528 fAttribute.emplace_back();
529 fAttribute.back().ParseFrom(detail::WireReader(s.first, s.second));
530 break;
531 }
532 default: r.SkipField(wt); break;
533 }
534 }
535 }
536
537private:
538 std::vector<std::string> fInput, fOutput;
539 std::string fName, fOpType;
540 std::vector<AttributeProto> fAttribute;
541};
542
544public:
545 const std::string &name() const { return fName; }
546 int node_size() const { return int(fNode.size()); }
547 const NodeProto &node(int i) const { return fNode[i]; }
548 int input_size() const { return int(fInput.size()); }
549 const ValueInfoProto &input(int i) const { return fInput[i]; }
550 int output_size() const { return int(fOutput.size()); }
551 const ValueInfoProto &output(int i) const { return fOutput[i]; }
552 int initializer_size() const { return int(fInitializer.size()); }
553 const TensorProto &initializer(int i) const { return fInitializer[i]; }
554
556 {
557 uint32_t f, wt;
558 while (r.ReadTag(f, wt)) {
559 switch (f) {
560 case 1: {
561 auto s = r.ReadLen();
562 fNode.emplace_back();
563 fNode.back().ParseFrom(detail::WireReader(s.first, s.second));
564 break;
565 }
566 case 2: fName = detail::Str(r.ReadLen()); break;
567 case 5: {
568 auto s = r.ReadLen();
569 fInitializer.emplace_back();
570 fInitializer.back().ParseFrom(detail::WireReader(s.first, s.second));
571 break;
572 }
573 case 11: {
574 auto s = r.ReadLen();
575 fInput.emplace_back();
576 fInput.back().ParseFrom(detail::WireReader(s.first, s.second));
577 break;
578 }
579 case 12: {
580 auto s = r.ReadLen();
581 fOutput.emplace_back();
582 fOutput.back().ParseFrom(detail::WireReader(s.first, s.second));
583 break;
584 }
585 default: r.SkipField(wt); break;
586 }
587 }
588 }
589
590private:
591 std::string fName;
592 std::vector<NodeProto> fNode;
593 std::vector<TensorProto> fInitializer;
594 std::vector<ValueInfoProto> fInput, fOutput;
595};
596
597// --- AttributeProto members that depend on the complete GraphProto type ------
598inline const GraphProto &AttributeProto::g() const
599{
600 return *fG;
601}
602
604{
605 uint32_t f, wt;
606 while (r.ReadTag(f, wt)) {
607 switch (f) {
608 case 1: fName = detail::Str(r.ReadLen()); break;
609 case 2: {
610 uint32_t bits = r.ReadFixed32();
611 std::memcpy(&fF, &bits, 4);
612 break;
613 }
614 case 3: fI = int64_t(r.ReadVarint()); break;
615 case 4: fS = detail::Str(r.ReadLen()); break;
616 case 5: {
617 auto s = r.ReadLen();
618 fT.ParseFrom(detail::WireReader(s.first, s.second));
619 fHasT = true;
620 break;
621 }
622 case 6: {
623 auto s = r.ReadLen();
624 fG = std::make_shared<GraphProto>();
625 fG->ParseFrom(detail::WireReader(s.first, s.second));
626 fHasG = true;
627 break;
628 }
629 case 7: detail::ReadPackedFloat(r, wt, fFloats); break;
630 case 8: detail::ReadPackedVarint(r, wt, fInts); break;
631 case 9: fStrings.push_back(detail::Str(r.ReadLen())); break;
632 case 20: fType = AttributeType(r.ReadVarint()); break;
633 default: r.SkipField(wt); break;
634 }
635 }
636}
637
639public:
640 int64_t ir_version() const { return fIrVersion; }
641 const std::string &producer_name() const { return fProducerName; }
642 const GraphProto &graph() const { return fGraph; }
643
644 bool ParseFromIstream(std::istream *in)
645 {
646 std::ostringstream ss;
647 ss << in->rdbuf();
648 fBuffer = ss.str();
649 detail::WireReader r(fBuffer.data(), fBuffer.size());
650 uint32_t f, wt;
651 while (r.ReadTag(f, wt)) {
652 switch (f) {
653 case 1: fIrVersion = int64_t(r.ReadVarint()); break;
654 case 2: fProducerName = detail::Str(r.ReadLen()); break;
655 case 7: {
656 auto s = r.ReadLen();
657 fGraph.ParseFrom(detail::WireReader(s.first, s.second));
658 break;
659 }
660 default: r.SkipField(wt); break;
661 }
662 }
663 return r.ok();
664 }
665
666private:
667 std::string fBuffer;
668 int64_t fIrVersion = 0;
669 std::string fProducerName;
671};
672
673} // namespace onnx
674
675} // namespace SOFIE
676} // namespace Experimental
677} // namespace TMVA
678
679#endif
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
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 data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
void ParseFrom(detail::WireReader r)
Definition onnx.hxx:603
const std::vector< std::string > & strings() const
Definition onnx.hxx:484
const std::vector< int64_t > & ints() const
Definition onnx.hxx:483
const std::vector< float > & floats() const
Definition onnx.hxx:482
std::shared_ptr< GraphProto > fG
Definition onnx.hxx:501
std::vector< std::string > fStrings
Definition onnx.hxx:497
std::vector< TensorProto > fInitializer
Definition onnx.hxx:593
std::vector< ValueInfoProto > fInput
Definition onnx.hxx:594
const ValueInfoProto & input(int i) const
Definition onnx.hxx:549
const ValueInfoProto & output(int i) const
Definition onnx.hxx:551
void ParseFrom(detail::WireReader r)
Definition onnx.hxx:555
const std::string & name() const
Definition onnx.hxx:545
const NodeProto & node(int i) const
Definition onnx.hxx:547
std::vector< ValueInfoProto > fOutput
Definition onnx.hxx:594
const TensorProto & initializer(int i) const
Definition onnx.hxx:553
const GraphProto & graph() const
Definition onnx.hxx:642
const std::string & producer_name() const
Definition onnx.hxx:641
bool ParseFromIstream(std::istream *in)
Definition onnx.hxx:644
const std::string & op_type() const
Definition onnx.hxx:506
const AttributeProto & attribute(int i) const
Definition onnx.hxx:515
const std::string & input(int i) const
Definition onnx.hxx:509
const std::string & output(int i) const
Definition onnx.hxx:512
const std::string & name() const
Definition onnx.hxx:507
void ParseFrom(detail::WireReader r)
Definition onnx.hxx:517
const std::vector< std::string > & input() const
Definition onnx.hxx:510
std::vector< std::string > fOutput
Definition onnx.hxx:538
const std::vector< std::string > & output() const
Definition onnx.hxx:513
std::vector< std::string > fInput
Definition onnx.hxx:538
std::vector< AttributeProto > fAttribute
Definition onnx.hxx:540
const std::string & raw_data() const
Definition onnx.hxx:398
std::vector< StringStringEntryProto > fExternalData
Definition onnx.hxx:447
const std::vector< int64_t > & int64_data() const
Definition onnx.hxx:409
const std::vector< StringStringEntryProto > & external_data() const
Definition onnx.hxx:400
const std::vector< double > & double_data() const
Definition onnx.hxx:407
const std::string & name() const
Definition onnx.hxx:394
void ParseFrom(detail::WireReader r)
Definition onnx.hxx:416
const std::vector< float > & float_data() const
Definition onnx.hxx:406
const std::vector< int32_t > & int32_data() const
Definition onnx.hxx:408
std::vector< TensorShapeProto_Dimension > fDim
Definition onnx.hxx:267
const TensorShapeProto_Dimension & dim(int i) const
Definition onnx.hxx:250
const TensorShapeProto & shape() const
Definition onnx.hxx:275
void ParseFrom(detail::WireReader r)
Definition onnx.hxx:304
const TypeProto_Tensor & tensor_type() const
Definition onnx.hxx:302
void ParseFrom(detail::WireReader r)
Definition onnx.hxx:326
std::pair< const char *, std::size_t > ReadLen()
Definition onnx.hxx:103
bool ReadTag(uint32_t &field, uint32_t &wire)
Definition onnx.hxx:115
WireReader(const char *data, std::size_t n)
Definition onnx.hxx:55
const Int_t n
Definition legend1.C:16
std::string Str(std::pair< const char *, std::size_t > v)
Definition onnx.hxx:196
void ReadPackedI32(WireReader &r, uint32_t wire, std::vector< int32_t > &out)
Definition onnx.hxx:152
void ReadPackedVarint(WireReader &r, uint32_t wire, std::vector< int64_t > &out)
Definition onnx.hxx:141
void ReadPackedDouble(WireReader &r, uint32_t wire, std::vector< double > &out)
Definition onnx.hxx:179
void ReadPackedFloat(WireReader &r, uint32_t wire, std::vector< float > &out)
Definition onnx.hxx:163
create variable transformations