1use core::cmp::Ordering;
6use core::mem;
7
8extern crate flatbuffers;
9use self::flatbuffers::{EndianScalar, Follow};
10
11#[deprecated(
12 since = "2.0.0",
13 note = "Use associated constants instead. This will no longer be generated in 2021."
14)]
15pub const ENUM_MIN_OPERATOR_TYPE: u8 = 0;
16#[deprecated(
17 since = "2.0.0",
18 note = "Use associated constants instead. This will no longer be generated in 2021."
19)]
20pub const ENUM_MAX_OPERATOR_TYPE: u8 = 127;
21#[deprecated(
22 since = "2.0.0",
23 note = "Use associated constants instead. This will no longer be generated in 2021."
24)]
25#[allow(non_camel_case_types)]
26pub const ENUM_VALUES_OPERATOR_TYPE: [OperatorType; 128] = [
27 OperatorType::Add,
28 OperatorType::ArgMin,
29 OperatorType::ArgMax,
30 OperatorType::AveragePool,
31 OperatorType::BatchNormalization,
32 OperatorType::Cast,
33 OperatorType::Clip,
34 OperatorType::Concat,
35 OperatorType::ConstantOfShape,
36 OperatorType::Conv,
37 OperatorType::ConvTranspose,
38 OperatorType::Cos,
39 OperatorType::CumSum,
40 OperatorType::Div,
41 OperatorType::Equal,
42 OperatorType::Erf,
43 OperatorType::Expand,
44 OperatorType::Flatten,
45 OperatorType::Gather,
46 OperatorType::Gemm,
47 OperatorType::GlobalAveragePool,
48 OperatorType::Greater,
49 OperatorType::GRU,
50 OperatorType::Identity,
51 OperatorType::LeakyRelu,
52 OperatorType::Less,
53 OperatorType::LessOrEqual,
54 OperatorType::Log,
55 OperatorType::LogSoftmax,
56 OperatorType::LSTM,
57 OperatorType::MatMul,
58 OperatorType::MaxPool,
59 OperatorType::Mod,
60 OperatorType::Mul,
61 OperatorType::Pad,
62 OperatorType::Pow,
63 OperatorType::Range,
64 OperatorType::ReduceMean,
65 OperatorType::ReduceL2,
66 OperatorType::Relu,
67 OperatorType::Reshape,
68 OperatorType::Resize,
69 OperatorType::Shape,
70 OperatorType::Sigmoid,
71 OperatorType::Sin,
72 OperatorType::Slice,
73 OperatorType::Split,
74 OperatorType::Sqrt,
75 OperatorType::Squeeze,
76 OperatorType::Softmax,
77 OperatorType::Sub,
78 OperatorType::Tanh,
79 OperatorType::Transpose,
80 OperatorType::Unsqueeze,
81 OperatorType::Where,
82 OperatorType::ReduceProd,
83 OperatorType::ReduceSum,
84 OperatorType::ReduceMin,
85 OperatorType::ReduceMax,
86 OperatorType::NonZero,
87 OperatorType::ScatterElements,
88 OperatorType::Tile,
89 OperatorType::Not,
90 OperatorType::Abs,
91 OperatorType::Max,
92 OperatorType::Mean,
93 OperatorType::Min,
94 OperatorType::Sum,
95 OperatorType::OneHot,
96 OperatorType::Round,
97 OperatorType::Floor,
98 OperatorType::Ceil,
99 OperatorType::Reciprocal,
100 OperatorType::TopK,
101 OperatorType::Neg,
102 OperatorType::Exp,
103 OperatorType::GreaterOrEqual,
104 OperatorType::Size,
105 OperatorType::Tan,
106 OperatorType::Acos,
107 OperatorType::Asin,
108 OperatorType::Atan,
109 OperatorType::InstanceNormalization,
110 OperatorType::HardSigmoid,
111 OperatorType::HardSwish,
112 OperatorType::And,
113 OperatorType::Or,
114 OperatorType::Xor,
115 OperatorType::Trilu,
116 OperatorType::ScatterND,
117 OperatorType::NonMaxSuppression,
118 OperatorType::Sign,
119 OperatorType::GatherElements,
120 OperatorType::LayerNormalization,
121 OperatorType::ReduceSumSquare,
122 OperatorType::RandomUniform,
123 OperatorType::Elu,
124 OperatorType::RandomUniformLike,
125 OperatorType::RandomNormal,
126 OperatorType::RandomNormalLike,
127 OperatorType::Softplus,
128 OperatorType::GatherND,
129 OperatorType::Gelu,
130 OperatorType::Einsum,
131 OperatorType::If,
132 OperatorType::DequantizeLinear,
133 OperatorType::QuantizeLinear,
134 OperatorType::DynamicQuantizeLinear,
135 OperatorType::MatMulInteger,
136 OperatorType::DepthToSpace,
137 OperatorType::ConvInteger,
138 OperatorType::CastLike,
139 OperatorType::Dropout,
140 OperatorType::EyeLike,
141 OperatorType::IsNaN,
142 OperatorType::IsInf,
143 OperatorType::Loop,
144 OperatorType::SequenceEmpty,
145 OperatorType::SequenceAt,
146 OperatorType::SequenceInsert,
147 OperatorType::ConcatFromSequence,
148 OperatorType::SplitToSequence,
149 OperatorType::SequenceLength,
150 OperatorType::SequenceConstruct,
151 OperatorType::SequenceErase,
152 OperatorType::GridSample,
153 OperatorType::PRelu,
154 OperatorType::STFT,
155];
156
157#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
158#[repr(transparent)]
159pub struct OperatorType(pub u8);
160#[allow(non_upper_case_globals)]
161impl OperatorType {
162 pub const Add: Self = Self(0);
163 pub const ArgMin: Self = Self(1);
164 pub const ArgMax: Self = Self(2);
165 pub const AveragePool: Self = Self(3);
166 pub const BatchNormalization: Self = Self(4);
167 pub const Cast: Self = Self(5);
168 pub const Clip: Self = Self(6);
169 pub const Concat: Self = Self(7);
170 pub const ConstantOfShape: Self = Self(8);
171 pub const Conv: Self = Self(9);
172 pub const ConvTranspose: Self = Self(10);
173 pub const Cos: Self = Self(11);
174 pub const CumSum: Self = Self(12);
175 pub const Div: Self = Self(13);
176 pub const Equal: Self = Self(14);
177 pub const Erf: Self = Self(15);
178 pub const Expand: Self = Self(16);
179 pub const Flatten: Self = Self(17);
180 pub const Gather: Self = Self(18);
181 pub const Gemm: Self = Self(19);
182 pub const GlobalAveragePool: Self = Self(20);
183 pub const Greater: Self = Self(21);
184 pub const GRU: Self = Self(22);
185 pub const Identity: Self = Self(23);
186 pub const LeakyRelu: Self = Self(24);
187 pub const Less: Self = Self(25);
188 pub const LessOrEqual: Self = Self(26);
189 pub const Log: Self = Self(27);
190 pub const LogSoftmax: Self = Self(28);
191 pub const LSTM: Self = Self(29);
192 pub const MatMul: Self = Self(30);
193 pub const MaxPool: Self = Self(31);
194 pub const Mod: Self = Self(32);
195 pub const Mul: Self = Self(33);
196 pub const Pad: Self = Self(34);
197 pub const Pow: Self = Self(35);
198 pub const Range: Self = Self(36);
199 pub const ReduceMean: Self = Self(37);
200 pub const ReduceL2: Self = Self(38);
201 pub const Relu: Self = Self(39);
202 pub const Reshape: Self = Self(40);
203 pub const Resize: Self = Self(41);
204 pub const Shape: Self = Self(42);
205 pub const Sigmoid: Self = Self(43);
206 pub const Sin: Self = Self(44);
207 pub const Slice: Self = Self(45);
208 pub const Split: Self = Self(46);
209 pub const Sqrt: Self = Self(47);
210 pub const Squeeze: Self = Self(48);
211 pub const Softmax: Self = Self(49);
212 pub const Sub: Self = Self(50);
213 pub const Tanh: Self = Self(51);
214 pub const Transpose: Self = Self(52);
215 pub const Unsqueeze: Self = Self(53);
216 pub const Where: Self = Self(54);
217 pub const ReduceProd: Self = Self(55);
218 pub const ReduceSum: Self = Self(56);
219 pub const ReduceMin: Self = Self(57);
220 pub const ReduceMax: Self = Self(58);
221 pub const NonZero: Self = Self(59);
222 pub const ScatterElements: Self = Self(60);
223 pub const Tile: Self = Self(61);
224 pub const Not: Self = Self(62);
225 pub const Abs: Self = Self(63);
226 pub const Max: Self = Self(64);
227 pub const Mean: Self = Self(65);
228 pub const Min: Self = Self(66);
229 pub const Sum: Self = Self(67);
230 pub const OneHot: Self = Self(68);
231 pub const Round: Self = Self(69);
232 pub const Floor: Self = Self(70);
233 pub const Ceil: Self = Self(71);
234 pub const Reciprocal: Self = Self(72);
235 pub const TopK: Self = Self(73);
236 pub const Neg: Self = Self(74);
237 pub const Exp: Self = Self(75);
238 pub const GreaterOrEqual: Self = Self(76);
239 pub const Size: Self = Self(77);
240 pub const Tan: Self = Self(78);
241 pub const Acos: Self = Self(79);
242 pub const Asin: Self = Self(80);
243 pub const Atan: Self = Self(81);
244 pub const InstanceNormalization: Self = Self(82);
245 pub const HardSigmoid: Self = Self(83);
246 pub const HardSwish: Self = Self(84);
247 pub const And: Self = Self(85);
248 pub const Or: Self = Self(86);
249 pub const Xor: Self = Self(87);
250 pub const Trilu: Self = Self(88);
251 pub const ScatterND: Self = Self(89);
252 pub const NonMaxSuppression: Self = Self(90);
253 pub const Sign: Self = Self(91);
254 pub const GatherElements: Self = Self(92);
255 pub const LayerNormalization: Self = Self(93);
256 pub const ReduceSumSquare: Self = Self(94);
257 pub const RandomUniform: Self = Self(95);
258 pub const Elu: Self = Self(96);
259 pub const RandomUniformLike: Self = Self(97);
260 pub const RandomNormal: Self = Self(98);
261 pub const RandomNormalLike: Self = Self(99);
262 pub const Softplus: Self = Self(100);
263 pub const GatherND: Self = Self(101);
264 pub const Gelu: Self = Self(102);
265 pub const Einsum: Self = Self(103);
266 pub const If: Self = Self(104);
267 pub const DequantizeLinear: Self = Self(105);
268 pub const QuantizeLinear: Self = Self(106);
269 pub const DynamicQuantizeLinear: Self = Self(107);
270 pub const MatMulInteger: Self = Self(108);
271 pub const DepthToSpace: Self = Self(109);
272 pub const ConvInteger: Self = Self(110);
273 pub const CastLike: Self = Self(111);
274 pub const Dropout: Self = Self(112);
275 pub const EyeLike: Self = Self(113);
276 pub const IsNaN: Self = Self(114);
277 pub const IsInf: Self = Self(115);
278 pub const Loop: Self = Self(116);
279 pub const SequenceEmpty: Self = Self(117);
280 pub const SequenceAt: Self = Self(118);
281 pub const SequenceInsert: Self = Self(119);
282 pub const ConcatFromSequence: Self = Self(120);
283 pub const SplitToSequence: Self = Self(121);
284 pub const SequenceLength: Self = Self(122);
285 pub const SequenceConstruct: Self = Self(123);
286 pub const SequenceErase: Self = Self(124);
287 pub const GridSample: Self = Self(125);
288 pub const PRelu: Self = Self(126);
289 pub const STFT: Self = Self(127);
290
291 pub const ENUM_MIN: u8 = 0;
292 pub const ENUM_MAX: u8 = 127;
293 pub const ENUM_VALUES: &'static [Self] = &[
294 Self::Add,
295 Self::ArgMin,
296 Self::ArgMax,
297 Self::AveragePool,
298 Self::BatchNormalization,
299 Self::Cast,
300 Self::Clip,
301 Self::Concat,
302 Self::ConstantOfShape,
303 Self::Conv,
304 Self::ConvTranspose,
305 Self::Cos,
306 Self::CumSum,
307 Self::Div,
308 Self::Equal,
309 Self::Erf,
310 Self::Expand,
311 Self::Flatten,
312 Self::Gather,
313 Self::Gemm,
314 Self::GlobalAveragePool,
315 Self::Greater,
316 Self::GRU,
317 Self::Identity,
318 Self::LeakyRelu,
319 Self::Less,
320 Self::LessOrEqual,
321 Self::Log,
322 Self::LogSoftmax,
323 Self::LSTM,
324 Self::MatMul,
325 Self::MaxPool,
326 Self::Mod,
327 Self::Mul,
328 Self::Pad,
329 Self::Pow,
330 Self::Range,
331 Self::ReduceMean,
332 Self::ReduceL2,
333 Self::Relu,
334 Self::Reshape,
335 Self::Resize,
336 Self::Shape,
337 Self::Sigmoid,
338 Self::Sin,
339 Self::Slice,
340 Self::Split,
341 Self::Sqrt,
342 Self::Squeeze,
343 Self::Softmax,
344 Self::Sub,
345 Self::Tanh,
346 Self::Transpose,
347 Self::Unsqueeze,
348 Self::Where,
349 Self::ReduceProd,
350 Self::ReduceSum,
351 Self::ReduceMin,
352 Self::ReduceMax,
353 Self::NonZero,
354 Self::ScatterElements,
355 Self::Tile,
356 Self::Not,
357 Self::Abs,
358 Self::Max,
359 Self::Mean,
360 Self::Min,
361 Self::Sum,
362 Self::OneHot,
363 Self::Round,
364 Self::Floor,
365 Self::Ceil,
366 Self::Reciprocal,
367 Self::TopK,
368 Self::Neg,
369 Self::Exp,
370 Self::GreaterOrEqual,
371 Self::Size,
372 Self::Tan,
373 Self::Acos,
374 Self::Asin,
375 Self::Atan,
376 Self::InstanceNormalization,
377 Self::HardSigmoid,
378 Self::HardSwish,
379 Self::And,
380 Self::Or,
381 Self::Xor,
382 Self::Trilu,
383 Self::ScatterND,
384 Self::NonMaxSuppression,
385 Self::Sign,
386 Self::GatherElements,
387 Self::LayerNormalization,
388 Self::ReduceSumSquare,
389 Self::RandomUniform,
390 Self::Elu,
391 Self::RandomUniformLike,
392 Self::RandomNormal,
393 Self::RandomNormalLike,
394 Self::Softplus,
395 Self::GatherND,
396 Self::Gelu,
397 Self::Einsum,
398 Self::If,
399 Self::DequantizeLinear,
400 Self::QuantizeLinear,
401 Self::DynamicQuantizeLinear,
402 Self::MatMulInteger,
403 Self::DepthToSpace,
404 Self::ConvInteger,
405 Self::CastLike,
406 Self::Dropout,
407 Self::EyeLike,
408 Self::IsNaN,
409 Self::IsInf,
410 Self::Loop,
411 Self::SequenceEmpty,
412 Self::SequenceAt,
413 Self::SequenceInsert,
414 Self::ConcatFromSequence,
415 Self::SplitToSequence,
416 Self::SequenceLength,
417 Self::SequenceConstruct,
418 Self::SequenceErase,
419 Self::GridSample,
420 Self::PRelu,
421 Self::STFT,
422 ];
423 pub fn variant_name(self) -> Option<&'static str> {
425 match self {
426 Self::Add => Some("Add"),
427 Self::ArgMin => Some("ArgMin"),
428 Self::ArgMax => Some("ArgMax"),
429 Self::AveragePool => Some("AveragePool"),
430 Self::BatchNormalization => Some("BatchNormalization"),
431 Self::Cast => Some("Cast"),
432 Self::Clip => Some("Clip"),
433 Self::Concat => Some("Concat"),
434 Self::ConstantOfShape => Some("ConstantOfShape"),
435 Self::Conv => Some("Conv"),
436 Self::ConvTranspose => Some("ConvTranspose"),
437 Self::Cos => Some("Cos"),
438 Self::CumSum => Some("CumSum"),
439 Self::Div => Some("Div"),
440 Self::Equal => Some("Equal"),
441 Self::Erf => Some("Erf"),
442 Self::Expand => Some("Expand"),
443 Self::Flatten => Some("Flatten"),
444 Self::Gather => Some("Gather"),
445 Self::Gemm => Some("Gemm"),
446 Self::GlobalAveragePool => Some("GlobalAveragePool"),
447 Self::Greater => Some("Greater"),
448 Self::GRU => Some("GRU"),
449 Self::Identity => Some("Identity"),
450 Self::LeakyRelu => Some("LeakyRelu"),
451 Self::Less => Some("Less"),
452 Self::LessOrEqual => Some("LessOrEqual"),
453 Self::Log => Some("Log"),
454 Self::LogSoftmax => Some("LogSoftmax"),
455 Self::LSTM => Some("LSTM"),
456 Self::MatMul => Some("MatMul"),
457 Self::MaxPool => Some("MaxPool"),
458 Self::Mod => Some("Mod"),
459 Self::Mul => Some("Mul"),
460 Self::Pad => Some("Pad"),
461 Self::Pow => Some("Pow"),
462 Self::Range => Some("Range"),
463 Self::ReduceMean => Some("ReduceMean"),
464 Self::ReduceL2 => Some("ReduceL2"),
465 Self::Relu => Some("Relu"),
466 Self::Reshape => Some("Reshape"),
467 Self::Resize => Some("Resize"),
468 Self::Shape => Some("Shape"),
469 Self::Sigmoid => Some("Sigmoid"),
470 Self::Sin => Some("Sin"),
471 Self::Slice => Some("Slice"),
472 Self::Split => Some("Split"),
473 Self::Sqrt => Some("Sqrt"),
474 Self::Squeeze => Some("Squeeze"),
475 Self::Softmax => Some("Softmax"),
476 Self::Sub => Some("Sub"),
477 Self::Tanh => Some("Tanh"),
478 Self::Transpose => Some("Transpose"),
479 Self::Unsqueeze => Some("Unsqueeze"),
480 Self::Where => Some("Where"),
481 Self::ReduceProd => Some("ReduceProd"),
482 Self::ReduceSum => Some("ReduceSum"),
483 Self::ReduceMin => Some("ReduceMin"),
484 Self::ReduceMax => Some("ReduceMax"),
485 Self::NonZero => Some("NonZero"),
486 Self::ScatterElements => Some("ScatterElements"),
487 Self::Tile => Some("Tile"),
488 Self::Not => Some("Not"),
489 Self::Abs => Some("Abs"),
490 Self::Max => Some("Max"),
491 Self::Mean => Some("Mean"),
492 Self::Min => Some("Min"),
493 Self::Sum => Some("Sum"),
494 Self::OneHot => Some("OneHot"),
495 Self::Round => Some("Round"),
496 Self::Floor => Some("Floor"),
497 Self::Ceil => Some("Ceil"),
498 Self::Reciprocal => Some("Reciprocal"),
499 Self::TopK => Some("TopK"),
500 Self::Neg => Some("Neg"),
501 Self::Exp => Some("Exp"),
502 Self::GreaterOrEqual => Some("GreaterOrEqual"),
503 Self::Size => Some("Size"),
504 Self::Tan => Some("Tan"),
505 Self::Acos => Some("Acos"),
506 Self::Asin => Some("Asin"),
507 Self::Atan => Some("Atan"),
508 Self::InstanceNormalization => Some("InstanceNormalization"),
509 Self::HardSigmoid => Some("HardSigmoid"),
510 Self::HardSwish => Some("HardSwish"),
511 Self::And => Some("And"),
512 Self::Or => Some("Or"),
513 Self::Xor => Some("Xor"),
514 Self::Trilu => Some("Trilu"),
515 Self::ScatterND => Some("ScatterND"),
516 Self::NonMaxSuppression => Some("NonMaxSuppression"),
517 Self::Sign => Some("Sign"),
518 Self::GatherElements => Some("GatherElements"),
519 Self::LayerNormalization => Some("LayerNormalization"),
520 Self::ReduceSumSquare => Some("ReduceSumSquare"),
521 Self::RandomUniform => Some("RandomUniform"),
522 Self::Elu => Some("Elu"),
523 Self::RandomUniformLike => Some("RandomUniformLike"),
524 Self::RandomNormal => Some("RandomNormal"),
525 Self::RandomNormalLike => Some("RandomNormalLike"),
526 Self::Softplus => Some("Softplus"),
527 Self::GatherND => Some("GatherND"),
528 Self::Gelu => Some("Gelu"),
529 Self::Einsum => Some("Einsum"),
530 Self::If => Some("If"),
531 Self::DequantizeLinear => Some("DequantizeLinear"),
532 Self::QuantizeLinear => Some("QuantizeLinear"),
533 Self::DynamicQuantizeLinear => Some("DynamicQuantizeLinear"),
534 Self::MatMulInteger => Some("MatMulInteger"),
535 Self::DepthToSpace => Some("DepthToSpace"),
536 Self::ConvInteger => Some("ConvInteger"),
537 Self::CastLike => Some("CastLike"),
538 Self::Dropout => Some("Dropout"),
539 Self::EyeLike => Some("EyeLike"),
540 Self::IsNaN => Some("IsNaN"),
541 Self::IsInf => Some("IsInf"),
542 Self::Loop => Some("Loop"),
543 Self::SequenceEmpty => Some("SequenceEmpty"),
544 Self::SequenceAt => Some("SequenceAt"),
545 Self::SequenceInsert => Some("SequenceInsert"),
546 Self::ConcatFromSequence => Some("ConcatFromSequence"),
547 Self::SplitToSequence => Some("SplitToSequence"),
548 Self::SequenceLength => Some("SequenceLength"),
549 Self::SequenceConstruct => Some("SequenceConstruct"),
550 Self::SequenceErase => Some("SequenceErase"),
551 Self::GridSample => Some("GridSample"),
552 Self::PRelu => Some("PRelu"),
553 Self::STFT => Some("STFT"),
554 _ => None,
555 }
556 }
557}
558impl core::fmt::Debug for OperatorType {
559 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
560 if let Some(name) = self.variant_name() {
561 f.write_str(name)
562 } else {
563 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
564 }
565 }
566}
567impl<'a> flatbuffers::Follow<'a> for OperatorType {
568 type Inner = Self;
569 #[inline]
570 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
571 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
572 Self(b)
573 }
574}
575
576impl flatbuffers::Push for OperatorType {
577 type Output = OperatorType;
578 #[inline]
579 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
580 flatbuffers::emplace_scalar::<u8>(dst, self.0);
581 }
582}
583
584impl flatbuffers::EndianScalar for OperatorType {
585 type Scalar = u8;
586 #[inline]
587 fn to_little_endian(self) -> u8 {
588 self.0.to_le()
589 }
590 #[inline]
591 #[allow(clippy::wrong_self_convention)]
592 fn from_little_endian(v: u8) -> Self {
593 let b = u8::from_le(v);
594 Self(b)
595 }
596}
597
598impl<'a> flatbuffers::Verifiable for OperatorType {
599 #[inline]
600 fn run_verifier(
601 v: &mut flatbuffers::Verifier,
602 pos: usize,
603 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
604 use self::flatbuffers::Verifiable;
605 u8::run_verifier(v, pos)
606 }
607}
608
609impl flatbuffers::SimpleToVerifyInSlice for OperatorType {}
610#[deprecated(
611 since = "2.0.0",
612 note = "Use associated constants instead. This will no longer be generated in 2021."
613)]
614pub const ENUM_MIN_RNNDIRECTION: u8 = 0;
615#[deprecated(
616 since = "2.0.0",
617 note = "Use associated constants instead. This will no longer be generated in 2021."
618)]
619pub const ENUM_MAX_RNNDIRECTION: u8 = 2;
620#[deprecated(
621 since = "2.0.0",
622 note = "Use associated constants instead. This will no longer be generated in 2021."
623)]
624#[allow(non_camel_case_types)]
625pub const ENUM_VALUES_RNNDIRECTION: [RNNDirection; 3] = [
626 RNNDirection::Forward,
627 RNNDirection::Reverse,
628 RNNDirection::Bidirectional,
629];
630
631#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
632#[repr(transparent)]
633pub struct RNNDirection(pub u8);
634#[allow(non_upper_case_globals)]
635impl RNNDirection {
636 pub const Forward: Self = Self(0);
637 pub const Reverse: Self = Self(1);
638 pub const Bidirectional: Self = Self(2);
639
640 pub const ENUM_MIN: u8 = 0;
641 pub const ENUM_MAX: u8 = 2;
642 pub const ENUM_VALUES: &'static [Self] = &[Self::Forward, Self::Reverse, Self::Bidirectional];
643 pub fn variant_name(self) -> Option<&'static str> {
645 match self {
646 Self::Forward => Some("Forward"),
647 Self::Reverse => Some("Reverse"),
648 Self::Bidirectional => Some("Bidirectional"),
649 _ => None,
650 }
651 }
652}
653impl core::fmt::Debug for RNNDirection {
654 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
655 if let Some(name) = self.variant_name() {
656 f.write_str(name)
657 } else {
658 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
659 }
660 }
661}
662impl<'a> flatbuffers::Follow<'a> for RNNDirection {
663 type Inner = Self;
664 #[inline]
665 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
666 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
667 Self(b)
668 }
669}
670
671impl flatbuffers::Push for RNNDirection {
672 type Output = RNNDirection;
673 #[inline]
674 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
675 flatbuffers::emplace_scalar::<u8>(dst, self.0);
676 }
677}
678
679impl flatbuffers::EndianScalar for RNNDirection {
680 type Scalar = u8;
681 #[inline]
682 fn to_little_endian(self) -> u8 {
683 self.0.to_le()
684 }
685 #[inline]
686 #[allow(clippy::wrong_self_convention)]
687 fn from_little_endian(v: u8) -> Self {
688 let b = u8::from_le(v);
689 Self(b)
690 }
691}
692
693impl<'a> flatbuffers::Verifiable for RNNDirection {
694 #[inline]
695 fn run_verifier(
696 v: &mut flatbuffers::Verifier,
697 pos: usize,
698 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
699 use self::flatbuffers::Verifiable;
700 u8::run_verifier(v, pos)
701 }
702}
703
704impl flatbuffers::SimpleToVerifyInSlice for RNNDirection {}
705#[deprecated(
706 since = "2.0.0",
707 note = "Use associated constants instead. This will no longer be generated in 2021."
708)]
709pub const ENUM_MIN_AUTO_PAD: u8 = 0;
710#[deprecated(
711 since = "2.0.0",
712 note = "Use associated constants instead. This will no longer be generated in 2021."
713)]
714pub const ENUM_MAX_AUTO_PAD: u8 = 1;
715#[deprecated(
716 since = "2.0.0",
717 note = "Use associated constants instead. This will no longer be generated in 2021."
718)]
719#[allow(non_camel_case_types)]
720pub const ENUM_VALUES_AUTO_PAD: [AutoPad; 2] = [AutoPad::Same, AutoPad::NotSet];
721
722#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
723#[repr(transparent)]
724pub struct AutoPad(pub u8);
725#[allow(non_upper_case_globals)]
726impl AutoPad {
727 pub const Same: Self = Self(0);
728 pub const NotSet: Self = Self(1);
729
730 pub const ENUM_MIN: u8 = 0;
731 pub const ENUM_MAX: u8 = 1;
732 pub const ENUM_VALUES: &'static [Self] = &[Self::Same, Self::NotSet];
733 pub fn variant_name(self) -> Option<&'static str> {
735 match self {
736 Self::Same => Some("Same"),
737 Self::NotSet => Some("NotSet"),
738 _ => None,
739 }
740 }
741}
742impl core::fmt::Debug for AutoPad {
743 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
744 if let Some(name) = self.variant_name() {
745 f.write_str(name)
746 } else {
747 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
748 }
749 }
750}
751impl<'a> flatbuffers::Follow<'a> for AutoPad {
752 type Inner = Self;
753 #[inline]
754 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
755 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
756 Self(b)
757 }
758}
759
760impl flatbuffers::Push for AutoPad {
761 type Output = AutoPad;
762 #[inline]
763 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
764 flatbuffers::emplace_scalar::<u8>(dst, self.0);
765 }
766}
767
768impl flatbuffers::EndianScalar for AutoPad {
769 type Scalar = u8;
770 #[inline]
771 fn to_little_endian(self) -> u8 {
772 self.0.to_le()
773 }
774 #[inline]
775 #[allow(clippy::wrong_self_convention)]
776 fn from_little_endian(v: u8) -> Self {
777 let b = u8::from_le(v);
778 Self(b)
779 }
780}
781
782impl<'a> flatbuffers::Verifiable for AutoPad {
783 #[inline]
784 fn run_verifier(
785 v: &mut flatbuffers::Verifier,
786 pos: usize,
787 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
788 use self::flatbuffers::Verifiable;
789 u8::run_verifier(v, pos)
790 }
791}
792
793impl flatbuffers::SimpleToVerifyInSlice for AutoPad {}
794#[deprecated(
795 since = "2.0.0",
796 note = "Use associated constants instead. This will no longer be generated in 2021."
797)]
798pub const ENUM_MIN_DATA_TYPE: u8 = 0;
799#[deprecated(
800 since = "2.0.0",
801 note = "Use associated constants instead. This will no longer be generated in 2021."
802)]
803pub const ENUM_MAX_DATA_TYPE: u8 = 3;
804#[deprecated(
805 since = "2.0.0",
806 note = "Use associated constants instead. This will no longer be generated in 2021."
807)]
808#[allow(non_camel_case_types)]
809pub const ENUM_VALUES_DATA_TYPE: [DataType; 4] = [
810 DataType::Int32,
811 DataType::Float,
812 DataType::Int8,
813 DataType::UInt8,
814];
815
816#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
817#[repr(transparent)]
818pub struct DataType(pub u8);
819#[allow(non_upper_case_globals)]
820impl DataType {
821 pub const Int32: Self = Self(0);
822 pub const Float: Self = Self(1);
823 pub const Int8: Self = Self(2);
824 pub const UInt8: Self = Self(3);
825
826 pub const ENUM_MIN: u8 = 0;
827 pub const ENUM_MAX: u8 = 3;
828 pub const ENUM_VALUES: &'static [Self] = &[Self::Int32, Self::Float, Self::Int8, Self::UInt8];
829 pub fn variant_name(self) -> Option<&'static str> {
831 match self {
832 Self::Int32 => Some("Int32"),
833 Self::Float => Some("Float"),
834 Self::Int8 => Some("Int8"),
835 Self::UInt8 => Some("UInt8"),
836 _ => None,
837 }
838 }
839}
840impl core::fmt::Debug for DataType {
841 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
842 if let Some(name) = self.variant_name() {
843 f.write_str(name)
844 } else {
845 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
846 }
847 }
848}
849impl<'a> flatbuffers::Follow<'a> for DataType {
850 type Inner = Self;
851 #[inline]
852 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
853 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
854 Self(b)
855 }
856}
857
858impl flatbuffers::Push for DataType {
859 type Output = DataType;
860 #[inline]
861 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
862 flatbuffers::emplace_scalar::<u8>(dst, self.0);
863 }
864}
865
866impl flatbuffers::EndianScalar for DataType {
867 type Scalar = u8;
868 #[inline]
869 fn to_little_endian(self) -> u8 {
870 self.0.to_le()
871 }
872 #[inline]
873 #[allow(clippy::wrong_self_convention)]
874 fn from_little_endian(v: u8) -> Self {
875 let b = u8::from_le(v);
876 Self(b)
877 }
878}
879
880impl<'a> flatbuffers::Verifiable for DataType {
881 #[inline]
882 fn run_verifier(
883 v: &mut flatbuffers::Verifier,
884 pos: usize,
885 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
886 use self::flatbuffers::Verifiable;
887 u8::run_verifier(v, pos)
888 }
889}
890
891impl flatbuffers::SimpleToVerifyInSlice for DataType {}
892#[deprecated(
893 since = "2.0.0",
894 note = "Use associated constants instead. This will no longer be generated in 2021."
895)]
896pub const ENUM_MIN_COORD_TRANSFORM_MODE: u8 = 0;
897#[deprecated(
898 since = "2.0.0",
899 note = "Use associated constants instead. This will no longer be generated in 2021."
900)]
901pub const ENUM_MAX_COORD_TRANSFORM_MODE: u8 = 3;
902#[deprecated(
903 since = "2.0.0",
904 note = "Use associated constants instead. This will no longer be generated in 2021."
905)]
906#[allow(non_camel_case_types)]
907pub const ENUM_VALUES_COORD_TRANSFORM_MODE: [CoordTransformMode; 4] = [
908 CoordTransformMode::HalfPixel,
909 CoordTransformMode::Asymmetric,
910 CoordTransformMode::AlignCorners,
911 CoordTransformMode::PytorchHalfPixel,
912];
913
914#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
915#[repr(transparent)]
916pub struct CoordTransformMode(pub u8);
917#[allow(non_upper_case_globals)]
918impl CoordTransformMode {
919 pub const HalfPixel: Self = Self(0);
920 pub const Asymmetric: Self = Self(1);
921 pub const AlignCorners: Self = Self(2);
922 pub const PytorchHalfPixel: Self = Self(3);
923
924 pub const ENUM_MIN: u8 = 0;
925 pub const ENUM_MAX: u8 = 3;
926 pub const ENUM_VALUES: &'static [Self] = &[
927 Self::HalfPixel,
928 Self::Asymmetric,
929 Self::AlignCorners,
930 Self::PytorchHalfPixel,
931 ];
932 pub fn variant_name(self) -> Option<&'static str> {
934 match self {
935 Self::HalfPixel => Some("HalfPixel"),
936 Self::Asymmetric => Some("Asymmetric"),
937 Self::AlignCorners => Some("AlignCorners"),
938 Self::PytorchHalfPixel => Some("PytorchHalfPixel"),
939 _ => None,
940 }
941 }
942}
943impl core::fmt::Debug for CoordTransformMode {
944 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
945 if let Some(name) = self.variant_name() {
946 f.write_str(name)
947 } else {
948 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
949 }
950 }
951}
952impl<'a> flatbuffers::Follow<'a> for CoordTransformMode {
953 type Inner = Self;
954 #[inline]
955 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
956 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
957 Self(b)
958 }
959}
960
961impl flatbuffers::Push for CoordTransformMode {
962 type Output = CoordTransformMode;
963 #[inline]
964 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
965 flatbuffers::emplace_scalar::<u8>(dst, self.0);
966 }
967}
968
969impl flatbuffers::EndianScalar for CoordTransformMode {
970 type Scalar = u8;
971 #[inline]
972 fn to_little_endian(self) -> u8 {
973 self.0.to_le()
974 }
975 #[inline]
976 #[allow(clippy::wrong_self_convention)]
977 fn from_little_endian(v: u8) -> Self {
978 let b = u8::from_le(v);
979 Self(b)
980 }
981}
982
983impl<'a> flatbuffers::Verifiable for CoordTransformMode {
984 #[inline]
985 fn run_verifier(
986 v: &mut flatbuffers::Verifier,
987 pos: usize,
988 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
989 use self::flatbuffers::Verifiable;
990 u8::run_verifier(v, pos)
991 }
992}
993
994impl flatbuffers::SimpleToVerifyInSlice for CoordTransformMode {}
995#[deprecated(
996 since = "2.0.0",
997 note = "Use associated constants instead. This will no longer be generated in 2021."
998)]
999pub const ENUM_MIN_NEAREST_MODE: u8 = 0;
1000#[deprecated(
1001 since = "2.0.0",
1002 note = "Use associated constants instead. This will no longer be generated in 2021."
1003)]
1004pub const ENUM_MAX_NEAREST_MODE: u8 = 3;
1005#[deprecated(
1006 since = "2.0.0",
1007 note = "Use associated constants instead. This will no longer be generated in 2021."
1008)]
1009#[allow(non_camel_case_types)]
1010pub const ENUM_VALUES_NEAREST_MODE: [NearestMode; 4] = [
1011 NearestMode::Floor,
1012 NearestMode::Ceil,
1013 NearestMode::RoundPreferFloor,
1014 NearestMode::RoundPreferCeil,
1015];
1016
1017#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1018#[repr(transparent)]
1019pub struct NearestMode(pub u8);
1020#[allow(non_upper_case_globals)]
1021impl NearestMode {
1022 pub const Floor: Self = Self(0);
1023 pub const Ceil: Self = Self(1);
1024 pub const RoundPreferFloor: Self = Self(2);
1025 pub const RoundPreferCeil: Self = Self(3);
1026
1027 pub const ENUM_MIN: u8 = 0;
1028 pub const ENUM_MAX: u8 = 3;
1029 pub const ENUM_VALUES: &'static [Self] = &[
1030 Self::Floor,
1031 Self::Ceil,
1032 Self::RoundPreferFloor,
1033 Self::RoundPreferCeil,
1034 ];
1035 pub fn variant_name(self) -> Option<&'static str> {
1037 match self {
1038 Self::Floor => Some("Floor"),
1039 Self::Ceil => Some("Ceil"),
1040 Self::RoundPreferFloor => Some("RoundPreferFloor"),
1041 Self::RoundPreferCeil => Some("RoundPreferCeil"),
1042 _ => None,
1043 }
1044 }
1045}
1046impl core::fmt::Debug for NearestMode {
1047 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1048 if let Some(name) = self.variant_name() {
1049 f.write_str(name)
1050 } else {
1051 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1052 }
1053 }
1054}
1055impl<'a> flatbuffers::Follow<'a> for NearestMode {
1056 type Inner = Self;
1057 #[inline]
1058 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1059 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
1060 Self(b)
1061 }
1062}
1063
1064impl flatbuffers::Push for NearestMode {
1065 type Output = NearestMode;
1066 #[inline]
1067 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1068 flatbuffers::emplace_scalar::<u8>(dst, self.0);
1069 }
1070}
1071
1072impl flatbuffers::EndianScalar for NearestMode {
1073 type Scalar = u8;
1074 #[inline]
1075 fn to_little_endian(self) -> u8 {
1076 self.0.to_le()
1077 }
1078 #[inline]
1079 #[allow(clippy::wrong_self_convention)]
1080 fn from_little_endian(v: u8) -> Self {
1081 let b = u8::from_le(v);
1082 Self(b)
1083 }
1084}
1085
1086impl<'a> flatbuffers::Verifiable for NearestMode {
1087 #[inline]
1088 fn run_verifier(
1089 v: &mut flatbuffers::Verifier,
1090 pos: usize,
1091 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1092 use self::flatbuffers::Verifiable;
1093 u8::run_verifier(v, pos)
1094 }
1095}
1096
1097impl flatbuffers::SimpleToVerifyInSlice for NearestMode {}
1098#[deprecated(
1099 since = "2.0.0",
1100 note = "Use associated constants instead. This will no longer be generated in 2021."
1101)]
1102pub const ENUM_MIN_RESIZE_MODE: u8 = 0;
1103#[deprecated(
1104 since = "2.0.0",
1105 note = "Use associated constants instead. This will no longer be generated in 2021."
1106)]
1107pub const ENUM_MAX_RESIZE_MODE: u8 = 1;
1108#[deprecated(
1109 since = "2.0.0",
1110 note = "Use associated constants instead. This will no longer be generated in 2021."
1111)]
1112#[allow(non_camel_case_types)]
1113pub const ENUM_VALUES_RESIZE_MODE: [ResizeMode; 2] = [ResizeMode::Nearest, ResizeMode::Linear];
1114
1115#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1116#[repr(transparent)]
1117pub struct ResizeMode(pub u8);
1118#[allow(non_upper_case_globals)]
1119impl ResizeMode {
1120 pub const Nearest: Self = Self(0);
1121 pub const Linear: Self = Self(1);
1122
1123 pub const ENUM_MIN: u8 = 0;
1124 pub const ENUM_MAX: u8 = 1;
1125 pub const ENUM_VALUES: &'static [Self] = &[Self::Nearest, Self::Linear];
1126 pub fn variant_name(self) -> Option<&'static str> {
1128 match self {
1129 Self::Nearest => Some("Nearest"),
1130 Self::Linear => Some("Linear"),
1131 _ => None,
1132 }
1133 }
1134}
1135impl core::fmt::Debug for ResizeMode {
1136 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1137 if let Some(name) = self.variant_name() {
1138 f.write_str(name)
1139 } else {
1140 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1141 }
1142 }
1143}
1144impl<'a> flatbuffers::Follow<'a> for ResizeMode {
1145 type Inner = Self;
1146 #[inline]
1147 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1148 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
1149 Self(b)
1150 }
1151}
1152
1153impl flatbuffers::Push for ResizeMode {
1154 type Output = ResizeMode;
1155 #[inline]
1156 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1157 flatbuffers::emplace_scalar::<u8>(dst, self.0);
1158 }
1159}
1160
1161impl flatbuffers::EndianScalar for ResizeMode {
1162 type Scalar = u8;
1163 #[inline]
1164 fn to_little_endian(self) -> u8 {
1165 self.0.to_le()
1166 }
1167 #[inline]
1168 #[allow(clippy::wrong_self_convention)]
1169 fn from_little_endian(v: u8) -> Self {
1170 let b = u8::from_le(v);
1171 Self(b)
1172 }
1173}
1174
1175impl<'a> flatbuffers::Verifiable for ResizeMode {
1176 #[inline]
1177 fn run_verifier(
1178 v: &mut flatbuffers::Verifier,
1179 pos: usize,
1180 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1181 use self::flatbuffers::Verifiable;
1182 u8::run_verifier(v, pos)
1183 }
1184}
1185
1186impl flatbuffers::SimpleToVerifyInSlice for ResizeMode {}
1187#[deprecated(
1188 since = "2.0.0",
1189 note = "Use associated constants instead. This will no longer be generated in 2021."
1190)]
1191pub const ENUM_MIN_OPERATOR_ATTRS: u8 = 0;
1192#[deprecated(
1193 since = "2.0.0",
1194 note = "Use associated constants instead. This will no longer be generated in 2021."
1195)]
1196pub const ENUM_MAX_OPERATOR_ATTRS: u8 = 54;
1197#[deprecated(
1198 since = "2.0.0",
1199 note = "Use associated constants instead. This will no longer be generated in 2021."
1200)]
1201#[allow(non_camel_case_types)]
1202pub const ENUM_VALUES_OPERATOR_ATTRS: [OperatorAttrs; 55] = [
1203 OperatorAttrs::NONE,
1204 OperatorAttrs::ArgMaxAttrs,
1205 OperatorAttrs::AveragePoolAttrs,
1206 OperatorAttrs::BatchNormalizationAttrs,
1207 OperatorAttrs::CastAttrs,
1208 OperatorAttrs::ConcatAttrs,
1209 OperatorAttrs::ConstantOfShapeAttrs,
1210 OperatorAttrs::ConvAttrs,
1211 OperatorAttrs::ConvTransposeAttrs,
1212 OperatorAttrs::FlattenAttrs,
1213 OperatorAttrs::GatherAttrs,
1214 OperatorAttrs::GemmAttrs,
1215 OperatorAttrs::GRUAttrs,
1216 OperatorAttrs::LeakyReluAttrs,
1217 OperatorAttrs::LSTMAttrs,
1218 OperatorAttrs::MaxPoolAttrs,
1219 OperatorAttrs::ReduceMeanAttrs,
1220 OperatorAttrs::ReshapeAttrs,
1221 OperatorAttrs::ResizeAttrs,
1222 OperatorAttrs::SplitAttrs,
1223 OperatorAttrs::SoftmaxAttrs,
1224 OperatorAttrs::TransposeAttrs,
1225 OperatorAttrs::ModAttrs,
1226 OperatorAttrs::ScatterElementsAttrs,
1227 OperatorAttrs::OneHotAttrs,
1228 OperatorAttrs::TopKAttrs,
1229 OperatorAttrs::HardSigmoidAttrs,
1230 OperatorAttrs::TriluAttrs,
1231 OperatorAttrs::ScatterNDAttrs,
1232 OperatorAttrs::NonMaxSuppressionAttrs,
1233 OperatorAttrs::LayerNormalizationAttrs,
1234 OperatorAttrs::RandomUniformAttrs,
1235 OperatorAttrs::EluAttrs,
1236 OperatorAttrs::RandomUniformLikeAttrs,
1237 OperatorAttrs::RandomNormalAttrs,
1238 OperatorAttrs::RandomNormalLikeAttrs,
1239 OperatorAttrs::GatherNDAttrs,
1240 OperatorAttrs::GeluAttrs,
1241 OperatorAttrs::EinsumAttrs,
1242 OperatorAttrs::IfAttrs,
1243 OperatorAttrs::PadAttrs,
1244 OperatorAttrs::DequantizeLinearAttrs,
1245 OperatorAttrs::QuantizeLinearAttrs,
1246 OperatorAttrs::DepthToSpaceAttrs,
1247 OperatorAttrs::CastLikeAttrs,
1248 OperatorAttrs::ShapeAttrs,
1249 OperatorAttrs::DropoutAttrs,
1250 OperatorAttrs::EyeLikeAttrs,
1251 OperatorAttrs::IsInfAttrs,
1252 OperatorAttrs::LoopAttrs,
1253 OperatorAttrs::SequenceEmptyAttrs,
1254 OperatorAttrs::ConcatFromSequenceAttrs,
1255 OperatorAttrs::SplitToSequenceAttrs,
1256 OperatorAttrs::GridSampleAttrs,
1257 OperatorAttrs::STFTAttrs,
1258];
1259
1260#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1261#[repr(transparent)]
1262pub struct OperatorAttrs(pub u8);
1263#[allow(non_upper_case_globals)]
1264impl OperatorAttrs {
1265 pub const NONE: Self = Self(0);
1266 pub const ArgMaxAttrs: Self = Self(1);
1267 pub const AveragePoolAttrs: Self = Self(2);
1268 pub const BatchNormalizationAttrs: Self = Self(3);
1269 pub const CastAttrs: Self = Self(4);
1270 pub const ConcatAttrs: Self = Self(5);
1271 pub const ConstantOfShapeAttrs: Self = Self(6);
1272 pub const ConvAttrs: Self = Self(7);
1273 pub const ConvTransposeAttrs: Self = Self(8);
1274 pub const FlattenAttrs: Self = Self(9);
1275 pub const GatherAttrs: Self = Self(10);
1276 pub const GemmAttrs: Self = Self(11);
1277 pub const GRUAttrs: Self = Self(12);
1278 pub const LeakyReluAttrs: Self = Self(13);
1279 pub const LSTMAttrs: Self = Self(14);
1280 pub const MaxPoolAttrs: Self = Self(15);
1281 pub const ReduceMeanAttrs: Self = Self(16);
1282 pub const ReshapeAttrs: Self = Self(17);
1283 pub const ResizeAttrs: Self = Self(18);
1284 pub const SplitAttrs: Self = Self(19);
1285 pub const SoftmaxAttrs: Self = Self(20);
1286 pub const TransposeAttrs: Self = Self(21);
1287 pub const ModAttrs: Self = Self(22);
1288 pub const ScatterElementsAttrs: Self = Self(23);
1289 pub const OneHotAttrs: Self = Self(24);
1290 pub const TopKAttrs: Self = Self(25);
1291 pub const HardSigmoidAttrs: Self = Self(26);
1292 pub const TriluAttrs: Self = Self(27);
1293 pub const ScatterNDAttrs: Self = Self(28);
1294 pub const NonMaxSuppressionAttrs: Self = Self(29);
1295 pub const LayerNormalizationAttrs: Self = Self(30);
1296 pub const RandomUniformAttrs: Self = Self(31);
1297 pub const EluAttrs: Self = Self(32);
1298 pub const RandomUniformLikeAttrs: Self = Self(33);
1299 pub const RandomNormalAttrs: Self = Self(34);
1300 pub const RandomNormalLikeAttrs: Self = Self(35);
1301 pub const GatherNDAttrs: Self = Self(36);
1302 pub const GeluAttrs: Self = Self(37);
1303 pub const EinsumAttrs: Self = Self(38);
1304 pub const IfAttrs: Self = Self(39);
1305 pub const PadAttrs: Self = Self(40);
1306 pub const DequantizeLinearAttrs: Self = Self(41);
1307 pub const QuantizeLinearAttrs: Self = Self(42);
1308 pub const DepthToSpaceAttrs: Self = Self(43);
1309 pub const CastLikeAttrs: Self = Self(44);
1310 pub const ShapeAttrs: Self = Self(45);
1311 pub const DropoutAttrs: Self = Self(46);
1312 pub const EyeLikeAttrs: Self = Self(47);
1313 pub const IsInfAttrs: Self = Self(48);
1314 pub const LoopAttrs: Self = Self(49);
1315 pub const SequenceEmptyAttrs: Self = Self(50);
1316 pub const ConcatFromSequenceAttrs: Self = Self(51);
1317 pub const SplitToSequenceAttrs: Self = Self(52);
1318 pub const GridSampleAttrs: Self = Self(53);
1319 pub const STFTAttrs: Self = Self(54);
1320
1321 pub const ENUM_MIN: u8 = 0;
1322 pub const ENUM_MAX: u8 = 54;
1323 pub const ENUM_VALUES: &'static [Self] = &[
1324 Self::NONE,
1325 Self::ArgMaxAttrs,
1326 Self::AveragePoolAttrs,
1327 Self::BatchNormalizationAttrs,
1328 Self::CastAttrs,
1329 Self::ConcatAttrs,
1330 Self::ConstantOfShapeAttrs,
1331 Self::ConvAttrs,
1332 Self::ConvTransposeAttrs,
1333 Self::FlattenAttrs,
1334 Self::GatherAttrs,
1335 Self::GemmAttrs,
1336 Self::GRUAttrs,
1337 Self::LeakyReluAttrs,
1338 Self::LSTMAttrs,
1339 Self::MaxPoolAttrs,
1340 Self::ReduceMeanAttrs,
1341 Self::ReshapeAttrs,
1342 Self::ResizeAttrs,
1343 Self::SplitAttrs,
1344 Self::SoftmaxAttrs,
1345 Self::TransposeAttrs,
1346 Self::ModAttrs,
1347 Self::ScatterElementsAttrs,
1348 Self::OneHotAttrs,
1349 Self::TopKAttrs,
1350 Self::HardSigmoidAttrs,
1351 Self::TriluAttrs,
1352 Self::ScatterNDAttrs,
1353 Self::NonMaxSuppressionAttrs,
1354 Self::LayerNormalizationAttrs,
1355 Self::RandomUniformAttrs,
1356 Self::EluAttrs,
1357 Self::RandomUniformLikeAttrs,
1358 Self::RandomNormalAttrs,
1359 Self::RandomNormalLikeAttrs,
1360 Self::GatherNDAttrs,
1361 Self::GeluAttrs,
1362 Self::EinsumAttrs,
1363 Self::IfAttrs,
1364 Self::PadAttrs,
1365 Self::DequantizeLinearAttrs,
1366 Self::QuantizeLinearAttrs,
1367 Self::DepthToSpaceAttrs,
1368 Self::CastLikeAttrs,
1369 Self::ShapeAttrs,
1370 Self::DropoutAttrs,
1371 Self::EyeLikeAttrs,
1372 Self::IsInfAttrs,
1373 Self::LoopAttrs,
1374 Self::SequenceEmptyAttrs,
1375 Self::ConcatFromSequenceAttrs,
1376 Self::SplitToSequenceAttrs,
1377 Self::GridSampleAttrs,
1378 Self::STFTAttrs,
1379 ];
1380 pub fn variant_name(self) -> Option<&'static str> {
1382 match self {
1383 Self::NONE => Some("NONE"),
1384 Self::ArgMaxAttrs => Some("ArgMaxAttrs"),
1385 Self::AveragePoolAttrs => Some("AveragePoolAttrs"),
1386 Self::BatchNormalizationAttrs => Some("BatchNormalizationAttrs"),
1387 Self::CastAttrs => Some("CastAttrs"),
1388 Self::ConcatAttrs => Some("ConcatAttrs"),
1389 Self::ConstantOfShapeAttrs => Some("ConstantOfShapeAttrs"),
1390 Self::ConvAttrs => Some("ConvAttrs"),
1391 Self::ConvTransposeAttrs => Some("ConvTransposeAttrs"),
1392 Self::FlattenAttrs => Some("FlattenAttrs"),
1393 Self::GatherAttrs => Some("GatherAttrs"),
1394 Self::GemmAttrs => Some("GemmAttrs"),
1395 Self::GRUAttrs => Some("GRUAttrs"),
1396 Self::LeakyReluAttrs => Some("LeakyReluAttrs"),
1397 Self::LSTMAttrs => Some("LSTMAttrs"),
1398 Self::MaxPoolAttrs => Some("MaxPoolAttrs"),
1399 Self::ReduceMeanAttrs => Some("ReduceMeanAttrs"),
1400 Self::ReshapeAttrs => Some("ReshapeAttrs"),
1401 Self::ResizeAttrs => Some("ResizeAttrs"),
1402 Self::SplitAttrs => Some("SplitAttrs"),
1403 Self::SoftmaxAttrs => Some("SoftmaxAttrs"),
1404 Self::TransposeAttrs => Some("TransposeAttrs"),
1405 Self::ModAttrs => Some("ModAttrs"),
1406 Self::ScatterElementsAttrs => Some("ScatterElementsAttrs"),
1407 Self::OneHotAttrs => Some("OneHotAttrs"),
1408 Self::TopKAttrs => Some("TopKAttrs"),
1409 Self::HardSigmoidAttrs => Some("HardSigmoidAttrs"),
1410 Self::TriluAttrs => Some("TriluAttrs"),
1411 Self::ScatterNDAttrs => Some("ScatterNDAttrs"),
1412 Self::NonMaxSuppressionAttrs => Some("NonMaxSuppressionAttrs"),
1413 Self::LayerNormalizationAttrs => Some("LayerNormalizationAttrs"),
1414 Self::RandomUniformAttrs => Some("RandomUniformAttrs"),
1415 Self::EluAttrs => Some("EluAttrs"),
1416 Self::RandomUniformLikeAttrs => Some("RandomUniformLikeAttrs"),
1417 Self::RandomNormalAttrs => Some("RandomNormalAttrs"),
1418 Self::RandomNormalLikeAttrs => Some("RandomNormalLikeAttrs"),
1419 Self::GatherNDAttrs => Some("GatherNDAttrs"),
1420 Self::GeluAttrs => Some("GeluAttrs"),
1421 Self::EinsumAttrs => Some("EinsumAttrs"),
1422 Self::IfAttrs => Some("IfAttrs"),
1423 Self::PadAttrs => Some("PadAttrs"),
1424 Self::DequantizeLinearAttrs => Some("DequantizeLinearAttrs"),
1425 Self::QuantizeLinearAttrs => Some("QuantizeLinearAttrs"),
1426 Self::DepthToSpaceAttrs => Some("DepthToSpaceAttrs"),
1427 Self::CastLikeAttrs => Some("CastLikeAttrs"),
1428 Self::ShapeAttrs => Some("ShapeAttrs"),
1429 Self::DropoutAttrs => Some("DropoutAttrs"),
1430 Self::EyeLikeAttrs => Some("EyeLikeAttrs"),
1431 Self::IsInfAttrs => Some("IsInfAttrs"),
1432 Self::LoopAttrs => Some("LoopAttrs"),
1433 Self::SequenceEmptyAttrs => Some("SequenceEmptyAttrs"),
1434 Self::ConcatFromSequenceAttrs => Some("ConcatFromSequenceAttrs"),
1435 Self::SplitToSequenceAttrs => Some("SplitToSequenceAttrs"),
1436 Self::GridSampleAttrs => Some("GridSampleAttrs"),
1437 Self::STFTAttrs => Some("STFTAttrs"),
1438 _ => None,
1439 }
1440 }
1441}
1442impl core::fmt::Debug for OperatorAttrs {
1443 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1444 if let Some(name) = self.variant_name() {
1445 f.write_str(name)
1446 } else {
1447 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1448 }
1449 }
1450}
1451impl<'a> flatbuffers::Follow<'a> for OperatorAttrs {
1452 type Inner = Self;
1453 #[inline]
1454 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1455 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
1456 Self(b)
1457 }
1458}
1459
1460impl flatbuffers::Push for OperatorAttrs {
1461 type Output = OperatorAttrs;
1462 #[inline]
1463 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1464 flatbuffers::emplace_scalar::<u8>(dst, self.0);
1465 }
1466}
1467
1468impl flatbuffers::EndianScalar for OperatorAttrs {
1469 type Scalar = u8;
1470 #[inline]
1471 fn to_little_endian(self) -> u8 {
1472 self.0.to_le()
1473 }
1474 #[inline]
1475 #[allow(clippy::wrong_self_convention)]
1476 fn from_little_endian(v: u8) -> Self {
1477 let b = u8::from_le(v);
1478 Self(b)
1479 }
1480}
1481
1482impl<'a> flatbuffers::Verifiable for OperatorAttrs {
1483 #[inline]
1484 fn run_verifier(
1485 v: &mut flatbuffers::Verifier,
1486 pos: usize,
1487 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1488 use self::flatbuffers::Verifiable;
1489 u8::run_verifier(v, pos)
1490 }
1491}
1492
1493impl flatbuffers::SimpleToVerifyInSlice for OperatorAttrs {}
1494pub struct OperatorAttrsUnionTableOffset {}
1495
1496#[deprecated(
1497 since = "2.0.0",
1498 note = "Use associated constants instead. This will no longer be generated in 2021."
1499)]
1500pub const ENUM_MIN_DEPTH_TO_SPACE_MODE: u8 = 0;
1501#[deprecated(
1502 since = "2.0.0",
1503 note = "Use associated constants instead. This will no longer be generated in 2021."
1504)]
1505pub const ENUM_MAX_DEPTH_TO_SPACE_MODE: u8 = 1;
1506#[deprecated(
1507 since = "2.0.0",
1508 note = "Use associated constants instead. This will no longer be generated in 2021."
1509)]
1510#[allow(non_camel_case_types)]
1511pub const ENUM_VALUES_DEPTH_TO_SPACE_MODE: [DepthToSpaceMode; 2] =
1512 [DepthToSpaceMode::DCR, DepthToSpaceMode::CRD];
1513
1514#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1515#[repr(transparent)]
1516pub struct DepthToSpaceMode(pub u8);
1517#[allow(non_upper_case_globals)]
1518impl DepthToSpaceMode {
1519 pub const DCR: Self = Self(0);
1520 pub const CRD: Self = Self(1);
1521
1522 pub const ENUM_MIN: u8 = 0;
1523 pub const ENUM_MAX: u8 = 1;
1524 pub const ENUM_VALUES: &'static [Self] = &[Self::DCR, Self::CRD];
1525 pub fn variant_name(self) -> Option<&'static str> {
1527 match self {
1528 Self::DCR => Some("DCR"),
1529 Self::CRD => Some("CRD"),
1530 _ => None,
1531 }
1532 }
1533}
1534impl core::fmt::Debug for DepthToSpaceMode {
1535 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1536 if let Some(name) = self.variant_name() {
1537 f.write_str(name)
1538 } else {
1539 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1540 }
1541 }
1542}
1543impl<'a> flatbuffers::Follow<'a> for DepthToSpaceMode {
1544 type Inner = Self;
1545 #[inline]
1546 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1547 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
1548 Self(b)
1549 }
1550}
1551
1552impl flatbuffers::Push for DepthToSpaceMode {
1553 type Output = DepthToSpaceMode;
1554 #[inline]
1555 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1556 flatbuffers::emplace_scalar::<u8>(dst, self.0);
1557 }
1558}
1559
1560impl flatbuffers::EndianScalar for DepthToSpaceMode {
1561 type Scalar = u8;
1562 #[inline]
1563 fn to_little_endian(self) -> u8 {
1564 self.0.to_le()
1565 }
1566 #[inline]
1567 #[allow(clippy::wrong_self_convention)]
1568 fn from_little_endian(v: u8) -> Self {
1569 let b = u8::from_le(v);
1570 Self(b)
1571 }
1572}
1573
1574impl<'a> flatbuffers::Verifiable for DepthToSpaceMode {
1575 #[inline]
1576 fn run_verifier(
1577 v: &mut flatbuffers::Verifier,
1578 pos: usize,
1579 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1580 use self::flatbuffers::Verifiable;
1581 u8::run_verifier(v, pos)
1582 }
1583}
1584
1585impl flatbuffers::SimpleToVerifyInSlice for DepthToSpaceMode {}
1586#[deprecated(
1587 since = "2.0.0",
1588 note = "Use associated constants instead. This will no longer be generated in 2021."
1589)]
1590pub const ENUM_MIN_SCALAR: u8 = 0;
1591#[deprecated(
1592 since = "2.0.0",
1593 note = "Use associated constants instead. This will no longer be generated in 2021."
1594)]
1595pub const ENUM_MAX_SCALAR: u8 = 2;
1596#[deprecated(
1597 since = "2.0.0",
1598 note = "Use associated constants instead. This will no longer be generated in 2021."
1599)]
1600#[allow(non_camel_case_types)]
1601pub const ENUM_VALUES_SCALAR: [Scalar; 3] = [Scalar::NONE, Scalar::IntScalar, Scalar::FloatScalar];
1602
1603#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1604#[repr(transparent)]
1605pub struct Scalar(pub u8);
1606#[allow(non_upper_case_globals)]
1607impl Scalar {
1608 pub const NONE: Self = Self(0);
1609 pub const IntScalar: Self = Self(1);
1610 pub const FloatScalar: Self = Self(2);
1611
1612 pub const ENUM_MIN: u8 = 0;
1613 pub const ENUM_MAX: u8 = 2;
1614 pub const ENUM_VALUES: &'static [Self] = &[Self::NONE, Self::IntScalar, Self::FloatScalar];
1615 pub fn variant_name(self) -> Option<&'static str> {
1617 match self {
1618 Self::NONE => Some("NONE"),
1619 Self::IntScalar => Some("IntScalar"),
1620 Self::FloatScalar => Some("FloatScalar"),
1621 _ => None,
1622 }
1623 }
1624}
1625impl core::fmt::Debug for Scalar {
1626 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1627 if let Some(name) = self.variant_name() {
1628 f.write_str(name)
1629 } else {
1630 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1631 }
1632 }
1633}
1634impl<'a> flatbuffers::Follow<'a> for Scalar {
1635 type Inner = Self;
1636 #[inline]
1637 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1638 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
1639 Self(b)
1640 }
1641}
1642
1643impl flatbuffers::Push for Scalar {
1644 type Output = Scalar;
1645 #[inline]
1646 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1647 flatbuffers::emplace_scalar::<u8>(dst, self.0);
1648 }
1649}
1650
1651impl flatbuffers::EndianScalar for Scalar {
1652 type Scalar = u8;
1653 #[inline]
1654 fn to_little_endian(self) -> u8 {
1655 self.0.to_le()
1656 }
1657 #[inline]
1658 #[allow(clippy::wrong_self_convention)]
1659 fn from_little_endian(v: u8) -> Self {
1660 let b = u8::from_le(v);
1661 Self(b)
1662 }
1663}
1664
1665impl<'a> flatbuffers::Verifiable for Scalar {
1666 #[inline]
1667 fn run_verifier(
1668 v: &mut flatbuffers::Verifier,
1669 pos: usize,
1670 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1671 use self::flatbuffers::Verifiable;
1672 u8::run_verifier(v, pos)
1673 }
1674}
1675
1676impl flatbuffers::SimpleToVerifyInSlice for Scalar {}
1677pub struct ScalarUnionTableOffset {}
1678
1679#[deprecated(
1680 since = "2.0.0",
1681 note = "Use associated constants instead. This will no longer be generated in 2021."
1682)]
1683pub const ENUM_MIN_GELU_APPROXIMATION: u8 = 0;
1684#[deprecated(
1685 since = "2.0.0",
1686 note = "Use associated constants instead. This will no longer be generated in 2021."
1687)]
1688pub const ENUM_MAX_GELU_APPROXIMATION: u8 = 1;
1689#[deprecated(
1690 since = "2.0.0",
1691 note = "Use associated constants instead. This will no longer be generated in 2021."
1692)]
1693#[allow(non_camel_case_types)]
1694pub const ENUM_VALUES_GELU_APPROXIMATION: [GeluApproximation; 2] =
1695 [GeluApproximation::None, GeluApproximation::Tanh];
1696
1697#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1698#[repr(transparent)]
1699pub struct GeluApproximation(pub u8);
1700#[allow(non_upper_case_globals)]
1701impl GeluApproximation {
1702 pub const None: Self = Self(0);
1703 pub const Tanh: Self = Self(1);
1704
1705 pub const ENUM_MIN: u8 = 0;
1706 pub const ENUM_MAX: u8 = 1;
1707 pub const ENUM_VALUES: &'static [Self] = &[Self::None, Self::Tanh];
1708 pub fn variant_name(self) -> Option<&'static str> {
1710 match self {
1711 Self::None => Some("None"),
1712 Self::Tanh => Some("Tanh"),
1713 _ => None,
1714 }
1715 }
1716}
1717impl core::fmt::Debug for GeluApproximation {
1718 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1719 if let Some(name) = self.variant_name() {
1720 f.write_str(name)
1721 } else {
1722 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1723 }
1724 }
1725}
1726impl<'a> flatbuffers::Follow<'a> for GeluApproximation {
1727 type Inner = Self;
1728 #[inline]
1729 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1730 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
1731 Self(b)
1732 }
1733}
1734
1735impl flatbuffers::Push for GeluApproximation {
1736 type Output = GeluApproximation;
1737 #[inline]
1738 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1739 flatbuffers::emplace_scalar::<u8>(dst, self.0);
1740 }
1741}
1742
1743impl flatbuffers::EndianScalar for GeluApproximation {
1744 type Scalar = u8;
1745 #[inline]
1746 fn to_little_endian(self) -> u8 {
1747 self.0.to_le()
1748 }
1749 #[inline]
1750 #[allow(clippy::wrong_self_convention)]
1751 fn from_little_endian(v: u8) -> Self {
1752 let b = u8::from_le(v);
1753 Self(b)
1754 }
1755}
1756
1757impl<'a> flatbuffers::Verifiable for GeluApproximation {
1758 #[inline]
1759 fn run_verifier(
1760 v: &mut flatbuffers::Verifier,
1761 pos: usize,
1762 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1763 use self::flatbuffers::Verifiable;
1764 u8::run_verifier(v, pos)
1765 }
1766}
1767
1768impl flatbuffers::SimpleToVerifyInSlice for GeluApproximation {}
1769#[deprecated(
1770 since = "2.0.0",
1771 note = "Use associated constants instead. This will no longer be generated in 2021."
1772)]
1773pub const ENUM_MIN_NMSBOX_ORDER: u8 = 0;
1774#[deprecated(
1775 since = "2.0.0",
1776 note = "Use associated constants instead. This will no longer be generated in 2021."
1777)]
1778pub const ENUM_MAX_NMSBOX_ORDER: u8 = 1;
1779#[deprecated(
1780 since = "2.0.0",
1781 note = "Use associated constants instead. This will no longer be generated in 2021."
1782)]
1783#[allow(non_camel_case_types)]
1784pub const ENUM_VALUES_NMSBOX_ORDER: [NMSBoxOrder; 2] = [
1785 NMSBoxOrder::TopLeftBottomRight,
1786 NMSBoxOrder::CenterWidthHeight,
1787];
1788
1789#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1790#[repr(transparent)]
1791pub struct NMSBoxOrder(pub u8);
1792#[allow(non_upper_case_globals)]
1793impl NMSBoxOrder {
1794 pub const TopLeftBottomRight: Self = Self(0);
1795 pub const CenterWidthHeight: Self = Self(1);
1796
1797 pub const ENUM_MIN: u8 = 0;
1798 pub const ENUM_MAX: u8 = 1;
1799 pub const ENUM_VALUES: &'static [Self] = &[Self::TopLeftBottomRight, Self::CenterWidthHeight];
1800 pub fn variant_name(self) -> Option<&'static str> {
1802 match self {
1803 Self::TopLeftBottomRight => Some("TopLeftBottomRight"),
1804 Self::CenterWidthHeight => Some("CenterWidthHeight"),
1805 _ => None,
1806 }
1807 }
1808}
1809impl core::fmt::Debug for NMSBoxOrder {
1810 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1811 if let Some(name) = self.variant_name() {
1812 f.write_str(name)
1813 } else {
1814 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1815 }
1816 }
1817}
1818impl<'a> flatbuffers::Follow<'a> for NMSBoxOrder {
1819 type Inner = Self;
1820 #[inline]
1821 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1822 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
1823 Self(b)
1824 }
1825}
1826
1827impl flatbuffers::Push for NMSBoxOrder {
1828 type Output = NMSBoxOrder;
1829 #[inline]
1830 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1831 flatbuffers::emplace_scalar::<u8>(dst, self.0);
1832 }
1833}
1834
1835impl flatbuffers::EndianScalar for NMSBoxOrder {
1836 type Scalar = u8;
1837 #[inline]
1838 fn to_little_endian(self) -> u8 {
1839 self.0.to_le()
1840 }
1841 #[inline]
1842 #[allow(clippy::wrong_self_convention)]
1843 fn from_little_endian(v: u8) -> Self {
1844 let b = u8::from_le(v);
1845 Self(b)
1846 }
1847}
1848
1849impl<'a> flatbuffers::Verifiable for NMSBoxOrder {
1850 #[inline]
1851 fn run_verifier(
1852 v: &mut flatbuffers::Verifier,
1853 pos: usize,
1854 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1855 use self::flatbuffers::Verifiable;
1856 u8::run_verifier(v, pos)
1857 }
1858}
1859
1860impl flatbuffers::SimpleToVerifyInSlice for NMSBoxOrder {}
1861#[deprecated(
1862 since = "2.0.0",
1863 note = "Use associated constants instead. This will no longer be generated in 2021."
1864)]
1865pub const ENUM_MIN_PAD_MODE: u8 = 0;
1866#[deprecated(
1867 since = "2.0.0",
1868 note = "Use associated constants instead. This will no longer be generated in 2021."
1869)]
1870pub const ENUM_MAX_PAD_MODE: u8 = 3;
1871#[deprecated(
1872 since = "2.0.0",
1873 note = "Use associated constants instead. This will no longer be generated in 2021."
1874)]
1875#[allow(non_camel_case_types)]
1876pub const ENUM_VALUES_PAD_MODE: [PadMode; 4] = [
1877 PadMode::Constant,
1878 PadMode::Reflect,
1879 PadMode::Edge,
1880 PadMode::Wrap,
1881];
1882
1883#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1884#[repr(transparent)]
1885pub struct PadMode(pub u8);
1886#[allow(non_upper_case_globals)]
1887impl PadMode {
1888 pub const Constant: Self = Self(0);
1889 pub const Reflect: Self = Self(1);
1890 pub const Edge: Self = Self(2);
1891 pub const Wrap: Self = Self(3);
1892
1893 pub const ENUM_MIN: u8 = 0;
1894 pub const ENUM_MAX: u8 = 3;
1895 pub const ENUM_VALUES: &'static [Self] =
1896 &[Self::Constant, Self::Reflect, Self::Edge, Self::Wrap];
1897 pub fn variant_name(self) -> Option<&'static str> {
1899 match self {
1900 Self::Constant => Some("Constant"),
1901 Self::Reflect => Some("Reflect"),
1902 Self::Edge => Some("Edge"),
1903 Self::Wrap => Some("Wrap"),
1904 _ => None,
1905 }
1906 }
1907}
1908impl core::fmt::Debug for PadMode {
1909 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1910 if let Some(name) = self.variant_name() {
1911 f.write_str(name)
1912 } else {
1913 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1914 }
1915 }
1916}
1917impl<'a> flatbuffers::Follow<'a> for PadMode {
1918 type Inner = Self;
1919 #[inline]
1920 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1921 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
1922 Self(b)
1923 }
1924}
1925
1926impl flatbuffers::Push for PadMode {
1927 type Output = PadMode;
1928 #[inline]
1929 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1930 flatbuffers::emplace_scalar::<u8>(dst, self.0);
1931 }
1932}
1933
1934impl flatbuffers::EndianScalar for PadMode {
1935 type Scalar = u8;
1936 #[inline]
1937 fn to_little_endian(self) -> u8 {
1938 self.0.to_le()
1939 }
1940 #[inline]
1941 #[allow(clippy::wrong_self_convention)]
1942 fn from_little_endian(v: u8) -> Self {
1943 let b = u8::from_le(v);
1944 Self(b)
1945 }
1946}
1947
1948impl<'a> flatbuffers::Verifiable for PadMode {
1949 #[inline]
1950 fn run_verifier(
1951 v: &mut flatbuffers::Verifier,
1952 pos: usize,
1953 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1954 use self::flatbuffers::Verifiable;
1955 u8::run_verifier(v, pos)
1956 }
1957}
1958
1959impl flatbuffers::SimpleToVerifyInSlice for PadMode {}
1960#[deprecated(
1961 since = "2.0.0",
1962 note = "Use associated constants instead. This will no longer be generated in 2021."
1963)]
1964pub const ENUM_MIN_SCATTER_REDUCTION: u8 = 0;
1965#[deprecated(
1966 since = "2.0.0",
1967 note = "Use associated constants instead. This will no longer be generated in 2021."
1968)]
1969pub const ENUM_MAX_SCATTER_REDUCTION: u8 = 4;
1970#[deprecated(
1971 since = "2.0.0",
1972 note = "Use associated constants instead. This will no longer be generated in 2021."
1973)]
1974#[allow(non_camel_case_types)]
1975pub const ENUM_VALUES_SCATTER_REDUCTION: [ScatterReduction; 5] = [
1976 ScatterReduction::None,
1977 ScatterReduction::Add,
1978 ScatterReduction::Mul,
1979 ScatterReduction::Min,
1980 ScatterReduction::Max,
1981];
1982
1983#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1984#[repr(transparent)]
1985pub struct ScatterReduction(pub u8);
1986#[allow(non_upper_case_globals)]
1987impl ScatterReduction {
1988 pub const None: Self = Self(0);
1989 pub const Add: Self = Self(1);
1990 pub const Mul: Self = Self(2);
1991 pub const Min: Self = Self(3);
1992 pub const Max: Self = Self(4);
1993
1994 pub const ENUM_MIN: u8 = 0;
1995 pub const ENUM_MAX: u8 = 4;
1996 pub const ENUM_VALUES: &'static [Self] =
1997 &[Self::None, Self::Add, Self::Mul, Self::Min, Self::Max];
1998 pub fn variant_name(self) -> Option<&'static str> {
2000 match self {
2001 Self::None => Some("None"),
2002 Self::Add => Some("Add"),
2003 Self::Mul => Some("Mul"),
2004 Self::Min => Some("Min"),
2005 Self::Max => Some("Max"),
2006 _ => None,
2007 }
2008 }
2009}
2010impl core::fmt::Debug for ScatterReduction {
2011 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2012 if let Some(name) = self.variant_name() {
2013 f.write_str(name)
2014 } else {
2015 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
2016 }
2017 }
2018}
2019impl<'a> flatbuffers::Follow<'a> for ScatterReduction {
2020 type Inner = Self;
2021 #[inline]
2022 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2023 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
2024 Self(b)
2025 }
2026}
2027
2028impl flatbuffers::Push for ScatterReduction {
2029 type Output = ScatterReduction;
2030 #[inline]
2031 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
2032 flatbuffers::emplace_scalar::<u8>(dst, self.0);
2033 }
2034}
2035
2036impl flatbuffers::EndianScalar for ScatterReduction {
2037 type Scalar = u8;
2038 #[inline]
2039 fn to_little_endian(self) -> u8 {
2040 self.0.to_le()
2041 }
2042 #[inline]
2043 #[allow(clippy::wrong_self_convention)]
2044 fn from_little_endian(v: u8) -> Self {
2045 let b = u8::from_le(v);
2046 Self(b)
2047 }
2048}
2049
2050impl<'a> flatbuffers::Verifiable for ScatterReduction {
2051 #[inline]
2052 fn run_verifier(
2053 v: &mut flatbuffers::Verifier,
2054 pos: usize,
2055 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2056 use self::flatbuffers::Verifiable;
2057 u8::run_verifier(v, pos)
2058 }
2059}
2060
2061impl flatbuffers::SimpleToVerifyInSlice for ScatterReduction {}
2062#[deprecated(
2063 since = "2.0.0",
2064 note = "Use associated constants instead. This will no longer be generated in 2021."
2065)]
2066pub const ENUM_MIN_NODE_KIND: u8 = 0;
2067#[deprecated(
2068 since = "2.0.0",
2069 note = "Use associated constants instead. This will no longer be generated in 2021."
2070)]
2071pub const ENUM_MAX_NODE_KIND: u8 = 3;
2072#[deprecated(
2073 since = "2.0.0",
2074 note = "Use associated constants instead. This will no longer be generated in 2021."
2075)]
2076#[allow(non_camel_case_types)]
2077pub const ENUM_VALUES_NODE_KIND: [NodeKind; 4] = [
2078 NodeKind::NONE,
2079 NodeKind::OperatorNode,
2080 NodeKind::ConstantNode,
2081 NodeKind::ValueNode,
2082];
2083
2084#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
2085#[repr(transparent)]
2086pub struct NodeKind(pub u8);
2087#[allow(non_upper_case_globals)]
2088impl NodeKind {
2089 pub const NONE: Self = Self(0);
2090 pub const OperatorNode: Self = Self(1);
2091 pub const ConstantNode: Self = Self(2);
2092 pub const ValueNode: Self = Self(3);
2093
2094 pub const ENUM_MIN: u8 = 0;
2095 pub const ENUM_MAX: u8 = 3;
2096 pub const ENUM_VALUES: &'static [Self] = &[
2097 Self::NONE,
2098 Self::OperatorNode,
2099 Self::ConstantNode,
2100 Self::ValueNode,
2101 ];
2102 pub fn variant_name(self) -> Option<&'static str> {
2104 match self {
2105 Self::NONE => Some("NONE"),
2106 Self::OperatorNode => Some("OperatorNode"),
2107 Self::ConstantNode => Some("ConstantNode"),
2108 Self::ValueNode => Some("ValueNode"),
2109 _ => None,
2110 }
2111 }
2112}
2113impl core::fmt::Debug for NodeKind {
2114 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2115 if let Some(name) = self.variant_name() {
2116 f.write_str(name)
2117 } else {
2118 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
2119 }
2120 }
2121}
2122impl<'a> flatbuffers::Follow<'a> for NodeKind {
2123 type Inner = Self;
2124 #[inline]
2125 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2126 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
2127 Self(b)
2128 }
2129}
2130
2131impl flatbuffers::Push for NodeKind {
2132 type Output = NodeKind;
2133 #[inline]
2134 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
2135 flatbuffers::emplace_scalar::<u8>(dst, self.0);
2136 }
2137}
2138
2139impl flatbuffers::EndianScalar for NodeKind {
2140 type Scalar = u8;
2141 #[inline]
2142 fn to_little_endian(self) -> u8 {
2143 self.0.to_le()
2144 }
2145 #[inline]
2146 #[allow(clippy::wrong_self_convention)]
2147 fn from_little_endian(v: u8) -> Self {
2148 let b = u8::from_le(v);
2149 Self(b)
2150 }
2151}
2152
2153impl<'a> flatbuffers::Verifiable for NodeKind {
2154 #[inline]
2155 fn run_verifier(
2156 v: &mut flatbuffers::Verifier,
2157 pos: usize,
2158 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2159 use self::flatbuffers::Verifiable;
2160 u8::run_verifier(v, pos)
2161 }
2162}
2163
2164impl flatbuffers::SimpleToVerifyInSlice for NodeKind {}
2165pub struct NodeKindUnionTableOffset {}
2166
2167#[deprecated(
2168 since = "2.0.0",
2169 note = "Use associated constants instead. This will no longer be generated in 2021."
2170)]
2171pub const ENUM_MIN_CONSTANT_DATA: u8 = 0;
2172#[deprecated(
2173 since = "2.0.0",
2174 note = "Use associated constants instead. This will no longer be generated in 2021."
2175)]
2176pub const ENUM_MAX_CONSTANT_DATA: u8 = 4;
2177#[deprecated(
2178 since = "2.0.0",
2179 note = "Use associated constants instead. This will no longer be generated in 2021."
2180)]
2181#[allow(non_camel_case_types)]
2182pub const ENUM_VALUES_CONSTANT_DATA: [ConstantData; 5] = [
2183 ConstantData::NONE,
2184 ConstantData::FloatData,
2185 ConstantData::Int32Data,
2186 ConstantData::Int8Data,
2187 ConstantData::UInt8Data,
2188];
2189
2190#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
2191#[repr(transparent)]
2192pub struct ConstantData(pub u8);
2193#[allow(non_upper_case_globals)]
2194impl ConstantData {
2195 pub const NONE: Self = Self(0);
2196 pub const FloatData: Self = Self(1);
2197 pub const Int32Data: Self = Self(2);
2198 pub const Int8Data: Self = Self(3);
2199 pub const UInt8Data: Self = Self(4);
2200
2201 pub const ENUM_MIN: u8 = 0;
2202 pub const ENUM_MAX: u8 = 4;
2203 pub const ENUM_VALUES: &'static [Self] = &[
2204 Self::NONE,
2205 Self::FloatData,
2206 Self::Int32Data,
2207 Self::Int8Data,
2208 Self::UInt8Data,
2209 ];
2210 pub fn variant_name(self) -> Option<&'static str> {
2212 match self {
2213 Self::NONE => Some("NONE"),
2214 Self::FloatData => Some("FloatData"),
2215 Self::Int32Data => Some("Int32Data"),
2216 Self::Int8Data => Some("Int8Data"),
2217 Self::UInt8Data => Some("UInt8Data"),
2218 _ => None,
2219 }
2220 }
2221}
2222impl core::fmt::Debug for ConstantData {
2223 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2224 if let Some(name) = self.variant_name() {
2225 f.write_str(name)
2226 } else {
2227 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
2228 }
2229 }
2230}
2231impl<'a> flatbuffers::Follow<'a> for ConstantData {
2232 type Inner = Self;
2233 #[inline]
2234 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2235 let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
2236 Self(b)
2237 }
2238}
2239
2240impl flatbuffers::Push for ConstantData {
2241 type Output = ConstantData;
2242 #[inline]
2243 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
2244 flatbuffers::emplace_scalar::<u8>(dst, self.0);
2245 }
2246}
2247
2248impl flatbuffers::EndianScalar for ConstantData {
2249 type Scalar = u8;
2250 #[inline]
2251 fn to_little_endian(self) -> u8 {
2252 self.0.to_le()
2253 }
2254 #[inline]
2255 #[allow(clippy::wrong_self_convention)]
2256 fn from_little_endian(v: u8) -> Self {
2257 let b = u8::from_le(v);
2258 Self(b)
2259 }
2260}
2261
2262impl<'a> flatbuffers::Verifiable for ConstantData {
2263 #[inline]
2264 fn run_verifier(
2265 v: &mut flatbuffers::Verifier,
2266 pos: usize,
2267 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2268 use self::flatbuffers::Verifiable;
2269 u8::run_verifier(v, pos)
2270 }
2271}
2272
2273impl flatbuffers::SimpleToVerifyInSlice for ConstantData {}
2274pub struct ConstantDataUnionTableOffset {}
2275
2276#[deprecated(
2277 since = "2.0.0",
2278 note = "Use associated constants instead. This will no longer be generated in 2021."
2279)]
2280pub const ENUM_MIN_CONSTANT_DATA_TYPE: u16 = 0;
2281#[deprecated(
2282 since = "2.0.0",
2283 note = "Use associated constants instead. This will no longer be generated in 2021."
2284)]
2285pub const ENUM_MAX_CONSTANT_DATA_TYPE: u16 = 3;
2286#[deprecated(
2287 since = "2.0.0",
2288 note = "Use associated constants instead. This will no longer be generated in 2021."
2289)]
2290#[allow(non_camel_case_types)]
2291pub const ENUM_VALUES_CONSTANT_DATA_TYPE: [ConstantDataType; 4] = [
2292 ConstantDataType::Int32,
2293 ConstantDataType::Float32,
2294 ConstantDataType::Int8,
2295 ConstantDataType::UInt8,
2296];
2297
2298#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
2299#[repr(transparent)]
2300pub struct ConstantDataType(pub u16);
2301#[allow(non_upper_case_globals)]
2302impl ConstantDataType {
2303 pub const Int32: Self = Self(0);
2304 pub const Float32: Self = Self(1);
2305 pub const Int8: Self = Self(2);
2306 pub const UInt8: Self = Self(3);
2307
2308 pub const ENUM_MIN: u16 = 0;
2309 pub const ENUM_MAX: u16 = 3;
2310 pub const ENUM_VALUES: &'static [Self] = &[Self::Int32, Self::Float32, Self::Int8, Self::UInt8];
2311 pub fn variant_name(self) -> Option<&'static str> {
2313 match self {
2314 Self::Int32 => Some("Int32"),
2315 Self::Float32 => Some("Float32"),
2316 Self::Int8 => Some("Int8"),
2317 Self::UInt8 => Some("UInt8"),
2318 _ => None,
2319 }
2320 }
2321}
2322impl core::fmt::Debug for ConstantDataType {
2323 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
2324 if let Some(name) = self.variant_name() {
2325 f.write_str(name)
2326 } else {
2327 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
2328 }
2329 }
2330}
2331impl<'a> flatbuffers::Follow<'a> for ConstantDataType {
2332 type Inner = Self;
2333 #[inline]
2334 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2335 let b = flatbuffers::read_scalar_at::<u16>(buf, loc);
2336 Self(b)
2337 }
2338}
2339
2340impl flatbuffers::Push for ConstantDataType {
2341 type Output = ConstantDataType;
2342 #[inline]
2343 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
2344 flatbuffers::emplace_scalar::<u16>(dst, self.0);
2345 }
2346}
2347
2348impl flatbuffers::EndianScalar for ConstantDataType {
2349 type Scalar = u16;
2350 #[inline]
2351 fn to_little_endian(self) -> u16 {
2352 self.0.to_le()
2353 }
2354 #[inline]
2355 #[allow(clippy::wrong_self_convention)]
2356 fn from_little_endian(v: u16) -> Self {
2357 let b = u16::from_le(v);
2358 Self(b)
2359 }
2360}
2361
2362impl<'a> flatbuffers::Verifiable for ConstantDataType {
2363 #[inline]
2364 fn run_verifier(
2365 v: &mut flatbuffers::Verifier,
2366 pos: usize,
2367 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2368 use self::flatbuffers::Verifiable;
2369 u16::run_verifier(v, pos)
2370 }
2371}
2372
2373impl flatbuffers::SimpleToVerifyInSlice for ConstantDataType {}
2374pub enum ArgMaxAttrsOffset {}
2375#[derive(Copy, Clone, PartialEq)]
2376
2377pub struct ArgMaxAttrs<'a> {
2378 pub _tab: flatbuffers::Table<'a>,
2379}
2380
2381impl<'a> flatbuffers::Follow<'a> for ArgMaxAttrs<'a> {
2382 type Inner = ArgMaxAttrs<'a>;
2383 #[inline]
2384 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2385 Self {
2386 _tab: flatbuffers::Table::new(buf, loc),
2387 }
2388 }
2389}
2390
2391impl<'a> ArgMaxAttrs<'a> {
2392 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
2393 pub const VT_KEEP_DIMS: flatbuffers::VOffsetT = 6;
2394
2395 #[inline]
2396 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2397 ArgMaxAttrs { _tab: table }
2398 }
2399 #[allow(unused_mut)]
2400 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2401 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2402 args: &'args ArgMaxAttrsArgs,
2403 ) -> flatbuffers::WIPOffset<ArgMaxAttrs<'bldr>> {
2404 let mut builder = ArgMaxAttrsBuilder::new(_fbb);
2405 builder.add_axis(args.axis);
2406 builder.add_keep_dims(args.keep_dims);
2407 builder.finish()
2408 }
2409
2410 #[inline]
2411 pub fn axis(&self) -> i32 {
2412 unsafe { self._tab.get::<i32>(ArgMaxAttrs::VT_AXIS, Some(0)).unwrap() }
2416 }
2417 #[inline]
2418 pub fn keep_dims(&self) -> bool {
2419 unsafe {
2423 self._tab
2424 .get::<bool>(ArgMaxAttrs::VT_KEEP_DIMS, Some(false))
2425 .unwrap()
2426 }
2427 }
2428}
2429
2430impl flatbuffers::Verifiable for ArgMaxAttrs<'_> {
2431 #[inline]
2432 fn run_verifier(
2433 v: &mut flatbuffers::Verifier,
2434 pos: usize,
2435 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2436 use self::flatbuffers::Verifiable;
2437 v.visit_table(pos)?
2438 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
2439 .visit_field::<bool>("keep_dims", Self::VT_KEEP_DIMS, false)?
2440 .finish();
2441 Ok(())
2442 }
2443}
2444pub struct ArgMaxAttrsArgs {
2445 pub axis: i32,
2446 pub keep_dims: bool,
2447}
2448impl<'a> Default for ArgMaxAttrsArgs {
2449 #[inline]
2450 fn default() -> Self {
2451 ArgMaxAttrsArgs {
2452 axis: 0,
2453 keep_dims: false,
2454 }
2455 }
2456}
2457
2458pub struct ArgMaxAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2459 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2460 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2461}
2462impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ArgMaxAttrsBuilder<'a, 'b, A> {
2463 #[inline]
2464 pub fn add_axis(&mut self, axis: i32) {
2465 self.fbb_.push_slot::<i32>(ArgMaxAttrs::VT_AXIS, axis, 0);
2466 }
2467 #[inline]
2468 pub fn add_keep_dims(&mut self, keep_dims: bool) {
2469 self.fbb_
2470 .push_slot::<bool>(ArgMaxAttrs::VT_KEEP_DIMS, keep_dims, false);
2471 }
2472 #[inline]
2473 pub fn new(
2474 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2475 ) -> ArgMaxAttrsBuilder<'a, 'b, A> {
2476 let start = _fbb.start_table();
2477 ArgMaxAttrsBuilder {
2478 fbb_: _fbb,
2479 start_: start,
2480 }
2481 }
2482 #[inline]
2483 pub fn finish(self) -> flatbuffers::WIPOffset<ArgMaxAttrs<'a>> {
2484 let o = self.fbb_.end_table(self.start_);
2485 flatbuffers::WIPOffset::new(o.value())
2486 }
2487}
2488
2489impl core::fmt::Debug for ArgMaxAttrs<'_> {
2490 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2491 let mut ds = f.debug_struct("ArgMaxAttrs");
2492 ds.field("axis", &self.axis());
2493 ds.field("keep_dims", &self.keep_dims());
2494 ds.finish()
2495 }
2496}
2497pub enum AveragePoolAttrsOffset {}
2498#[derive(Copy, Clone, PartialEq)]
2499
2500pub struct AveragePoolAttrs<'a> {
2501 pub _tab: flatbuffers::Table<'a>,
2502}
2503
2504impl<'a> flatbuffers::Follow<'a> for AveragePoolAttrs<'a> {
2505 type Inner = AveragePoolAttrs<'a>;
2506 #[inline]
2507 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2508 Self {
2509 _tab: flatbuffers::Table::new(buf, loc),
2510 }
2511 }
2512}
2513
2514impl<'a> AveragePoolAttrs<'a> {
2515 pub const VT_KERNEL_SIZE: flatbuffers::VOffsetT = 4;
2516 pub const VT_AUTO_PAD: flatbuffers::VOffsetT = 6;
2517 pub const VT_PADS: flatbuffers::VOffsetT = 8;
2518 pub const VT_STRIDES: flatbuffers::VOffsetT = 10;
2519 pub const VT_COUNT_INCLUDE_PAD: flatbuffers::VOffsetT = 12;
2520 pub const VT_CEIL_MODE: flatbuffers::VOffsetT = 14;
2521
2522 #[inline]
2523 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2524 AveragePoolAttrs { _tab: table }
2525 }
2526 #[allow(unused_mut)]
2527 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2528 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2529 args: &'args AveragePoolAttrsArgs<'args>,
2530 ) -> flatbuffers::WIPOffset<AveragePoolAttrs<'bldr>> {
2531 let mut builder = AveragePoolAttrsBuilder::new(_fbb);
2532 if let Some(x) = args.strides {
2533 builder.add_strides(x);
2534 }
2535 if let Some(x) = args.pads {
2536 builder.add_pads(x);
2537 }
2538 if let Some(x) = args.kernel_size {
2539 builder.add_kernel_size(x);
2540 }
2541 builder.add_ceil_mode(args.ceil_mode);
2542 builder.add_count_include_pad(args.count_include_pad);
2543 builder.add_auto_pad(args.auto_pad);
2544 builder.finish()
2545 }
2546
2547 #[inline]
2548 pub fn kernel_size(&self) -> flatbuffers::Vector<'a, u32> {
2549 unsafe {
2553 self._tab
2554 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
2555 AveragePoolAttrs::VT_KERNEL_SIZE,
2556 None,
2557 )
2558 .unwrap()
2559 }
2560 }
2561 #[inline]
2562 pub fn auto_pad(&self) -> AutoPad {
2563 unsafe {
2567 self._tab
2568 .get::<AutoPad>(AveragePoolAttrs::VT_AUTO_PAD, Some(AutoPad::Same))
2569 .unwrap()
2570 }
2571 }
2572 #[inline]
2573 pub fn pads(&self) -> Option<flatbuffers::Vector<'a, u32>> {
2574 unsafe {
2578 self._tab
2579 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
2580 AveragePoolAttrs::VT_PADS,
2581 None,
2582 )
2583 }
2584 }
2585 #[inline]
2586 pub fn strides(&self) -> Option<flatbuffers::Vector<'a, u32>> {
2587 unsafe {
2591 self._tab
2592 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
2593 AveragePoolAttrs::VT_STRIDES,
2594 None,
2595 )
2596 }
2597 }
2598 #[inline]
2599 pub fn count_include_pad(&self) -> bool {
2600 unsafe {
2604 self._tab
2605 .get::<bool>(AveragePoolAttrs::VT_COUNT_INCLUDE_PAD, Some(false))
2606 .unwrap()
2607 }
2608 }
2609 #[inline]
2610 pub fn ceil_mode(&self) -> bool {
2611 unsafe {
2615 self._tab
2616 .get::<bool>(AveragePoolAttrs::VT_CEIL_MODE, Some(false))
2617 .unwrap()
2618 }
2619 }
2620}
2621
2622impl flatbuffers::Verifiable for AveragePoolAttrs<'_> {
2623 #[inline]
2624 fn run_verifier(
2625 v: &mut flatbuffers::Verifier,
2626 pos: usize,
2627 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2628 use self::flatbuffers::Verifiable;
2629 v.visit_table(pos)?
2630 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
2631 "kernel_size",
2632 Self::VT_KERNEL_SIZE,
2633 true,
2634 )?
2635 .visit_field::<AutoPad>("auto_pad", Self::VT_AUTO_PAD, false)?
2636 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
2637 "pads",
2638 Self::VT_PADS,
2639 false,
2640 )?
2641 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
2642 "strides",
2643 Self::VT_STRIDES,
2644 false,
2645 )?
2646 .visit_field::<bool>("count_include_pad", Self::VT_COUNT_INCLUDE_PAD, false)?
2647 .visit_field::<bool>("ceil_mode", Self::VT_CEIL_MODE, false)?
2648 .finish();
2649 Ok(())
2650 }
2651}
2652pub struct AveragePoolAttrsArgs<'a> {
2653 pub kernel_size: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
2654 pub auto_pad: AutoPad,
2655 pub pads: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
2656 pub strides: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
2657 pub count_include_pad: bool,
2658 pub ceil_mode: bool,
2659}
2660impl<'a> Default for AveragePoolAttrsArgs<'a> {
2661 #[inline]
2662 fn default() -> Self {
2663 AveragePoolAttrsArgs {
2664 kernel_size: None, auto_pad: AutoPad::Same,
2666 pads: None,
2667 strides: None,
2668 count_include_pad: false,
2669 ceil_mode: false,
2670 }
2671 }
2672}
2673
2674pub struct AveragePoolAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2675 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2676 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2677}
2678impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> AveragePoolAttrsBuilder<'a, 'b, A> {
2679 #[inline]
2680 pub fn add_kernel_size(
2681 &mut self,
2682 kernel_size: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>,
2683 ) {
2684 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
2685 AveragePoolAttrs::VT_KERNEL_SIZE,
2686 kernel_size,
2687 );
2688 }
2689 #[inline]
2690 pub fn add_auto_pad(&mut self, auto_pad: AutoPad) {
2691 self.fbb_
2692 .push_slot::<AutoPad>(AveragePoolAttrs::VT_AUTO_PAD, auto_pad, AutoPad::Same);
2693 }
2694 #[inline]
2695 pub fn add_pads(&mut self, pads: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
2696 self.fbb_
2697 .push_slot_always::<flatbuffers::WIPOffset<_>>(AveragePoolAttrs::VT_PADS, pads);
2698 }
2699 #[inline]
2700 pub fn add_strides(&mut self, strides: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
2701 self.fbb_
2702 .push_slot_always::<flatbuffers::WIPOffset<_>>(AveragePoolAttrs::VT_STRIDES, strides);
2703 }
2704 #[inline]
2705 pub fn add_count_include_pad(&mut self, count_include_pad: bool) {
2706 self.fbb_.push_slot::<bool>(
2707 AveragePoolAttrs::VT_COUNT_INCLUDE_PAD,
2708 count_include_pad,
2709 false,
2710 );
2711 }
2712 #[inline]
2713 pub fn add_ceil_mode(&mut self, ceil_mode: bool) {
2714 self.fbb_
2715 .push_slot::<bool>(AveragePoolAttrs::VT_CEIL_MODE, ceil_mode, false);
2716 }
2717 #[inline]
2718 pub fn new(
2719 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2720 ) -> AveragePoolAttrsBuilder<'a, 'b, A> {
2721 let start = _fbb.start_table();
2722 AveragePoolAttrsBuilder {
2723 fbb_: _fbb,
2724 start_: start,
2725 }
2726 }
2727 #[inline]
2728 pub fn finish(self) -> flatbuffers::WIPOffset<AveragePoolAttrs<'a>> {
2729 let o = self.fbb_.end_table(self.start_);
2730 self.fbb_
2731 .required(o, AveragePoolAttrs::VT_KERNEL_SIZE, "kernel_size");
2732 flatbuffers::WIPOffset::new(o.value())
2733 }
2734}
2735
2736impl core::fmt::Debug for AveragePoolAttrs<'_> {
2737 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2738 let mut ds = f.debug_struct("AveragePoolAttrs");
2739 ds.field("kernel_size", &self.kernel_size());
2740 ds.field("auto_pad", &self.auto_pad());
2741 ds.field("pads", &self.pads());
2742 ds.field("strides", &self.strides());
2743 ds.field("count_include_pad", &self.count_include_pad());
2744 ds.field("ceil_mode", &self.ceil_mode());
2745 ds.finish()
2746 }
2747}
2748pub enum BatchNormalizationAttrsOffset {}
2749#[derive(Copy, Clone, PartialEq)]
2750
2751pub struct BatchNormalizationAttrs<'a> {
2752 pub _tab: flatbuffers::Table<'a>,
2753}
2754
2755impl<'a> flatbuffers::Follow<'a> for BatchNormalizationAttrs<'a> {
2756 type Inner = BatchNormalizationAttrs<'a>;
2757 #[inline]
2758 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2759 Self {
2760 _tab: flatbuffers::Table::new(buf, loc),
2761 }
2762 }
2763}
2764
2765impl<'a> BatchNormalizationAttrs<'a> {
2766 pub const VT_EPSILON: flatbuffers::VOffsetT = 4;
2767
2768 #[inline]
2769 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2770 BatchNormalizationAttrs { _tab: table }
2771 }
2772 #[allow(unused_mut)]
2773 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2774 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2775 args: &'args BatchNormalizationAttrsArgs,
2776 ) -> flatbuffers::WIPOffset<BatchNormalizationAttrs<'bldr>> {
2777 let mut builder = BatchNormalizationAttrsBuilder::new(_fbb);
2778 builder.add_epsilon(args.epsilon);
2779 builder.finish()
2780 }
2781
2782 #[inline]
2783 pub fn epsilon(&self) -> f32 {
2784 unsafe {
2788 self._tab
2789 .get::<f32>(BatchNormalizationAttrs::VT_EPSILON, Some(0.0))
2790 .unwrap()
2791 }
2792 }
2793}
2794
2795impl flatbuffers::Verifiable for BatchNormalizationAttrs<'_> {
2796 #[inline]
2797 fn run_verifier(
2798 v: &mut flatbuffers::Verifier,
2799 pos: usize,
2800 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2801 use self::flatbuffers::Verifiable;
2802 v.visit_table(pos)?
2803 .visit_field::<f32>("epsilon", Self::VT_EPSILON, false)?
2804 .finish();
2805 Ok(())
2806 }
2807}
2808pub struct BatchNormalizationAttrsArgs {
2809 pub epsilon: f32,
2810}
2811impl<'a> Default for BatchNormalizationAttrsArgs {
2812 #[inline]
2813 fn default() -> Self {
2814 BatchNormalizationAttrsArgs { epsilon: 0.0 }
2815 }
2816}
2817
2818pub struct BatchNormalizationAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2819 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2820 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2821}
2822impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> BatchNormalizationAttrsBuilder<'a, 'b, A> {
2823 #[inline]
2824 pub fn add_epsilon(&mut self, epsilon: f32) {
2825 self.fbb_
2826 .push_slot::<f32>(BatchNormalizationAttrs::VT_EPSILON, epsilon, 0.0);
2827 }
2828 #[inline]
2829 pub fn new(
2830 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2831 ) -> BatchNormalizationAttrsBuilder<'a, 'b, A> {
2832 let start = _fbb.start_table();
2833 BatchNormalizationAttrsBuilder {
2834 fbb_: _fbb,
2835 start_: start,
2836 }
2837 }
2838 #[inline]
2839 pub fn finish(self) -> flatbuffers::WIPOffset<BatchNormalizationAttrs<'a>> {
2840 let o = self.fbb_.end_table(self.start_);
2841 flatbuffers::WIPOffset::new(o.value())
2842 }
2843}
2844
2845impl core::fmt::Debug for BatchNormalizationAttrs<'_> {
2846 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2847 let mut ds = f.debug_struct("BatchNormalizationAttrs");
2848 ds.field("epsilon", &self.epsilon());
2849 ds.finish()
2850 }
2851}
2852pub enum CastAttrsOffset {}
2853#[derive(Copy, Clone, PartialEq)]
2854
2855pub struct CastAttrs<'a> {
2856 pub _tab: flatbuffers::Table<'a>,
2857}
2858
2859impl<'a> flatbuffers::Follow<'a> for CastAttrs<'a> {
2860 type Inner = CastAttrs<'a>;
2861 #[inline]
2862 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2863 Self {
2864 _tab: flatbuffers::Table::new(buf, loc),
2865 }
2866 }
2867}
2868
2869impl<'a> CastAttrs<'a> {
2870 pub const VT_TO: flatbuffers::VOffsetT = 4;
2871
2872 #[inline]
2873 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2874 CastAttrs { _tab: table }
2875 }
2876 #[allow(unused_mut)]
2877 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2878 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2879 args: &'args CastAttrsArgs,
2880 ) -> flatbuffers::WIPOffset<CastAttrs<'bldr>> {
2881 let mut builder = CastAttrsBuilder::new(_fbb);
2882 builder.add_to(args.to);
2883 builder.finish()
2884 }
2885
2886 #[inline]
2887 pub fn to(&self) -> DataType {
2888 unsafe {
2892 self._tab
2893 .get::<DataType>(CastAttrs::VT_TO, Some(DataType::Int32))
2894 .unwrap()
2895 }
2896 }
2897}
2898
2899impl flatbuffers::Verifiable for CastAttrs<'_> {
2900 #[inline]
2901 fn run_verifier(
2902 v: &mut flatbuffers::Verifier,
2903 pos: usize,
2904 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2905 use self::flatbuffers::Verifiable;
2906 v.visit_table(pos)?
2907 .visit_field::<DataType>("to", Self::VT_TO, false)?
2908 .finish();
2909 Ok(())
2910 }
2911}
2912pub struct CastAttrsArgs {
2913 pub to: DataType,
2914}
2915impl<'a> Default for CastAttrsArgs {
2916 #[inline]
2917 fn default() -> Self {
2918 CastAttrsArgs {
2919 to: DataType::Int32,
2920 }
2921 }
2922}
2923
2924pub struct CastAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
2925 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
2926 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2927}
2928impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> CastAttrsBuilder<'a, 'b, A> {
2929 #[inline]
2930 pub fn add_to(&mut self, to: DataType) {
2931 self.fbb_
2932 .push_slot::<DataType>(CastAttrs::VT_TO, to, DataType::Int32);
2933 }
2934 #[inline]
2935 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> CastAttrsBuilder<'a, 'b, A> {
2936 let start = _fbb.start_table();
2937 CastAttrsBuilder {
2938 fbb_: _fbb,
2939 start_: start,
2940 }
2941 }
2942 #[inline]
2943 pub fn finish(self) -> flatbuffers::WIPOffset<CastAttrs<'a>> {
2944 let o = self.fbb_.end_table(self.start_);
2945 flatbuffers::WIPOffset::new(o.value())
2946 }
2947}
2948
2949impl core::fmt::Debug for CastAttrs<'_> {
2950 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2951 let mut ds = f.debug_struct("CastAttrs");
2952 ds.field("to", &self.to());
2953 ds.finish()
2954 }
2955}
2956pub enum CastLikeAttrsOffset {}
2957#[derive(Copy, Clone, PartialEq)]
2958
2959pub struct CastLikeAttrs<'a> {
2960 pub _tab: flatbuffers::Table<'a>,
2961}
2962
2963impl<'a> flatbuffers::Follow<'a> for CastLikeAttrs<'a> {
2964 type Inner = CastLikeAttrs<'a>;
2965 #[inline]
2966 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2967 Self {
2968 _tab: flatbuffers::Table::new(buf, loc),
2969 }
2970 }
2971}
2972
2973impl<'a> CastLikeAttrs<'a> {
2974 #[inline]
2975 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2976 CastLikeAttrs { _tab: table }
2977 }
2978 #[allow(unused_mut)]
2979 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
2980 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
2981 _args: &'args CastLikeAttrsArgs,
2982 ) -> flatbuffers::WIPOffset<CastLikeAttrs<'bldr>> {
2983 let mut builder = CastLikeAttrsBuilder::new(_fbb);
2984 builder.finish()
2985 }
2986}
2987
2988impl flatbuffers::Verifiable for CastLikeAttrs<'_> {
2989 #[inline]
2990 fn run_verifier(
2991 v: &mut flatbuffers::Verifier,
2992 pos: usize,
2993 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2994 use self::flatbuffers::Verifiable;
2995 v.visit_table(pos)?.finish();
2996 Ok(())
2997 }
2998}
2999pub struct CastLikeAttrsArgs {}
3000impl<'a> Default for CastLikeAttrsArgs {
3001 #[inline]
3002 fn default() -> Self {
3003 CastLikeAttrsArgs {}
3004 }
3005}
3006
3007pub struct CastLikeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3008 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3009 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3010}
3011impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> CastLikeAttrsBuilder<'a, 'b, A> {
3012 #[inline]
3013 pub fn new(
3014 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3015 ) -> CastLikeAttrsBuilder<'a, 'b, A> {
3016 let start = _fbb.start_table();
3017 CastLikeAttrsBuilder {
3018 fbb_: _fbb,
3019 start_: start,
3020 }
3021 }
3022 #[inline]
3023 pub fn finish(self) -> flatbuffers::WIPOffset<CastLikeAttrs<'a>> {
3024 let o = self.fbb_.end_table(self.start_);
3025 flatbuffers::WIPOffset::new(o.value())
3026 }
3027}
3028
3029impl core::fmt::Debug for CastLikeAttrs<'_> {
3030 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3031 let mut ds = f.debug_struct("CastLikeAttrs");
3032 ds.finish()
3033 }
3034}
3035pub enum ConcatAttrsOffset {}
3036#[derive(Copy, Clone, PartialEq)]
3037
3038pub struct ConcatAttrs<'a> {
3039 pub _tab: flatbuffers::Table<'a>,
3040}
3041
3042impl<'a> flatbuffers::Follow<'a> for ConcatAttrs<'a> {
3043 type Inner = ConcatAttrs<'a>;
3044 #[inline]
3045 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3046 Self {
3047 _tab: flatbuffers::Table::new(buf, loc),
3048 }
3049 }
3050}
3051
3052impl<'a> ConcatAttrs<'a> {
3053 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
3054
3055 #[inline]
3056 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3057 ConcatAttrs { _tab: table }
3058 }
3059 #[allow(unused_mut)]
3060 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3061 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3062 args: &'args ConcatAttrsArgs,
3063 ) -> flatbuffers::WIPOffset<ConcatAttrs<'bldr>> {
3064 let mut builder = ConcatAttrsBuilder::new(_fbb);
3065 builder.add_axis(args.axis);
3066 builder.finish()
3067 }
3068
3069 #[inline]
3070 pub fn axis(&self) -> i32 {
3071 unsafe { self._tab.get::<i32>(ConcatAttrs::VT_AXIS, Some(0)).unwrap() }
3075 }
3076}
3077
3078impl flatbuffers::Verifiable for ConcatAttrs<'_> {
3079 #[inline]
3080 fn run_verifier(
3081 v: &mut flatbuffers::Verifier,
3082 pos: usize,
3083 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3084 use self::flatbuffers::Verifiable;
3085 v.visit_table(pos)?
3086 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
3087 .finish();
3088 Ok(())
3089 }
3090}
3091pub struct ConcatAttrsArgs {
3092 pub axis: i32,
3093}
3094impl<'a> Default for ConcatAttrsArgs {
3095 #[inline]
3096 fn default() -> Self {
3097 ConcatAttrsArgs { axis: 0 }
3098 }
3099}
3100
3101pub struct ConcatAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3102 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3103 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3104}
3105impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ConcatAttrsBuilder<'a, 'b, A> {
3106 #[inline]
3107 pub fn add_axis(&mut self, axis: i32) {
3108 self.fbb_.push_slot::<i32>(ConcatAttrs::VT_AXIS, axis, 0);
3109 }
3110 #[inline]
3111 pub fn new(
3112 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3113 ) -> ConcatAttrsBuilder<'a, 'b, A> {
3114 let start = _fbb.start_table();
3115 ConcatAttrsBuilder {
3116 fbb_: _fbb,
3117 start_: start,
3118 }
3119 }
3120 #[inline]
3121 pub fn finish(self) -> flatbuffers::WIPOffset<ConcatAttrs<'a>> {
3122 let o = self.fbb_.end_table(self.start_);
3123 flatbuffers::WIPOffset::new(o.value())
3124 }
3125}
3126
3127impl core::fmt::Debug for ConcatAttrs<'_> {
3128 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3129 let mut ds = f.debug_struct("ConcatAttrs");
3130 ds.field("axis", &self.axis());
3131 ds.finish()
3132 }
3133}
3134pub enum ConcatFromSequenceAttrsOffset {}
3135#[derive(Copy, Clone, PartialEq)]
3136
3137pub struct ConcatFromSequenceAttrs<'a> {
3138 pub _tab: flatbuffers::Table<'a>,
3139}
3140
3141impl<'a> flatbuffers::Follow<'a> for ConcatFromSequenceAttrs<'a> {
3142 type Inner = ConcatFromSequenceAttrs<'a>;
3143 #[inline]
3144 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3145 Self {
3146 _tab: flatbuffers::Table::new(buf, loc),
3147 }
3148 }
3149}
3150
3151impl<'a> ConcatFromSequenceAttrs<'a> {
3152 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
3153 pub const VT_NEW_AXIS: flatbuffers::VOffsetT = 6;
3154
3155 #[inline]
3156 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3157 ConcatFromSequenceAttrs { _tab: table }
3158 }
3159 #[allow(unused_mut)]
3160 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3161 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3162 args: &'args ConcatFromSequenceAttrsArgs,
3163 ) -> flatbuffers::WIPOffset<ConcatFromSequenceAttrs<'bldr>> {
3164 let mut builder = ConcatFromSequenceAttrsBuilder::new(_fbb);
3165 builder.add_axis(args.axis);
3166 builder.add_new_axis(args.new_axis);
3167 builder.finish()
3168 }
3169
3170 #[inline]
3171 pub fn axis(&self) -> i32 {
3172 unsafe {
3176 self._tab
3177 .get::<i32>(ConcatFromSequenceAttrs::VT_AXIS, Some(0))
3178 .unwrap()
3179 }
3180 }
3181 #[inline]
3182 pub fn new_axis(&self) -> bool {
3183 unsafe {
3187 self._tab
3188 .get::<bool>(ConcatFromSequenceAttrs::VT_NEW_AXIS, Some(false))
3189 .unwrap()
3190 }
3191 }
3192}
3193
3194impl flatbuffers::Verifiable for ConcatFromSequenceAttrs<'_> {
3195 #[inline]
3196 fn run_verifier(
3197 v: &mut flatbuffers::Verifier,
3198 pos: usize,
3199 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3200 use self::flatbuffers::Verifiable;
3201 v.visit_table(pos)?
3202 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
3203 .visit_field::<bool>("new_axis", Self::VT_NEW_AXIS, false)?
3204 .finish();
3205 Ok(())
3206 }
3207}
3208pub struct ConcatFromSequenceAttrsArgs {
3209 pub axis: i32,
3210 pub new_axis: bool,
3211}
3212impl<'a> Default for ConcatFromSequenceAttrsArgs {
3213 #[inline]
3214 fn default() -> Self {
3215 ConcatFromSequenceAttrsArgs {
3216 axis: 0,
3217 new_axis: false,
3218 }
3219 }
3220}
3221
3222pub struct ConcatFromSequenceAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3223 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3224 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3225}
3226impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ConcatFromSequenceAttrsBuilder<'a, 'b, A> {
3227 #[inline]
3228 pub fn add_axis(&mut self, axis: i32) {
3229 self.fbb_
3230 .push_slot::<i32>(ConcatFromSequenceAttrs::VT_AXIS, axis, 0);
3231 }
3232 #[inline]
3233 pub fn add_new_axis(&mut self, new_axis: bool) {
3234 self.fbb_
3235 .push_slot::<bool>(ConcatFromSequenceAttrs::VT_NEW_AXIS, new_axis, false);
3236 }
3237 #[inline]
3238 pub fn new(
3239 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3240 ) -> ConcatFromSequenceAttrsBuilder<'a, 'b, A> {
3241 let start = _fbb.start_table();
3242 ConcatFromSequenceAttrsBuilder {
3243 fbb_: _fbb,
3244 start_: start,
3245 }
3246 }
3247 #[inline]
3248 pub fn finish(self) -> flatbuffers::WIPOffset<ConcatFromSequenceAttrs<'a>> {
3249 let o = self.fbb_.end_table(self.start_);
3250 flatbuffers::WIPOffset::new(o.value())
3251 }
3252}
3253
3254impl core::fmt::Debug for ConcatFromSequenceAttrs<'_> {
3255 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3256 let mut ds = f.debug_struct("ConcatFromSequenceAttrs");
3257 ds.field("axis", &self.axis());
3258 ds.field("new_axis", &self.new_axis());
3259 ds.finish()
3260 }
3261}
3262pub enum DepthToSpaceAttrsOffset {}
3263#[derive(Copy, Clone, PartialEq)]
3264
3265pub struct DepthToSpaceAttrs<'a> {
3266 pub _tab: flatbuffers::Table<'a>,
3267}
3268
3269impl<'a> flatbuffers::Follow<'a> for DepthToSpaceAttrs<'a> {
3270 type Inner = DepthToSpaceAttrs<'a>;
3271 #[inline]
3272 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3273 Self {
3274 _tab: flatbuffers::Table::new(buf, loc),
3275 }
3276 }
3277}
3278
3279impl<'a> DepthToSpaceAttrs<'a> {
3280 pub const VT_MODE: flatbuffers::VOffsetT = 4;
3281 pub const VT_BLOCK_SIZE: flatbuffers::VOffsetT = 6;
3282
3283 #[inline]
3284 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3285 DepthToSpaceAttrs { _tab: table }
3286 }
3287 #[allow(unused_mut)]
3288 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3289 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3290 args: &'args DepthToSpaceAttrsArgs,
3291 ) -> flatbuffers::WIPOffset<DepthToSpaceAttrs<'bldr>> {
3292 let mut builder = DepthToSpaceAttrsBuilder::new(_fbb);
3293 builder.add_block_size(args.block_size);
3294 builder.add_mode(args.mode);
3295 builder.finish()
3296 }
3297
3298 #[inline]
3299 pub fn mode(&self) -> DepthToSpaceMode {
3300 unsafe {
3304 self._tab
3305 .get::<DepthToSpaceMode>(DepthToSpaceAttrs::VT_MODE, Some(DepthToSpaceMode::DCR))
3306 .unwrap()
3307 }
3308 }
3309 #[inline]
3310 pub fn block_size(&self) -> u32 {
3311 unsafe {
3315 self._tab
3316 .get::<u32>(DepthToSpaceAttrs::VT_BLOCK_SIZE, Some(0))
3317 .unwrap()
3318 }
3319 }
3320}
3321
3322impl flatbuffers::Verifiable for DepthToSpaceAttrs<'_> {
3323 #[inline]
3324 fn run_verifier(
3325 v: &mut flatbuffers::Verifier,
3326 pos: usize,
3327 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3328 use self::flatbuffers::Verifiable;
3329 v.visit_table(pos)?
3330 .visit_field::<DepthToSpaceMode>("mode", Self::VT_MODE, false)?
3331 .visit_field::<u32>("block_size", Self::VT_BLOCK_SIZE, false)?
3332 .finish();
3333 Ok(())
3334 }
3335}
3336pub struct DepthToSpaceAttrsArgs {
3337 pub mode: DepthToSpaceMode,
3338 pub block_size: u32,
3339}
3340impl<'a> Default for DepthToSpaceAttrsArgs {
3341 #[inline]
3342 fn default() -> Self {
3343 DepthToSpaceAttrsArgs {
3344 mode: DepthToSpaceMode::DCR,
3345 block_size: 0,
3346 }
3347 }
3348}
3349
3350pub struct DepthToSpaceAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3351 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3352 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3353}
3354impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DepthToSpaceAttrsBuilder<'a, 'b, A> {
3355 #[inline]
3356 pub fn add_mode(&mut self, mode: DepthToSpaceMode) {
3357 self.fbb_.push_slot::<DepthToSpaceMode>(
3358 DepthToSpaceAttrs::VT_MODE,
3359 mode,
3360 DepthToSpaceMode::DCR,
3361 );
3362 }
3363 #[inline]
3364 pub fn add_block_size(&mut self, block_size: u32) {
3365 self.fbb_
3366 .push_slot::<u32>(DepthToSpaceAttrs::VT_BLOCK_SIZE, block_size, 0);
3367 }
3368 #[inline]
3369 pub fn new(
3370 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3371 ) -> DepthToSpaceAttrsBuilder<'a, 'b, A> {
3372 let start = _fbb.start_table();
3373 DepthToSpaceAttrsBuilder {
3374 fbb_: _fbb,
3375 start_: start,
3376 }
3377 }
3378 #[inline]
3379 pub fn finish(self) -> flatbuffers::WIPOffset<DepthToSpaceAttrs<'a>> {
3380 let o = self.fbb_.end_table(self.start_);
3381 flatbuffers::WIPOffset::new(o.value())
3382 }
3383}
3384
3385impl core::fmt::Debug for DepthToSpaceAttrs<'_> {
3386 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3387 let mut ds = f.debug_struct("DepthToSpaceAttrs");
3388 ds.field("mode", &self.mode());
3389 ds.field("block_size", &self.block_size());
3390 ds.finish()
3391 }
3392}
3393pub enum DropoutAttrsOffset {}
3394#[derive(Copy, Clone, PartialEq)]
3395
3396pub struct DropoutAttrs<'a> {
3397 pub _tab: flatbuffers::Table<'a>,
3398}
3399
3400impl<'a> flatbuffers::Follow<'a> for DropoutAttrs<'a> {
3401 type Inner = DropoutAttrs<'a>;
3402 #[inline]
3403 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3404 Self {
3405 _tab: flatbuffers::Table::new(buf, loc),
3406 }
3407 }
3408}
3409
3410impl<'a> DropoutAttrs<'a> {
3411 pub const VT_SEED: flatbuffers::VOffsetT = 4;
3412
3413 #[inline]
3414 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3415 DropoutAttrs { _tab: table }
3416 }
3417 #[allow(unused_mut)]
3418 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3419 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3420 args: &'args DropoutAttrsArgs,
3421 ) -> flatbuffers::WIPOffset<DropoutAttrs<'bldr>> {
3422 let mut builder = DropoutAttrsBuilder::new(_fbb);
3423 if let Some(x) = args.seed {
3424 builder.add_seed(x);
3425 }
3426 builder.finish()
3427 }
3428
3429 #[inline]
3430 pub fn seed(&self) -> Option<i32> {
3431 unsafe { self._tab.get::<i32>(DropoutAttrs::VT_SEED, None) }
3435 }
3436}
3437
3438impl flatbuffers::Verifiable for DropoutAttrs<'_> {
3439 #[inline]
3440 fn run_verifier(
3441 v: &mut flatbuffers::Verifier,
3442 pos: usize,
3443 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3444 use self::flatbuffers::Verifiable;
3445 v.visit_table(pos)?
3446 .visit_field::<i32>("seed", Self::VT_SEED, false)?
3447 .finish();
3448 Ok(())
3449 }
3450}
3451pub struct DropoutAttrsArgs {
3452 pub seed: Option<i32>,
3453}
3454impl<'a> Default for DropoutAttrsArgs {
3455 #[inline]
3456 fn default() -> Self {
3457 DropoutAttrsArgs { seed: None }
3458 }
3459}
3460
3461pub struct DropoutAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3462 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3463 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3464}
3465impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DropoutAttrsBuilder<'a, 'b, A> {
3466 #[inline]
3467 pub fn add_seed(&mut self, seed: i32) {
3468 self.fbb_
3469 .push_slot_always::<i32>(DropoutAttrs::VT_SEED, seed);
3470 }
3471 #[inline]
3472 pub fn new(
3473 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3474 ) -> DropoutAttrsBuilder<'a, 'b, A> {
3475 let start = _fbb.start_table();
3476 DropoutAttrsBuilder {
3477 fbb_: _fbb,
3478 start_: start,
3479 }
3480 }
3481 #[inline]
3482 pub fn finish(self) -> flatbuffers::WIPOffset<DropoutAttrs<'a>> {
3483 let o = self.fbb_.end_table(self.start_);
3484 flatbuffers::WIPOffset::new(o.value())
3485 }
3486}
3487
3488impl core::fmt::Debug for DropoutAttrs<'_> {
3489 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3490 let mut ds = f.debug_struct("DropoutAttrs");
3491 ds.field("seed", &self.seed());
3492 ds.finish()
3493 }
3494}
3495pub enum EyeLikeAttrsOffset {}
3496#[derive(Copy, Clone, PartialEq)]
3497
3498pub struct EyeLikeAttrs<'a> {
3499 pub _tab: flatbuffers::Table<'a>,
3500}
3501
3502impl<'a> flatbuffers::Follow<'a> for EyeLikeAttrs<'a> {
3503 type Inner = EyeLikeAttrs<'a>;
3504 #[inline]
3505 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3506 Self {
3507 _tab: flatbuffers::Table::new(buf, loc),
3508 }
3509 }
3510}
3511
3512impl<'a> EyeLikeAttrs<'a> {
3513 pub const VT_DTYPE: flatbuffers::VOffsetT = 4;
3514 pub const VT_K: flatbuffers::VOffsetT = 6;
3515
3516 #[inline]
3517 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3518 EyeLikeAttrs { _tab: table }
3519 }
3520 #[allow(unused_mut)]
3521 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3522 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3523 args: &'args EyeLikeAttrsArgs,
3524 ) -> flatbuffers::WIPOffset<EyeLikeAttrs<'bldr>> {
3525 let mut builder = EyeLikeAttrsBuilder::new(_fbb);
3526 builder.add_k(args.k);
3527 if let Some(x) = args.dtype {
3528 builder.add_dtype(x);
3529 }
3530 builder.finish()
3531 }
3532
3533 #[inline]
3534 pub fn dtype(&self) -> Option<DataType> {
3535 unsafe { self._tab.get::<DataType>(EyeLikeAttrs::VT_DTYPE, None) }
3539 }
3540 #[inline]
3541 pub fn k(&self) -> i32 {
3542 unsafe { self._tab.get::<i32>(EyeLikeAttrs::VT_K, Some(0)).unwrap() }
3546 }
3547}
3548
3549impl flatbuffers::Verifiable for EyeLikeAttrs<'_> {
3550 #[inline]
3551 fn run_verifier(
3552 v: &mut flatbuffers::Verifier,
3553 pos: usize,
3554 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3555 use self::flatbuffers::Verifiable;
3556 v.visit_table(pos)?
3557 .visit_field::<DataType>("dtype", Self::VT_DTYPE, false)?
3558 .visit_field::<i32>("k", Self::VT_K, false)?
3559 .finish();
3560 Ok(())
3561 }
3562}
3563pub struct EyeLikeAttrsArgs {
3564 pub dtype: Option<DataType>,
3565 pub k: i32,
3566}
3567impl<'a> Default for EyeLikeAttrsArgs {
3568 #[inline]
3569 fn default() -> Self {
3570 EyeLikeAttrsArgs { dtype: None, k: 0 }
3571 }
3572}
3573
3574pub struct EyeLikeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3575 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3576 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3577}
3578impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> EyeLikeAttrsBuilder<'a, 'b, A> {
3579 #[inline]
3580 pub fn add_dtype(&mut self, dtype: DataType) {
3581 self.fbb_
3582 .push_slot_always::<DataType>(EyeLikeAttrs::VT_DTYPE, dtype);
3583 }
3584 #[inline]
3585 pub fn add_k(&mut self, k: i32) {
3586 self.fbb_.push_slot::<i32>(EyeLikeAttrs::VT_K, k, 0);
3587 }
3588 #[inline]
3589 pub fn new(
3590 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3591 ) -> EyeLikeAttrsBuilder<'a, 'b, A> {
3592 let start = _fbb.start_table();
3593 EyeLikeAttrsBuilder {
3594 fbb_: _fbb,
3595 start_: start,
3596 }
3597 }
3598 #[inline]
3599 pub fn finish(self) -> flatbuffers::WIPOffset<EyeLikeAttrs<'a>> {
3600 let o = self.fbb_.end_table(self.start_);
3601 flatbuffers::WIPOffset::new(o.value())
3602 }
3603}
3604
3605impl core::fmt::Debug for EyeLikeAttrs<'_> {
3606 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3607 let mut ds = f.debug_struct("EyeLikeAttrs");
3608 ds.field("dtype", &self.dtype());
3609 ds.field("k", &self.k());
3610 ds.finish()
3611 }
3612}
3613pub enum IsInfAttrsOffset {}
3614#[derive(Copy, Clone, PartialEq)]
3615
3616pub struct IsInfAttrs<'a> {
3617 pub _tab: flatbuffers::Table<'a>,
3618}
3619
3620impl<'a> flatbuffers::Follow<'a> for IsInfAttrs<'a> {
3621 type Inner = IsInfAttrs<'a>;
3622 #[inline]
3623 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3624 Self {
3625 _tab: flatbuffers::Table::new(buf, loc),
3626 }
3627 }
3628}
3629
3630impl<'a> IsInfAttrs<'a> {
3631 #[inline]
3632 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3633 IsInfAttrs { _tab: table }
3634 }
3635 #[allow(unused_mut)]
3636 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3637 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3638 _args: &'args IsInfAttrsArgs,
3639 ) -> flatbuffers::WIPOffset<IsInfAttrs<'bldr>> {
3640 let mut builder = IsInfAttrsBuilder::new(_fbb);
3641 builder.finish()
3642 }
3643}
3644
3645impl flatbuffers::Verifiable for IsInfAttrs<'_> {
3646 #[inline]
3647 fn run_verifier(
3648 v: &mut flatbuffers::Verifier,
3649 pos: usize,
3650 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3651 use self::flatbuffers::Verifiable;
3652 v.visit_table(pos)?.finish();
3653 Ok(())
3654 }
3655}
3656pub struct IsInfAttrsArgs {}
3657impl<'a> Default for IsInfAttrsArgs {
3658 #[inline]
3659 fn default() -> Self {
3660 IsInfAttrsArgs {}
3661 }
3662}
3663
3664pub struct IsInfAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3665 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3666 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3667}
3668impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> IsInfAttrsBuilder<'a, 'b, A> {
3669 #[inline]
3670 pub fn new(
3671 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3672 ) -> IsInfAttrsBuilder<'a, 'b, A> {
3673 let start = _fbb.start_table();
3674 IsInfAttrsBuilder {
3675 fbb_: _fbb,
3676 start_: start,
3677 }
3678 }
3679 #[inline]
3680 pub fn finish(self) -> flatbuffers::WIPOffset<IsInfAttrs<'a>> {
3681 let o = self.fbb_.end_table(self.start_);
3682 flatbuffers::WIPOffset::new(o.value())
3683 }
3684}
3685
3686impl core::fmt::Debug for IsInfAttrs<'_> {
3687 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3688 let mut ds = f.debug_struct("IsInfAttrs");
3689 ds.finish()
3690 }
3691}
3692pub enum IntScalarOffset {}
3693#[derive(Copy, Clone, PartialEq)]
3694
3695pub struct IntScalar<'a> {
3696 pub _tab: flatbuffers::Table<'a>,
3697}
3698
3699impl<'a> flatbuffers::Follow<'a> for IntScalar<'a> {
3700 type Inner = IntScalar<'a>;
3701 #[inline]
3702 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3703 Self {
3704 _tab: flatbuffers::Table::new(buf, loc),
3705 }
3706 }
3707}
3708
3709impl<'a> IntScalar<'a> {
3710 pub const VT_VALUE: flatbuffers::VOffsetT = 4;
3711
3712 #[inline]
3713 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3714 IntScalar { _tab: table }
3715 }
3716 #[allow(unused_mut)]
3717 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3718 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3719 args: &'args IntScalarArgs,
3720 ) -> flatbuffers::WIPOffset<IntScalar<'bldr>> {
3721 let mut builder = IntScalarBuilder::new(_fbb);
3722 builder.add_value(args.value);
3723 builder.finish()
3724 }
3725
3726 #[inline]
3727 pub fn value(&self) -> i32 {
3728 unsafe { self._tab.get::<i32>(IntScalar::VT_VALUE, Some(0)).unwrap() }
3732 }
3733}
3734
3735impl flatbuffers::Verifiable for IntScalar<'_> {
3736 #[inline]
3737 fn run_verifier(
3738 v: &mut flatbuffers::Verifier,
3739 pos: usize,
3740 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3741 use self::flatbuffers::Verifiable;
3742 v.visit_table(pos)?
3743 .visit_field::<i32>("value", Self::VT_VALUE, false)?
3744 .finish();
3745 Ok(())
3746 }
3747}
3748pub struct IntScalarArgs {
3749 pub value: i32,
3750}
3751impl<'a> Default for IntScalarArgs {
3752 #[inline]
3753 fn default() -> Self {
3754 IntScalarArgs { value: 0 }
3755 }
3756}
3757
3758pub struct IntScalarBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3759 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3760 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3761}
3762impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> IntScalarBuilder<'a, 'b, A> {
3763 #[inline]
3764 pub fn add_value(&mut self, value: i32) {
3765 self.fbb_.push_slot::<i32>(IntScalar::VT_VALUE, value, 0);
3766 }
3767 #[inline]
3768 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> IntScalarBuilder<'a, 'b, A> {
3769 let start = _fbb.start_table();
3770 IntScalarBuilder {
3771 fbb_: _fbb,
3772 start_: start,
3773 }
3774 }
3775 #[inline]
3776 pub fn finish(self) -> flatbuffers::WIPOffset<IntScalar<'a>> {
3777 let o = self.fbb_.end_table(self.start_);
3778 flatbuffers::WIPOffset::new(o.value())
3779 }
3780}
3781
3782impl core::fmt::Debug for IntScalar<'_> {
3783 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3784 let mut ds = f.debug_struct("IntScalar");
3785 ds.field("value", &self.value());
3786 ds.finish()
3787 }
3788}
3789pub enum FloatScalarOffset {}
3790#[derive(Copy, Clone, PartialEq)]
3791
3792pub struct FloatScalar<'a> {
3793 pub _tab: flatbuffers::Table<'a>,
3794}
3795
3796impl<'a> flatbuffers::Follow<'a> for FloatScalar<'a> {
3797 type Inner = FloatScalar<'a>;
3798 #[inline]
3799 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3800 Self {
3801 _tab: flatbuffers::Table::new(buf, loc),
3802 }
3803 }
3804}
3805
3806impl<'a> FloatScalar<'a> {
3807 pub const VT_VALUE: flatbuffers::VOffsetT = 4;
3808
3809 #[inline]
3810 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3811 FloatScalar { _tab: table }
3812 }
3813 #[allow(unused_mut)]
3814 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3815 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3816 args: &'args FloatScalarArgs,
3817 ) -> flatbuffers::WIPOffset<FloatScalar<'bldr>> {
3818 let mut builder = FloatScalarBuilder::new(_fbb);
3819 builder.add_value(args.value);
3820 builder.finish()
3821 }
3822
3823 #[inline]
3824 pub fn value(&self) -> f32 {
3825 unsafe {
3829 self._tab
3830 .get::<f32>(FloatScalar::VT_VALUE, Some(0.0))
3831 .unwrap()
3832 }
3833 }
3834}
3835
3836impl flatbuffers::Verifiable for FloatScalar<'_> {
3837 #[inline]
3838 fn run_verifier(
3839 v: &mut flatbuffers::Verifier,
3840 pos: usize,
3841 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3842 use self::flatbuffers::Verifiable;
3843 v.visit_table(pos)?
3844 .visit_field::<f32>("value", Self::VT_VALUE, false)?
3845 .finish();
3846 Ok(())
3847 }
3848}
3849pub struct FloatScalarArgs {
3850 pub value: f32,
3851}
3852impl<'a> Default for FloatScalarArgs {
3853 #[inline]
3854 fn default() -> Self {
3855 FloatScalarArgs { value: 0.0 }
3856 }
3857}
3858
3859pub struct FloatScalarBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
3860 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3861 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3862}
3863impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> FloatScalarBuilder<'a, 'b, A> {
3864 #[inline]
3865 pub fn add_value(&mut self, value: f32) {
3866 self.fbb_
3867 .push_slot::<f32>(FloatScalar::VT_VALUE, value, 0.0);
3868 }
3869 #[inline]
3870 pub fn new(
3871 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
3872 ) -> FloatScalarBuilder<'a, 'b, A> {
3873 let start = _fbb.start_table();
3874 FloatScalarBuilder {
3875 fbb_: _fbb,
3876 start_: start,
3877 }
3878 }
3879 #[inline]
3880 pub fn finish(self) -> flatbuffers::WIPOffset<FloatScalar<'a>> {
3881 let o = self.fbb_.end_table(self.start_);
3882 flatbuffers::WIPOffset::new(o.value())
3883 }
3884}
3885
3886impl core::fmt::Debug for FloatScalar<'_> {
3887 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3888 let mut ds = f.debug_struct("FloatScalar");
3889 ds.field("value", &self.value());
3890 ds.finish()
3891 }
3892}
3893pub enum ConstantOfShapeAttrsOffset {}
3894#[derive(Copy, Clone, PartialEq)]
3895
3896pub struct ConstantOfShapeAttrs<'a> {
3897 pub _tab: flatbuffers::Table<'a>,
3898}
3899
3900impl<'a> flatbuffers::Follow<'a> for ConstantOfShapeAttrs<'a> {
3901 type Inner = ConstantOfShapeAttrs<'a>;
3902 #[inline]
3903 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3904 Self {
3905 _tab: flatbuffers::Table::new(buf, loc),
3906 }
3907 }
3908}
3909
3910impl<'a> ConstantOfShapeAttrs<'a> {
3911 pub const VT_VALUE_TYPE: flatbuffers::VOffsetT = 4;
3912 pub const VT_VALUE: flatbuffers::VOffsetT = 6;
3913
3914 #[inline]
3915 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3916 ConstantOfShapeAttrs { _tab: table }
3917 }
3918 #[allow(unused_mut)]
3919 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
3920 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
3921 args: &'args ConstantOfShapeAttrsArgs,
3922 ) -> flatbuffers::WIPOffset<ConstantOfShapeAttrs<'bldr>> {
3923 let mut builder = ConstantOfShapeAttrsBuilder::new(_fbb);
3924 if let Some(x) = args.value {
3925 builder.add_value(x);
3926 }
3927 builder.add_value_type(args.value_type);
3928 builder.finish()
3929 }
3930
3931 #[inline]
3932 pub fn value_type(&self) -> Scalar {
3933 unsafe {
3937 self._tab
3938 .get::<Scalar>(ConstantOfShapeAttrs::VT_VALUE_TYPE, Some(Scalar::NONE))
3939 .unwrap()
3940 }
3941 }
3942 #[inline]
3943 pub fn value(&self) -> flatbuffers::Table<'a> {
3944 unsafe {
3948 self._tab
3949 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
3950 ConstantOfShapeAttrs::VT_VALUE,
3951 None,
3952 )
3953 .unwrap()
3954 }
3955 }
3956 #[inline]
3957 #[allow(non_snake_case)]
3958 pub fn value_as_int_scalar(&self) -> Option<IntScalar<'a>> {
3959 if self.value_type() == Scalar::IntScalar {
3960 let u = self.value();
3961 Some(unsafe { IntScalar::init_from_table(u) })
3965 } else {
3966 None
3967 }
3968 }
3969
3970 #[inline]
3971 #[allow(non_snake_case)]
3972 pub fn value_as_float_scalar(&self) -> Option<FloatScalar<'a>> {
3973 if self.value_type() == Scalar::FloatScalar {
3974 let u = self.value();
3975 Some(unsafe { FloatScalar::init_from_table(u) })
3979 } else {
3980 None
3981 }
3982 }
3983}
3984
3985impl flatbuffers::Verifiable for ConstantOfShapeAttrs<'_> {
3986 #[inline]
3987 fn run_verifier(
3988 v: &mut flatbuffers::Verifier,
3989 pos: usize,
3990 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3991 use self::flatbuffers::Verifiable;
3992 v.visit_table(pos)?
3993 .visit_union::<Scalar, _>(
3994 "value_type",
3995 Self::VT_VALUE_TYPE,
3996 "value",
3997 Self::VT_VALUE,
3998 true,
3999 |key, v, pos| match key {
4000 Scalar::IntScalar => v
4001 .verify_union_variant::<flatbuffers::ForwardsUOffset<IntScalar>>(
4002 "Scalar::IntScalar",
4003 pos,
4004 ),
4005 Scalar::FloatScalar => v
4006 .verify_union_variant::<flatbuffers::ForwardsUOffset<FloatScalar>>(
4007 "Scalar::FloatScalar",
4008 pos,
4009 ),
4010 _ => Ok(()),
4011 },
4012 )?
4013 .finish();
4014 Ok(())
4015 }
4016}
4017pub struct ConstantOfShapeAttrsArgs {
4018 pub value_type: Scalar,
4019 pub value: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
4020}
4021impl<'a> Default for ConstantOfShapeAttrsArgs {
4022 #[inline]
4023 fn default() -> Self {
4024 ConstantOfShapeAttrsArgs {
4025 value_type: Scalar::NONE,
4026 value: None, }
4028 }
4029}
4030
4031pub struct ConstantOfShapeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4032 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4033 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4034}
4035impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ConstantOfShapeAttrsBuilder<'a, 'b, A> {
4036 #[inline]
4037 pub fn add_value_type(&mut self, value_type: Scalar) {
4038 self.fbb_.push_slot::<Scalar>(
4039 ConstantOfShapeAttrs::VT_VALUE_TYPE,
4040 value_type,
4041 Scalar::NONE,
4042 );
4043 }
4044 #[inline]
4045 pub fn add_value(&mut self, value: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
4046 self.fbb_
4047 .push_slot_always::<flatbuffers::WIPOffset<_>>(ConstantOfShapeAttrs::VT_VALUE, value);
4048 }
4049 #[inline]
4050 pub fn new(
4051 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4052 ) -> ConstantOfShapeAttrsBuilder<'a, 'b, A> {
4053 let start = _fbb.start_table();
4054 ConstantOfShapeAttrsBuilder {
4055 fbb_: _fbb,
4056 start_: start,
4057 }
4058 }
4059 #[inline]
4060 pub fn finish(self) -> flatbuffers::WIPOffset<ConstantOfShapeAttrs<'a>> {
4061 let o = self.fbb_.end_table(self.start_);
4062 self.fbb_
4063 .required(o, ConstantOfShapeAttrs::VT_VALUE, "value");
4064 flatbuffers::WIPOffset::new(o.value())
4065 }
4066}
4067
4068impl core::fmt::Debug for ConstantOfShapeAttrs<'_> {
4069 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4070 let mut ds = f.debug_struct("ConstantOfShapeAttrs");
4071 ds.field("value_type", &self.value_type());
4072 match self.value_type() {
4073 Scalar::IntScalar => {
4074 if let Some(x) = self.value_as_int_scalar() {
4075 ds.field("value", &x)
4076 } else {
4077 ds.field(
4078 "value",
4079 &"InvalidFlatbuffer: Union discriminant does not match value.",
4080 )
4081 }
4082 }
4083 Scalar::FloatScalar => {
4084 if let Some(x) = self.value_as_float_scalar() {
4085 ds.field("value", &x)
4086 } else {
4087 ds.field(
4088 "value",
4089 &"InvalidFlatbuffer: Union discriminant does not match value.",
4090 )
4091 }
4092 }
4093 _ => {
4094 let x: Option<()> = None;
4095 ds.field("value", &x)
4096 }
4097 };
4098 ds.finish()
4099 }
4100}
4101pub enum ConvAttrsOffset {}
4102#[derive(Copy, Clone, PartialEq)]
4103
4104pub struct ConvAttrs<'a> {
4105 pub _tab: flatbuffers::Table<'a>,
4106}
4107
4108impl<'a> flatbuffers::Follow<'a> for ConvAttrs<'a> {
4109 type Inner = ConvAttrs<'a>;
4110 #[inline]
4111 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4112 Self {
4113 _tab: flatbuffers::Table::new(buf, loc),
4114 }
4115 }
4116}
4117
4118impl<'a> ConvAttrs<'a> {
4119 pub const VT_AUTO_PAD: flatbuffers::VOffsetT = 4;
4120 pub const VT_PADS: flatbuffers::VOffsetT = 6;
4121 pub const VT_GROUPS: flatbuffers::VOffsetT = 8;
4122 pub const VT_STRIDES: flatbuffers::VOffsetT = 10;
4123 pub const VT_DILATIONS: flatbuffers::VOffsetT = 12;
4124
4125 #[inline]
4126 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4127 ConvAttrs { _tab: table }
4128 }
4129 #[allow(unused_mut)]
4130 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4131 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4132 args: &'args ConvAttrsArgs<'args>,
4133 ) -> flatbuffers::WIPOffset<ConvAttrs<'bldr>> {
4134 let mut builder = ConvAttrsBuilder::new(_fbb);
4135 if let Some(x) = args.dilations {
4136 builder.add_dilations(x);
4137 }
4138 if let Some(x) = args.strides {
4139 builder.add_strides(x);
4140 }
4141 builder.add_groups(args.groups);
4142 if let Some(x) = args.pads {
4143 builder.add_pads(x);
4144 }
4145 builder.add_auto_pad(args.auto_pad);
4146 builder.finish()
4147 }
4148
4149 #[inline]
4150 pub fn auto_pad(&self) -> AutoPad {
4151 unsafe {
4155 self._tab
4156 .get::<AutoPad>(ConvAttrs::VT_AUTO_PAD, Some(AutoPad::Same))
4157 .unwrap()
4158 }
4159 }
4160 #[inline]
4161 pub fn pads(&self) -> Option<flatbuffers::Vector<'a, u32>> {
4162 unsafe {
4166 self._tab
4167 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
4168 ConvAttrs::VT_PADS,
4169 None,
4170 )
4171 }
4172 }
4173 #[inline]
4174 pub fn groups(&self) -> u32 {
4175 unsafe { self._tab.get::<u32>(ConvAttrs::VT_GROUPS, Some(0)).unwrap() }
4179 }
4180 #[inline]
4181 pub fn strides(&self) -> Option<flatbuffers::Vector<'a, u32>> {
4182 unsafe {
4186 self._tab
4187 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
4188 ConvAttrs::VT_STRIDES,
4189 None,
4190 )
4191 }
4192 }
4193 #[inline]
4194 pub fn dilations(&self) -> Option<flatbuffers::Vector<'a, u32>> {
4195 unsafe {
4199 self._tab
4200 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
4201 ConvAttrs::VT_DILATIONS,
4202 None,
4203 )
4204 }
4205 }
4206}
4207
4208impl flatbuffers::Verifiable for ConvAttrs<'_> {
4209 #[inline]
4210 fn run_verifier(
4211 v: &mut flatbuffers::Verifier,
4212 pos: usize,
4213 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4214 use self::flatbuffers::Verifiable;
4215 v.visit_table(pos)?
4216 .visit_field::<AutoPad>("auto_pad", Self::VT_AUTO_PAD, false)?
4217 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
4218 "pads",
4219 Self::VT_PADS,
4220 false,
4221 )?
4222 .visit_field::<u32>("groups", Self::VT_GROUPS, false)?
4223 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
4224 "strides",
4225 Self::VT_STRIDES,
4226 false,
4227 )?
4228 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
4229 "dilations",
4230 Self::VT_DILATIONS,
4231 false,
4232 )?
4233 .finish();
4234 Ok(())
4235 }
4236}
4237pub struct ConvAttrsArgs<'a> {
4238 pub auto_pad: AutoPad,
4239 pub pads: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
4240 pub groups: u32,
4241 pub strides: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
4242 pub dilations: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
4243}
4244impl<'a> Default for ConvAttrsArgs<'a> {
4245 #[inline]
4246 fn default() -> Self {
4247 ConvAttrsArgs {
4248 auto_pad: AutoPad::Same,
4249 pads: None,
4250 groups: 0,
4251 strides: None,
4252 dilations: None,
4253 }
4254 }
4255}
4256
4257pub struct ConvAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4258 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4259 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4260}
4261impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ConvAttrsBuilder<'a, 'b, A> {
4262 #[inline]
4263 pub fn add_auto_pad(&mut self, auto_pad: AutoPad) {
4264 self.fbb_
4265 .push_slot::<AutoPad>(ConvAttrs::VT_AUTO_PAD, auto_pad, AutoPad::Same);
4266 }
4267 #[inline]
4268 pub fn add_pads(&mut self, pads: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
4269 self.fbb_
4270 .push_slot_always::<flatbuffers::WIPOffset<_>>(ConvAttrs::VT_PADS, pads);
4271 }
4272 #[inline]
4273 pub fn add_groups(&mut self, groups: u32) {
4274 self.fbb_.push_slot::<u32>(ConvAttrs::VT_GROUPS, groups, 0);
4275 }
4276 #[inline]
4277 pub fn add_strides(&mut self, strides: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
4278 self.fbb_
4279 .push_slot_always::<flatbuffers::WIPOffset<_>>(ConvAttrs::VT_STRIDES, strides);
4280 }
4281 #[inline]
4282 pub fn add_dilations(
4283 &mut self,
4284 dilations: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>,
4285 ) {
4286 self.fbb_
4287 .push_slot_always::<flatbuffers::WIPOffset<_>>(ConvAttrs::VT_DILATIONS, dilations);
4288 }
4289 #[inline]
4290 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ConvAttrsBuilder<'a, 'b, A> {
4291 let start = _fbb.start_table();
4292 ConvAttrsBuilder {
4293 fbb_: _fbb,
4294 start_: start,
4295 }
4296 }
4297 #[inline]
4298 pub fn finish(self) -> flatbuffers::WIPOffset<ConvAttrs<'a>> {
4299 let o = self.fbb_.end_table(self.start_);
4300 flatbuffers::WIPOffset::new(o.value())
4301 }
4302}
4303
4304impl core::fmt::Debug for ConvAttrs<'_> {
4305 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4306 let mut ds = f.debug_struct("ConvAttrs");
4307 ds.field("auto_pad", &self.auto_pad());
4308 ds.field("pads", &self.pads());
4309 ds.field("groups", &self.groups());
4310 ds.field("strides", &self.strides());
4311 ds.field("dilations", &self.dilations());
4312 ds.finish()
4313 }
4314}
4315pub enum ConvTransposeAttrsOffset {}
4316#[derive(Copy, Clone, PartialEq)]
4317
4318pub struct ConvTransposeAttrs<'a> {
4319 pub _tab: flatbuffers::Table<'a>,
4320}
4321
4322impl<'a> flatbuffers::Follow<'a> for ConvTransposeAttrs<'a> {
4323 type Inner = ConvTransposeAttrs<'a>;
4324 #[inline]
4325 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4326 Self {
4327 _tab: flatbuffers::Table::new(buf, loc),
4328 }
4329 }
4330}
4331
4332impl<'a> ConvTransposeAttrs<'a> {
4333 pub const VT_STRIDES: flatbuffers::VOffsetT = 4;
4334 pub const VT_AUTO_PAD: flatbuffers::VOffsetT = 6;
4335 pub const VT_PADS: flatbuffers::VOffsetT = 8;
4336 pub const VT_GROUPS: flatbuffers::VOffsetT = 10;
4337 pub const VT_OUTPUT_PADDING: flatbuffers::VOffsetT = 12;
4338
4339 #[inline]
4340 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4341 ConvTransposeAttrs { _tab: table }
4342 }
4343 #[allow(unused_mut)]
4344 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4345 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4346 args: &'args ConvTransposeAttrsArgs<'args>,
4347 ) -> flatbuffers::WIPOffset<ConvTransposeAttrs<'bldr>> {
4348 let mut builder = ConvTransposeAttrsBuilder::new(_fbb);
4349 if let Some(x) = args.output_padding {
4350 builder.add_output_padding(x);
4351 }
4352 builder.add_groups(args.groups);
4353 if let Some(x) = args.pads {
4354 builder.add_pads(x);
4355 }
4356 if let Some(x) = args.strides {
4357 builder.add_strides(x);
4358 }
4359 builder.add_auto_pad(args.auto_pad);
4360 builder.finish()
4361 }
4362
4363 #[inline]
4364 pub fn strides(&self) -> Option<flatbuffers::Vector<'a, u32>> {
4365 unsafe {
4369 self._tab
4370 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
4371 ConvTransposeAttrs::VT_STRIDES,
4372 None,
4373 )
4374 }
4375 }
4376 #[inline]
4377 pub fn auto_pad(&self) -> AutoPad {
4378 unsafe {
4382 self._tab
4383 .get::<AutoPad>(ConvTransposeAttrs::VT_AUTO_PAD, Some(AutoPad::NotSet))
4384 .unwrap()
4385 }
4386 }
4387 #[inline]
4388 pub fn pads(&self) -> Option<flatbuffers::Vector<'a, u32>> {
4389 unsafe {
4393 self._tab
4394 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
4395 ConvTransposeAttrs::VT_PADS,
4396 None,
4397 )
4398 }
4399 }
4400 #[inline]
4401 pub fn groups(&self) -> u32 {
4402 unsafe {
4406 self._tab
4407 .get::<u32>(ConvTransposeAttrs::VT_GROUPS, Some(1))
4408 .unwrap()
4409 }
4410 }
4411 #[inline]
4412 pub fn output_padding(&self) -> Option<flatbuffers::Vector<'a, u32>> {
4413 unsafe {
4417 self._tab
4418 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
4419 ConvTransposeAttrs::VT_OUTPUT_PADDING,
4420 None,
4421 )
4422 }
4423 }
4424}
4425
4426impl flatbuffers::Verifiable for ConvTransposeAttrs<'_> {
4427 #[inline]
4428 fn run_verifier(
4429 v: &mut flatbuffers::Verifier,
4430 pos: usize,
4431 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4432 use self::flatbuffers::Verifiable;
4433 v.visit_table(pos)?
4434 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
4435 "strides",
4436 Self::VT_STRIDES,
4437 false,
4438 )?
4439 .visit_field::<AutoPad>("auto_pad", Self::VT_AUTO_PAD, false)?
4440 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
4441 "pads",
4442 Self::VT_PADS,
4443 false,
4444 )?
4445 .visit_field::<u32>("groups", Self::VT_GROUPS, false)?
4446 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
4447 "output_padding",
4448 Self::VT_OUTPUT_PADDING,
4449 false,
4450 )?
4451 .finish();
4452 Ok(())
4453 }
4454}
4455pub struct ConvTransposeAttrsArgs<'a> {
4456 pub strides: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
4457 pub auto_pad: AutoPad,
4458 pub pads: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
4459 pub groups: u32,
4460 pub output_padding: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
4461}
4462impl<'a> Default for ConvTransposeAttrsArgs<'a> {
4463 #[inline]
4464 fn default() -> Self {
4465 ConvTransposeAttrsArgs {
4466 strides: None,
4467 auto_pad: AutoPad::NotSet,
4468 pads: None,
4469 groups: 1,
4470 output_padding: None,
4471 }
4472 }
4473}
4474
4475pub struct ConvTransposeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4476 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4477 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4478}
4479impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ConvTransposeAttrsBuilder<'a, 'b, A> {
4480 #[inline]
4481 pub fn add_strides(&mut self, strides: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
4482 self.fbb_
4483 .push_slot_always::<flatbuffers::WIPOffset<_>>(ConvTransposeAttrs::VT_STRIDES, strides);
4484 }
4485 #[inline]
4486 pub fn add_auto_pad(&mut self, auto_pad: AutoPad) {
4487 self.fbb_
4488 .push_slot::<AutoPad>(ConvTransposeAttrs::VT_AUTO_PAD, auto_pad, AutoPad::NotSet);
4489 }
4490 #[inline]
4491 pub fn add_pads(&mut self, pads: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
4492 self.fbb_
4493 .push_slot_always::<flatbuffers::WIPOffset<_>>(ConvTransposeAttrs::VT_PADS, pads);
4494 }
4495 #[inline]
4496 pub fn add_groups(&mut self, groups: u32) {
4497 self.fbb_
4498 .push_slot::<u32>(ConvTransposeAttrs::VT_GROUPS, groups, 1);
4499 }
4500 #[inline]
4501 pub fn add_output_padding(
4502 &mut self,
4503 output_padding: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>,
4504 ) {
4505 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
4506 ConvTransposeAttrs::VT_OUTPUT_PADDING,
4507 output_padding,
4508 );
4509 }
4510 #[inline]
4511 pub fn new(
4512 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4513 ) -> ConvTransposeAttrsBuilder<'a, 'b, A> {
4514 let start = _fbb.start_table();
4515 ConvTransposeAttrsBuilder {
4516 fbb_: _fbb,
4517 start_: start,
4518 }
4519 }
4520 #[inline]
4521 pub fn finish(self) -> flatbuffers::WIPOffset<ConvTransposeAttrs<'a>> {
4522 let o = self.fbb_.end_table(self.start_);
4523 flatbuffers::WIPOffset::new(o.value())
4524 }
4525}
4526
4527impl core::fmt::Debug for ConvTransposeAttrs<'_> {
4528 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4529 let mut ds = f.debug_struct("ConvTransposeAttrs");
4530 ds.field("strides", &self.strides());
4531 ds.field("auto_pad", &self.auto_pad());
4532 ds.field("pads", &self.pads());
4533 ds.field("groups", &self.groups());
4534 ds.field("output_padding", &self.output_padding());
4535 ds.finish()
4536 }
4537}
4538pub enum DequantizeLinearAttrsOffset {}
4539#[derive(Copy, Clone, PartialEq)]
4540
4541pub struct DequantizeLinearAttrs<'a> {
4542 pub _tab: flatbuffers::Table<'a>,
4543}
4544
4545impl<'a> flatbuffers::Follow<'a> for DequantizeLinearAttrs<'a> {
4546 type Inner = DequantizeLinearAttrs<'a>;
4547 #[inline]
4548 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4549 Self {
4550 _tab: flatbuffers::Table::new(buf, loc),
4551 }
4552 }
4553}
4554
4555impl<'a> DequantizeLinearAttrs<'a> {
4556 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
4557
4558 #[inline]
4559 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4560 DequantizeLinearAttrs { _tab: table }
4561 }
4562 #[allow(unused_mut)]
4563 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4564 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4565 args: &'args DequantizeLinearAttrsArgs,
4566 ) -> flatbuffers::WIPOffset<DequantizeLinearAttrs<'bldr>> {
4567 let mut builder = DequantizeLinearAttrsBuilder::new(_fbb);
4568 builder.add_axis(args.axis);
4569 builder.finish()
4570 }
4571
4572 #[inline]
4573 pub fn axis(&self) -> i32 {
4574 unsafe {
4578 self._tab
4579 .get::<i32>(DequantizeLinearAttrs::VT_AXIS, Some(0))
4580 .unwrap()
4581 }
4582 }
4583}
4584
4585impl flatbuffers::Verifiable for DequantizeLinearAttrs<'_> {
4586 #[inline]
4587 fn run_verifier(
4588 v: &mut flatbuffers::Verifier,
4589 pos: usize,
4590 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4591 use self::flatbuffers::Verifiable;
4592 v.visit_table(pos)?
4593 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
4594 .finish();
4595 Ok(())
4596 }
4597}
4598pub struct DequantizeLinearAttrsArgs {
4599 pub axis: i32,
4600}
4601impl<'a> Default for DequantizeLinearAttrsArgs {
4602 #[inline]
4603 fn default() -> Self {
4604 DequantizeLinearAttrsArgs { axis: 0 }
4605 }
4606}
4607
4608pub struct DequantizeLinearAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4609 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4610 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4611}
4612impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DequantizeLinearAttrsBuilder<'a, 'b, A> {
4613 #[inline]
4614 pub fn add_axis(&mut self, axis: i32) {
4615 self.fbb_
4616 .push_slot::<i32>(DequantizeLinearAttrs::VT_AXIS, axis, 0);
4617 }
4618 #[inline]
4619 pub fn new(
4620 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4621 ) -> DequantizeLinearAttrsBuilder<'a, 'b, A> {
4622 let start = _fbb.start_table();
4623 DequantizeLinearAttrsBuilder {
4624 fbb_: _fbb,
4625 start_: start,
4626 }
4627 }
4628 #[inline]
4629 pub fn finish(self) -> flatbuffers::WIPOffset<DequantizeLinearAttrs<'a>> {
4630 let o = self.fbb_.end_table(self.start_);
4631 flatbuffers::WIPOffset::new(o.value())
4632 }
4633}
4634
4635impl core::fmt::Debug for DequantizeLinearAttrs<'_> {
4636 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4637 let mut ds = f.debug_struct("DequantizeLinearAttrs");
4638 ds.field("axis", &self.axis());
4639 ds.finish()
4640 }
4641}
4642pub enum EinsumAttrsOffset {}
4643#[derive(Copy, Clone, PartialEq)]
4644
4645pub struct EinsumAttrs<'a> {
4646 pub _tab: flatbuffers::Table<'a>,
4647}
4648
4649impl<'a> flatbuffers::Follow<'a> for EinsumAttrs<'a> {
4650 type Inner = EinsumAttrs<'a>;
4651 #[inline]
4652 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4653 Self {
4654 _tab: flatbuffers::Table::new(buf, loc),
4655 }
4656 }
4657}
4658
4659impl<'a> EinsumAttrs<'a> {
4660 pub const VT_EQUATION: flatbuffers::VOffsetT = 4;
4661
4662 #[inline]
4663 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4664 EinsumAttrs { _tab: table }
4665 }
4666 #[allow(unused_mut)]
4667 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4668 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4669 args: &'args EinsumAttrsArgs<'args>,
4670 ) -> flatbuffers::WIPOffset<EinsumAttrs<'bldr>> {
4671 let mut builder = EinsumAttrsBuilder::new(_fbb);
4672 if let Some(x) = args.equation {
4673 builder.add_equation(x);
4674 }
4675 builder.finish()
4676 }
4677
4678 #[inline]
4679 pub fn equation(&self) -> Option<&'a str> {
4680 unsafe {
4684 self._tab
4685 .get::<flatbuffers::ForwardsUOffset<&str>>(EinsumAttrs::VT_EQUATION, None)
4686 }
4687 }
4688}
4689
4690impl flatbuffers::Verifiable for EinsumAttrs<'_> {
4691 #[inline]
4692 fn run_verifier(
4693 v: &mut flatbuffers::Verifier,
4694 pos: usize,
4695 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4696 use self::flatbuffers::Verifiable;
4697 v.visit_table(pos)?
4698 .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
4699 "equation",
4700 Self::VT_EQUATION,
4701 false,
4702 )?
4703 .finish();
4704 Ok(())
4705 }
4706}
4707pub struct EinsumAttrsArgs<'a> {
4708 pub equation: Option<flatbuffers::WIPOffset<&'a str>>,
4709}
4710impl<'a> Default for EinsumAttrsArgs<'a> {
4711 #[inline]
4712 fn default() -> Self {
4713 EinsumAttrsArgs { equation: None }
4714 }
4715}
4716
4717pub struct EinsumAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4718 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4719 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4720}
4721impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> EinsumAttrsBuilder<'a, 'b, A> {
4722 #[inline]
4723 pub fn add_equation(&mut self, equation: flatbuffers::WIPOffset<&'b str>) {
4724 self.fbb_
4725 .push_slot_always::<flatbuffers::WIPOffset<_>>(EinsumAttrs::VT_EQUATION, equation);
4726 }
4727 #[inline]
4728 pub fn new(
4729 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4730 ) -> EinsumAttrsBuilder<'a, 'b, A> {
4731 let start = _fbb.start_table();
4732 EinsumAttrsBuilder {
4733 fbb_: _fbb,
4734 start_: start,
4735 }
4736 }
4737 #[inline]
4738 pub fn finish(self) -> flatbuffers::WIPOffset<EinsumAttrs<'a>> {
4739 let o = self.fbb_.end_table(self.start_);
4740 flatbuffers::WIPOffset::new(o.value())
4741 }
4742}
4743
4744impl core::fmt::Debug for EinsumAttrs<'_> {
4745 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4746 let mut ds = f.debug_struct("EinsumAttrs");
4747 ds.field("equation", &self.equation());
4748 ds.finish()
4749 }
4750}
4751pub enum EluAttrsOffset {}
4752#[derive(Copy, Clone, PartialEq)]
4753
4754pub struct EluAttrs<'a> {
4755 pub _tab: flatbuffers::Table<'a>,
4756}
4757
4758impl<'a> flatbuffers::Follow<'a> for EluAttrs<'a> {
4759 type Inner = EluAttrs<'a>;
4760 #[inline]
4761 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4762 Self {
4763 _tab: flatbuffers::Table::new(buf, loc),
4764 }
4765 }
4766}
4767
4768impl<'a> EluAttrs<'a> {
4769 pub const VT_ALPHA: flatbuffers::VOffsetT = 4;
4770
4771 #[inline]
4772 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4773 EluAttrs { _tab: table }
4774 }
4775 #[allow(unused_mut)]
4776 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4777 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4778 args: &'args EluAttrsArgs,
4779 ) -> flatbuffers::WIPOffset<EluAttrs<'bldr>> {
4780 let mut builder = EluAttrsBuilder::new(_fbb);
4781 builder.add_alpha(args.alpha);
4782 builder.finish()
4783 }
4784
4785 #[inline]
4786 pub fn alpha(&self) -> f32 {
4787 unsafe { self._tab.get::<f32>(EluAttrs::VT_ALPHA, Some(0.0)).unwrap() }
4791 }
4792}
4793
4794impl flatbuffers::Verifiable for EluAttrs<'_> {
4795 #[inline]
4796 fn run_verifier(
4797 v: &mut flatbuffers::Verifier,
4798 pos: usize,
4799 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4800 use self::flatbuffers::Verifiable;
4801 v.visit_table(pos)?
4802 .visit_field::<f32>("alpha", Self::VT_ALPHA, false)?
4803 .finish();
4804 Ok(())
4805 }
4806}
4807pub struct EluAttrsArgs {
4808 pub alpha: f32,
4809}
4810impl<'a> Default for EluAttrsArgs {
4811 #[inline]
4812 fn default() -> Self {
4813 EluAttrsArgs { alpha: 0.0 }
4814 }
4815}
4816
4817pub struct EluAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4818 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4819 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4820}
4821impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> EluAttrsBuilder<'a, 'b, A> {
4822 #[inline]
4823 pub fn add_alpha(&mut self, alpha: f32) {
4824 self.fbb_.push_slot::<f32>(EluAttrs::VT_ALPHA, alpha, 0.0);
4825 }
4826 #[inline]
4827 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> EluAttrsBuilder<'a, 'b, A> {
4828 let start = _fbb.start_table();
4829 EluAttrsBuilder {
4830 fbb_: _fbb,
4831 start_: start,
4832 }
4833 }
4834 #[inline]
4835 pub fn finish(self) -> flatbuffers::WIPOffset<EluAttrs<'a>> {
4836 let o = self.fbb_.end_table(self.start_);
4837 flatbuffers::WIPOffset::new(o.value())
4838 }
4839}
4840
4841impl core::fmt::Debug for EluAttrs<'_> {
4842 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4843 let mut ds = f.debug_struct("EluAttrs");
4844 ds.field("alpha", &self.alpha());
4845 ds.finish()
4846 }
4847}
4848pub enum FlattenAttrsOffset {}
4849#[derive(Copy, Clone, PartialEq)]
4850
4851pub struct FlattenAttrs<'a> {
4852 pub _tab: flatbuffers::Table<'a>,
4853}
4854
4855impl<'a> flatbuffers::Follow<'a> for FlattenAttrs<'a> {
4856 type Inner = FlattenAttrs<'a>;
4857 #[inline]
4858 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4859 Self {
4860 _tab: flatbuffers::Table::new(buf, loc),
4861 }
4862 }
4863}
4864
4865impl<'a> FlattenAttrs<'a> {
4866 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
4867
4868 #[inline]
4869 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4870 FlattenAttrs { _tab: table }
4871 }
4872 #[allow(unused_mut)]
4873 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4874 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4875 args: &'args FlattenAttrsArgs,
4876 ) -> flatbuffers::WIPOffset<FlattenAttrs<'bldr>> {
4877 let mut builder = FlattenAttrsBuilder::new(_fbb);
4878 builder.add_axis(args.axis);
4879 builder.finish()
4880 }
4881
4882 #[inline]
4883 pub fn axis(&self) -> i32 {
4884 unsafe {
4888 self._tab
4889 .get::<i32>(FlattenAttrs::VT_AXIS, Some(0))
4890 .unwrap()
4891 }
4892 }
4893}
4894
4895impl flatbuffers::Verifiable for FlattenAttrs<'_> {
4896 #[inline]
4897 fn run_verifier(
4898 v: &mut flatbuffers::Verifier,
4899 pos: usize,
4900 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4901 use self::flatbuffers::Verifiable;
4902 v.visit_table(pos)?
4903 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
4904 .finish();
4905 Ok(())
4906 }
4907}
4908pub struct FlattenAttrsArgs {
4909 pub axis: i32,
4910}
4911impl<'a> Default for FlattenAttrsArgs {
4912 #[inline]
4913 fn default() -> Self {
4914 FlattenAttrsArgs { axis: 0 }
4915 }
4916}
4917
4918pub struct FlattenAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
4919 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4920 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4921}
4922impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> FlattenAttrsBuilder<'a, 'b, A> {
4923 #[inline]
4924 pub fn add_axis(&mut self, axis: i32) {
4925 self.fbb_.push_slot::<i32>(FlattenAttrs::VT_AXIS, axis, 0);
4926 }
4927 #[inline]
4928 pub fn new(
4929 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
4930 ) -> FlattenAttrsBuilder<'a, 'b, A> {
4931 let start = _fbb.start_table();
4932 FlattenAttrsBuilder {
4933 fbb_: _fbb,
4934 start_: start,
4935 }
4936 }
4937 #[inline]
4938 pub fn finish(self) -> flatbuffers::WIPOffset<FlattenAttrs<'a>> {
4939 let o = self.fbb_.end_table(self.start_);
4940 flatbuffers::WIPOffset::new(o.value())
4941 }
4942}
4943
4944impl core::fmt::Debug for FlattenAttrs<'_> {
4945 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4946 let mut ds = f.debug_struct("FlattenAttrs");
4947 ds.field("axis", &self.axis());
4948 ds.finish()
4949 }
4950}
4951pub enum LayerNormalizationAttrsOffset {}
4952#[derive(Copy, Clone, PartialEq)]
4953
4954pub struct LayerNormalizationAttrs<'a> {
4955 pub _tab: flatbuffers::Table<'a>,
4956}
4957
4958impl<'a> flatbuffers::Follow<'a> for LayerNormalizationAttrs<'a> {
4959 type Inner = LayerNormalizationAttrs<'a>;
4960 #[inline]
4961 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4962 Self {
4963 _tab: flatbuffers::Table::new(buf, loc),
4964 }
4965 }
4966}
4967
4968impl<'a> LayerNormalizationAttrs<'a> {
4969 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
4970 pub const VT_EPSILON: flatbuffers::VOffsetT = 6;
4971
4972 #[inline]
4973 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4974 LayerNormalizationAttrs { _tab: table }
4975 }
4976 #[allow(unused_mut)]
4977 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
4978 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
4979 args: &'args LayerNormalizationAttrsArgs,
4980 ) -> flatbuffers::WIPOffset<LayerNormalizationAttrs<'bldr>> {
4981 let mut builder = LayerNormalizationAttrsBuilder::new(_fbb);
4982 builder.add_epsilon(args.epsilon);
4983 builder.add_axis(args.axis);
4984 builder.finish()
4985 }
4986
4987 #[inline]
4988 pub fn axis(&self) -> i32 {
4989 unsafe {
4993 self._tab
4994 .get::<i32>(LayerNormalizationAttrs::VT_AXIS, Some(0))
4995 .unwrap()
4996 }
4997 }
4998 #[inline]
4999 pub fn epsilon(&self) -> f32 {
5000 unsafe {
5004 self._tab
5005 .get::<f32>(LayerNormalizationAttrs::VT_EPSILON, Some(0.0))
5006 .unwrap()
5007 }
5008 }
5009}
5010
5011impl flatbuffers::Verifiable for LayerNormalizationAttrs<'_> {
5012 #[inline]
5013 fn run_verifier(
5014 v: &mut flatbuffers::Verifier,
5015 pos: usize,
5016 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5017 use self::flatbuffers::Verifiable;
5018 v.visit_table(pos)?
5019 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
5020 .visit_field::<f32>("epsilon", Self::VT_EPSILON, false)?
5021 .finish();
5022 Ok(())
5023 }
5024}
5025pub struct LayerNormalizationAttrsArgs {
5026 pub axis: i32,
5027 pub epsilon: f32,
5028}
5029impl<'a> Default for LayerNormalizationAttrsArgs {
5030 #[inline]
5031 fn default() -> Self {
5032 LayerNormalizationAttrsArgs {
5033 axis: 0,
5034 epsilon: 0.0,
5035 }
5036 }
5037}
5038
5039pub struct LayerNormalizationAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5040 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5041 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5042}
5043impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> LayerNormalizationAttrsBuilder<'a, 'b, A> {
5044 #[inline]
5045 pub fn add_axis(&mut self, axis: i32) {
5046 self.fbb_
5047 .push_slot::<i32>(LayerNormalizationAttrs::VT_AXIS, axis, 0);
5048 }
5049 #[inline]
5050 pub fn add_epsilon(&mut self, epsilon: f32) {
5051 self.fbb_
5052 .push_slot::<f32>(LayerNormalizationAttrs::VT_EPSILON, epsilon, 0.0);
5053 }
5054 #[inline]
5055 pub fn new(
5056 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5057 ) -> LayerNormalizationAttrsBuilder<'a, 'b, A> {
5058 let start = _fbb.start_table();
5059 LayerNormalizationAttrsBuilder {
5060 fbb_: _fbb,
5061 start_: start,
5062 }
5063 }
5064 #[inline]
5065 pub fn finish(self) -> flatbuffers::WIPOffset<LayerNormalizationAttrs<'a>> {
5066 let o = self.fbb_.end_table(self.start_);
5067 flatbuffers::WIPOffset::new(o.value())
5068 }
5069}
5070
5071impl core::fmt::Debug for LayerNormalizationAttrs<'_> {
5072 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5073 let mut ds = f.debug_struct("LayerNormalizationAttrs");
5074 ds.field("axis", &self.axis());
5075 ds.field("epsilon", &self.epsilon());
5076 ds.finish()
5077 }
5078}
5079pub enum LoopAttrsOffset {}
5080#[derive(Copy, Clone, PartialEq)]
5081
5082pub struct LoopAttrs<'a> {
5083 pub _tab: flatbuffers::Table<'a>,
5084}
5085
5086impl<'a> flatbuffers::Follow<'a> for LoopAttrs<'a> {
5087 type Inner = LoopAttrs<'a>;
5088 #[inline]
5089 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5090 Self {
5091 _tab: flatbuffers::Table::new(buf, loc),
5092 }
5093 }
5094}
5095
5096impl<'a> LoopAttrs<'a> {
5097 pub const VT_BODY: flatbuffers::VOffsetT = 4;
5098
5099 #[inline]
5100 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5101 LoopAttrs { _tab: table }
5102 }
5103 #[allow(unused_mut)]
5104 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5105 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5106 args: &'args LoopAttrsArgs<'args>,
5107 ) -> flatbuffers::WIPOffset<LoopAttrs<'bldr>> {
5108 let mut builder = LoopAttrsBuilder::new(_fbb);
5109 if let Some(x) = args.body {
5110 builder.add_body(x);
5111 }
5112 builder.finish()
5113 }
5114
5115 #[inline]
5116 pub fn body(&self) -> Option<Graph<'a>> {
5117 unsafe {
5121 self._tab
5122 .get::<flatbuffers::ForwardsUOffset<Graph>>(LoopAttrs::VT_BODY, None)
5123 }
5124 }
5125}
5126
5127impl flatbuffers::Verifiable for LoopAttrs<'_> {
5128 #[inline]
5129 fn run_verifier(
5130 v: &mut flatbuffers::Verifier,
5131 pos: usize,
5132 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5133 use self::flatbuffers::Verifiable;
5134 v.visit_table(pos)?
5135 .visit_field::<flatbuffers::ForwardsUOffset<Graph>>("body", Self::VT_BODY, false)?
5136 .finish();
5137 Ok(())
5138 }
5139}
5140pub struct LoopAttrsArgs<'a> {
5141 pub body: Option<flatbuffers::WIPOffset<Graph<'a>>>,
5142}
5143impl<'a> Default for LoopAttrsArgs<'a> {
5144 #[inline]
5145 fn default() -> Self {
5146 LoopAttrsArgs { body: None }
5147 }
5148}
5149
5150pub struct LoopAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5151 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5152 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5153}
5154impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> LoopAttrsBuilder<'a, 'b, A> {
5155 #[inline]
5156 pub fn add_body(&mut self, body: flatbuffers::WIPOffset<Graph<'b>>) {
5157 self.fbb_
5158 .push_slot_always::<flatbuffers::WIPOffset<Graph>>(LoopAttrs::VT_BODY, body);
5159 }
5160 #[inline]
5161 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> LoopAttrsBuilder<'a, 'b, A> {
5162 let start = _fbb.start_table();
5163 LoopAttrsBuilder {
5164 fbb_: _fbb,
5165 start_: start,
5166 }
5167 }
5168 #[inline]
5169 pub fn finish(self) -> flatbuffers::WIPOffset<LoopAttrs<'a>> {
5170 let o = self.fbb_.end_table(self.start_);
5171 flatbuffers::WIPOffset::new(o.value())
5172 }
5173}
5174
5175impl core::fmt::Debug for LoopAttrs<'_> {
5176 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5177 let mut ds = f.debug_struct("LoopAttrs");
5178 ds.field("body", &self.body());
5179 ds.finish()
5180 }
5181}
5182pub enum GatherAttrsOffset {}
5183#[derive(Copy, Clone, PartialEq)]
5184
5185pub struct GatherAttrs<'a> {
5186 pub _tab: flatbuffers::Table<'a>,
5187}
5188
5189impl<'a> flatbuffers::Follow<'a> for GatherAttrs<'a> {
5190 type Inner = GatherAttrs<'a>;
5191 #[inline]
5192 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5193 Self {
5194 _tab: flatbuffers::Table::new(buf, loc),
5195 }
5196 }
5197}
5198
5199impl<'a> GatherAttrs<'a> {
5200 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
5201
5202 #[inline]
5203 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5204 GatherAttrs { _tab: table }
5205 }
5206 #[allow(unused_mut)]
5207 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5208 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5209 args: &'args GatherAttrsArgs,
5210 ) -> flatbuffers::WIPOffset<GatherAttrs<'bldr>> {
5211 let mut builder = GatherAttrsBuilder::new(_fbb);
5212 builder.add_axis(args.axis);
5213 builder.finish()
5214 }
5215
5216 #[inline]
5217 pub fn axis(&self) -> i32 {
5218 unsafe { self._tab.get::<i32>(GatherAttrs::VT_AXIS, Some(0)).unwrap() }
5222 }
5223}
5224
5225impl flatbuffers::Verifiable for GatherAttrs<'_> {
5226 #[inline]
5227 fn run_verifier(
5228 v: &mut flatbuffers::Verifier,
5229 pos: usize,
5230 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5231 use self::flatbuffers::Verifiable;
5232 v.visit_table(pos)?
5233 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
5234 .finish();
5235 Ok(())
5236 }
5237}
5238pub struct GatherAttrsArgs {
5239 pub axis: i32,
5240}
5241impl<'a> Default for GatherAttrsArgs {
5242 #[inline]
5243 fn default() -> Self {
5244 GatherAttrsArgs { axis: 0 }
5245 }
5246}
5247
5248pub struct GatherAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5249 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5250 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5251}
5252impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GatherAttrsBuilder<'a, 'b, A> {
5253 #[inline]
5254 pub fn add_axis(&mut self, axis: i32) {
5255 self.fbb_.push_slot::<i32>(GatherAttrs::VT_AXIS, axis, 0);
5256 }
5257 #[inline]
5258 pub fn new(
5259 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5260 ) -> GatherAttrsBuilder<'a, 'b, A> {
5261 let start = _fbb.start_table();
5262 GatherAttrsBuilder {
5263 fbb_: _fbb,
5264 start_: start,
5265 }
5266 }
5267 #[inline]
5268 pub fn finish(self) -> flatbuffers::WIPOffset<GatherAttrs<'a>> {
5269 let o = self.fbb_.end_table(self.start_);
5270 flatbuffers::WIPOffset::new(o.value())
5271 }
5272}
5273
5274impl core::fmt::Debug for GatherAttrs<'_> {
5275 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5276 let mut ds = f.debug_struct("GatherAttrs");
5277 ds.field("axis", &self.axis());
5278 ds.finish()
5279 }
5280}
5281pub enum GatherNDAttrsOffset {}
5282#[derive(Copy, Clone, PartialEq)]
5283
5284pub struct GatherNDAttrs<'a> {
5285 pub _tab: flatbuffers::Table<'a>,
5286}
5287
5288impl<'a> flatbuffers::Follow<'a> for GatherNDAttrs<'a> {
5289 type Inner = GatherNDAttrs<'a>;
5290 #[inline]
5291 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5292 Self {
5293 _tab: flatbuffers::Table::new(buf, loc),
5294 }
5295 }
5296}
5297
5298impl<'a> GatherNDAttrs<'a> {
5299 pub const VT_BATCH_DIMS: flatbuffers::VOffsetT = 4;
5300
5301 #[inline]
5302 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5303 GatherNDAttrs { _tab: table }
5304 }
5305 #[allow(unused_mut)]
5306 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5307 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5308 args: &'args GatherNDAttrsArgs,
5309 ) -> flatbuffers::WIPOffset<GatherNDAttrs<'bldr>> {
5310 let mut builder = GatherNDAttrsBuilder::new(_fbb);
5311 builder.add_batch_dims(args.batch_dims);
5312 builder.finish()
5313 }
5314
5315 #[inline]
5316 pub fn batch_dims(&self) -> i32 {
5317 unsafe {
5321 self._tab
5322 .get::<i32>(GatherNDAttrs::VT_BATCH_DIMS, Some(0))
5323 .unwrap()
5324 }
5325 }
5326}
5327
5328impl flatbuffers::Verifiable for GatherNDAttrs<'_> {
5329 #[inline]
5330 fn run_verifier(
5331 v: &mut flatbuffers::Verifier,
5332 pos: usize,
5333 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5334 use self::flatbuffers::Verifiable;
5335 v.visit_table(pos)?
5336 .visit_field::<i32>("batch_dims", Self::VT_BATCH_DIMS, false)?
5337 .finish();
5338 Ok(())
5339 }
5340}
5341pub struct GatherNDAttrsArgs {
5342 pub batch_dims: i32,
5343}
5344impl<'a> Default for GatherNDAttrsArgs {
5345 #[inline]
5346 fn default() -> Self {
5347 GatherNDAttrsArgs { batch_dims: 0 }
5348 }
5349}
5350
5351pub struct GatherNDAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5352 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5353 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5354}
5355impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GatherNDAttrsBuilder<'a, 'b, A> {
5356 #[inline]
5357 pub fn add_batch_dims(&mut self, batch_dims: i32) {
5358 self.fbb_
5359 .push_slot::<i32>(GatherNDAttrs::VT_BATCH_DIMS, batch_dims, 0);
5360 }
5361 #[inline]
5362 pub fn new(
5363 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5364 ) -> GatherNDAttrsBuilder<'a, 'b, A> {
5365 let start = _fbb.start_table();
5366 GatherNDAttrsBuilder {
5367 fbb_: _fbb,
5368 start_: start,
5369 }
5370 }
5371 #[inline]
5372 pub fn finish(self) -> flatbuffers::WIPOffset<GatherNDAttrs<'a>> {
5373 let o = self.fbb_.end_table(self.start_);
5374 flatbuffers::WIPOffset::new(o.value())
5375 }
5376}
5377
5378impl core::fmt::Debug for GatherNDAttrs<'_> {
5379 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5380 let mut ds = f.debug_struct("GatherNDAttrs");
5381 ds.field("batch_dims", &self.batch_dims());
5382 ds.finish()
5383 }
5384}
5385pub enum GeluAttrsOffset {}
5386#[derive(Copy, Clone, PartialEq)]
5387
5388pub struct GeluAttrs<'a> {
5389 pub _tab: flatbuffers::Table<'a>,
5390}
5391
5392impl<'a> flatbuffers::Follow<'a> for GeluAttrs<'a> {
5393 type Inner = GeluAttrs<'a>;
5394 #[inline]
5395 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5396 Self {
5397 _tab: flatbuffers::Table::new(buf, loc),
5398 }
5399 }
5400}
5401
5402impl<'a> GeluAttrs<'a> {
5403 pub const VT_APPROXIMATE: flatbuffers::VOffsetT = 4;
5404
5405 #[inline]
5406 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5407 GeluAttrs { _tab: table }
5408 }
5409 #[allow(unused_mut)]
5410 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5411 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5412 args: &'args GeluAttrsArgs,
5413 ) -> flatbuffers::WIPOffset<GeluAttrs<'bldr>> {
5414 let mut builder = GeluAttrsBuilder::new(_fbb);
5415 builder.add_approximate(args.approximate);
5416 builder.finish()
5417 }
5418
5419 #[inline]
5420 pub fn approximate(&self) -> GeluApproximation {
5421 unsafe {
5425 self._tab
5426 .get::<GeluApproximation>(GeluAttrs::VT_APPROXIMATE, Some(GeluApproximation::None))
5427 .unwrap()
5428 }
5429 }
5430}
5431
5432impl flatbuffers::Verifiable for GeluAttrs<'_> {
5433 #[inline]
5434 fn run_verifier(
5435 v: &mut flatbuffers::Verifier,
5436 pos: usize,
5437 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5438 use self::flatbuffers::Verifiable;
5439 v.visit_table(pos)?
5440 .visit_field::<GeluApproximation>("approximate", Self::VT_APPROXIMATE, false)?
5441 .finish();
5442 Ok(())
5443 }
5444}
5445pub struct GeluAttrsArgs {
5446 pub approximate: GeluApproximation,
5447}
5448impl<'a> Default for GeluAttrsArgs {
5449 #[inline]
5450 fn default() -> Self {
5451 GeluAttrsArgs {
5452 approximate: GeluApproximation::None,
5453 }
5454 }
5455}
5456
5457pub struct GeluAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5458 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5459 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5460}
5461impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GeluAttrsBuilder<'a, 'b, A> {
5462 #[inline]
5463 pub fn add_approximate(&mut self, approximate: GeluApproximation) {
5464 self.fbb_.push_slot::<GeluApproximation>(
5465 GeluAttrs::VT_APPROXIMATE,
5466 approximate,
5467 GeluApproximation::None,
5468 );
5469 }
5470 #[inline]
5471 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> GeluAttrsBuilder<'a, 'b, A> {
5472 let start = _fbb.start_table();
5473 GeluAttrsBuilder {
5474 fbb_: _fbb,
5475 start_: start,
5476 }
5477 }
5478 #[inline]
5479 pub fn finish(self) -> flatbuffers::WIPOffset<GeluAttrs<'a>> {
5480 let o = self.fbb_.end_table(self.start_);
5481 flatbuffers::WIPOffset::new(o.value())
5482 }
5483}
5484
5485impl core::fmt::Debug for GeluAttrs<'_> {
5486 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5487 let mut ds = f.debug_struct("GeluAttrs");
5488 ds.field("approximate", &self.approximate());
5489 ds.finish()
5490 }
5491}
5492pub enum GemmAttrsOffset {}
5493#[derive(Copy, Clone, PartialEq)]
5494
5495pub struct GemmAttrs<'a> {
5496 pub _tab: flatbuffers::Table<'a>,
5497}
5498
5499impl<'a> flatbuffers::Follow<'a> for GemmAttrs<'a> {
5500 type Inner = GemmAttrs<'a>;
5501 #[inline]
5502 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5503 Self {
5504 _tab: flatbuffers::Table::new(buf, loc),
5505 }
5506 }
5507}
5508
5509impl<'a> GemmAttrs<'a> {
5510 pub const VT_ALPHA: flatbuffers::VOffsetT = 4;
5511 pub const VT_BETA: flatbuffers::VOffsetT = 6;
5512 pub const VT_TRANSPOSE_A: flatbuffers::VOffsetT = 8;
5513 pub const VT_TRANSPOSE_B: flatbuffers::VOffsetT = 10;
5514
5515 #[inline]
5516 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5517 GemmAttrs { _tab: table }
5518 }
5519 #[allow(unused_mut)]
5520 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5521 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5522 args: &'args GemmAttrsArgs,
5523 ) -> flatbuffers::WIPOffset<GemmAttrs<'bldr>> {
5524 let mut builder = GemmAttrsBuilder::new(_fbb);
5525 builder.add_beta(args.beta);
5526 builder.add_alpha(args.alpha);
5527 builder.add_transpose_b(args.transpose_b);
5528 builder.add_transpose_a(args.transpose_a);
5529 builder.finish()
5530 }
5531
5532 #[inline]
5533 pub fn alpha(&self) -> f32 {
5534 unsafe {
5538 self._tab
5539 .get::<f32>(GemmAttrs::VT_ALPHA, Some(0.0))
5540 .unwrap()
5541 }
5542 }
5543 #[inline]
5544 pub fn beta(&self) -> f32 {
5545 unsafe { self._tab.get::<f32>(GemmAttrs::VT_BETA, Some(0.0)).unwrap() }
5549 }
5550 #[inline]
5551 pub fn transpose_a(&self) -> bool {
5552 unsafe {
5556 self._tab
5557 .get::<bool>(GemmAttrs::VT_TRANSPOSE_A, Some(false))
5558 .unwrap()
5559 }
5560 }
5561 #[inline]
5562 pub fn transpose_b(&self) -> bool {
5563 unsafe {
5567 self._tab
5568 .get::<bool>(GemmAttrs::VT_TRANSPOSE_B, Some(false))
5569 .unwrap()
5570 }
5571 }
5572}
5573
5574impl flatbuffers::Verifiable for GemmAttrs<'_> {
5575 #[inline]
5576 fn run_verifier(
5577 v: &mut flatbuffers::Verifier,
5578 pos: usize,
5579 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5580 use self::flatbuffers::Verifiable;
5581 v.visit_table(pos)?
5582 .visit_field::<f32>("alpha", Self::VT_ALPHA, false)?
5583 .visit_field::<f32>("beta", Self::VT_BETA, false)?
5584 .visit_field::<bool>("transpose_a", Self::VT_TRANSPOSE_A, false)?
5585 .visit_field::<bool>("transpose_b", Self::VT_TRANSPOSE_B, false)?
5586 .finish();
5587 Ok(())
5588 }
5589}
5590pub struct GemmAttrsArgs {
5591 pub alpha: f32,
5592 pub beta: f32,
5593 pub transpose_a: bool,
5594 pub transpose_b: bool,
5595}
5596impl<'a> Default for GemmAttrsArgs {
5597 #[inline]
5598 fn default() -> Self {
5599 GemmAttrsArgs {
5600 alpha: 0.0,
5601 beta: 0.0,
5602 transpose_a: false,
5603 transpose_b: false,
5604 }
5605 }
5606}
5607
5608pub struct GemmAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5609 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5610 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5611}
5612impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GemmAttrsBuilder<'a, 'b, A> {
5613 #[inline]
5614 pub fn add_alpha(&mut self, alpha: f32) {
5615 self.fbb_.push_slot::<f32>(GemmAttrs::VT_ALPHA, alpha, 0.0);
5616 }
5617 #[inline]
5618 pub fn add_beta(&mut self, beta: f32) {
5619 self.fbb_.push_slot::<f32>(GemmAttrs::VT_BETA, beta, 0.0);
5620 }
5621 #[inline]
5622 pub fn add_transpose_a(&mut self, transpose_a: bool) {
5623 self.fbb_
5624 .push_slot::<bool>(GemmAttrs::VT_TRANSPOSE_A, transpose_a, false);
5625 }
5626 #[inline]
5627 pub fn add_transpose_b(&mut self, transpose_b: bool) {
5628 self.fbb_
5629 .push_slot::<bool>(GemmAttrs::VT_TRANSPOSE_B, transpose_b, false);
5630 }
5631 #[inline]
5632 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> GemmAttrsBuilder<'a, 'b, A> {
5633 let start = _fbb.start_table();
5634 GemmAttrsBuilder {
5635 fbb_: _fbb,
5636 start_: start,
5637 }
5638 }
5639 #[inline]
5640 pub fn finish(self) -> flatbuffers::WIPOffset<GemmAttrs<'a>> {
5641 let o = self.fbb_.end_table(self.start_);
5642 flatbuffers::WIPOffset::new(o.value())
5643 }
5644}
5645
5646impl core::fmt::Debug for GemmAttrs<'_> {
5647 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5648 let mut ds = f.debug_struct("GemmAttrs");
5649 ds.field("alpha", &self.alpha());
5650 ds.field("beta", &self.beta());
5651 ds.field("transpose_a", &self.transpose_a());
5652 ds.field("transpose_b", &self.transpose_b());
5653 ds.finish()
5654 }
5655}
5656pub enum GridSampleAttrsOffset {}
5657#[derive(Copy, Clone, PartialEq)]
5658
5659pub struct GridSampleAttrs<'a> {
5660 pub _tab: flatbuffers::Table<'a>,
5661}
5662
5663impl<'a> flatbuffers::Follow<'a> for GridSampleAttrs<'a> {
5664 type Inner = GridSampleAttrs<'a>;
5665 #[inline]
5666 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5667 Self {
5668 _tab: flatbuffers::Table::new(buf, loc),
5669 }
5670 }
5671}
5672
5673impl<'a> GridSampleAttrs<'a> {
5674 pub const VT_ALIGN_CORNERS: flatbuffers::VOffsetT = 4;
5675
5676 #[inline]
5677 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5678 GridSampleAttrs { _tab: table }
5679 }
5680 #[allow(unused_mut)]
5681 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5682 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5683 args: &'args GridSampleAttrsArgs,
5684 ) -> flatbuffers::WIPOffset<GridSampleAttrs<'bldr>> {
5685 let mut builder = GridSampleAttrsBuilder::new(_fbb);
5686 builder.add_align_corners(args.align_corners);
5687 builder.finish()
5688 }
5689
5690 #[inline]
5691 pub fn align_corners(&self) -> bool {
5692 unsafe {
5696 self._tab
5697 .get::<bool>(GridSampleAttrs::VT_ALIGN_CORNERS, Some(false))
5698 .unwrap()
5699 }
5700 }
5701}
5702
5703impl flatbuffers::Verifiable for GridSampleAttrs<'_> {
5704 #[inline]
5705 fn run_verifier(
5706 v: &mut flatbuffers::Verifier,
5707 pos: usize,
5708 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5709 use self::flatbuffers::Verifiable;
5710 v.visit_table(pos)?
5711 .visit_field::<bool>("align_corners", Self::VT_ALIGN_CORNERS, false)?
5712 .finish();
5713 Ok(())
5714 }
5715}
5716pub struct GridSampleAttrsArgs {
5717 pub align_corners: bool,
5718}
5719impl<'a> Default for GridSampleAttrsArgs {
5720 #[inline]
5721 fn default() -> Self {
5722 GridSampleAttrsArgs {
5723 align_corners: false,
5724 }
5725 }
5726}
5727
5728pub struct GridSampleAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5729 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5730 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5731}
5732impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GridSampleAttrsBuilder<'a, 'b, A> {
5733 #[inline]
5734 pub fn add_align_corners(&mut self, align_corners: bool) {
5735 self.fbb_
5736 .push_slot::<bool>(GridSampleAttrs::VT_ALIGN_CORNERS, align_corners, false);
5737 }
5738 #[inline]
5739 pub fn new(
5740 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5741 ) -> GridSampleAttrsBuilder<'a, 'b, A> {
5742 let start = _fbb.start_table();
5743 GridSampleAttrsBuilder {
5744 fbb_: _fbb,
5745 start_: start,
5746 }
5747 }
5748 #[inline]
5749 pub fn finish(self) -> flatbuffers::WIPOffset<GridSampleAttrs<'a>> {
5750 let o = self.fbb_.end_table(self.start_);
5751 flatbuffers::WIPOffset::new(o.value())
5752 }
5753}
5754
5755impl core::fmt::Debug for GridSampleAttrs<'_> {
5756 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5757 let mut ds = f.debug_struct("GridSampleAttrs");
5758 ds.field("align_corners", &self.align_corners());
5759 ds.finish()
5760 }
5761}
5762pub enum GRUAttrsOffset {}
5763#[derive(Copy, Clone, PartialEq)]
5764
5765pub struct GRUAttrs<'a> {
5766 pub _tab: flatbuffers::Table<'a>,
5767}
5768
5769impl<'a> flatbuffers::Follow<'a> for GRUAttrs<'a> {
5770 type Inner = GRUAttrs<'a>;
5771 #[inline]
5772 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5773 Self {
5774 _tab: flatbuffers::Table::new(buf, loc),
5775 }
5776 }
5777}
5778
5779impl<'a> GRUAttrs<'a> {
5780 pub const VT_DIRECTION: flatbuffers::VOffsetT = 4;
5781 pub const VT_HIDDEN_SIZE: flatbuffers::VOffsetT = 6;
5782 pub const VT_LINEAR_BEFORE_RESET: flatbuffers::VOffsetT = 8;
5783
5784 #[inline]
5785 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5786 GRUAttrs { _tab: table }
5787 }
5788 #[allow(unused_mut)]
5789 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5790 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5791 args: &'args GRUAttrsArgs,
5792 ) -> flatbuffers::WIPOffset<GRUAttrs<'bldr>> {
5793 let mut builder = GRUAttrsBuilder::new(_fbb);
5794 builder.add_hidden_size(args.hidden_size);
5795 builder.add_linear_before_reset(args.linear_before_reset);
5796 builder.add_direction(args.direction);
5797 builder.finish()
5798 }
5799
5800 #[inline]
5801 pub fn direction(&self) -> RNNDirection {
5802 unsafe {
5806 self._tab
5807 .get::<RNNDirection>(GRUAttrs::VT_DIRECTION, Some(RNNDirection::Forward))
5808 .unwrap()
5809 }
5810 }
5811 #[inline]
5812 pub fn hidden_size(&self) -> u32 {
5813 unsafe {
5817 self._tab
5818 .get::<u32>(GRUAttrs::VT_HIDDEN_SIZE, Some(0))
5819 .unwrap()
5820 }
5821 }
5822 #[inline]
5823 pub fn linear_before_reset(&self) -> bool {
5824 unsafe {
5828 self._tab
5829 .get::<bool>(GRUAttrs::VT_LINEAR_BEFORE_RESET, Some(false))
5830 .unwrap()
5831 }
5832 }
5833}
5834
5835impl flatbuffers::Verifiable for GRUAttrs<'_> {
5836 #[inline]
5837 fn run_verifier(
5838 v: &mut flatbuffers::Verifier,
5839 pos: usize,
5840 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5841 use self::flatbuffers::Verifiable;
5842 v.visit_table(pos)?
5843 .visit_field::<RNNDirection>("direction", Self::VT_DIRECTION, false)?
5844 .visit_field::<u32>("hidden_size", Self::VT_HIDDEN_SIZE, false)?
5845 .visit_field::<bool>("linear_before_reset", Self::VT_LINEAR_BEFORE_RESET, false)?
5846 .finish();
5847 Ok(())
5848 }
5849}
5850pub struct GRUAttrsArgs {
5851 pub direction: RNNDirection,
5852 pub hidden_size: u32,
5853 pub linear_before_reset: bool,
5854}
5855impl<'a> Default for GRUAttrsArgs {
5856 #[inline]
5857 fn default() -> Self {
5858 GRUAttrsArgs {
5859 direction: RNNDirection::Forward,
5860 hidden_size: 0,
5861 linear_before_reset: false,
5862 }
5863 }
5864}
5865
5866pub struct GRUAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
5867 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
5868 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5869}
5870impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GRUAttrsBuilder<'a, 'b, A> {
5871 #[inline]
5872 pub fn add_direction(&mut self, direction: RNNDirection) {
5873 self.fbb_.push_slot::<RNNDirection>(
5874 GRUAttrs::VT_DIRECTION,
5875 direction,
5876 RNNDirection::Forward,
5877 );
5878 }
5879 #[inline]
5880 pub fn add_hidden_size(&mut self, hidden_size: u32) {
5881 self.fbb_
5882 .push_slot::<u32>(GRUAttrs::VT_HIDDEN_SIZE, hidden_size, 0);
5883 }
5884 #[inline]
5885 pub fn add_linear_before_reset(&mut self, linear_before_reset: bool) {
5886 self.fbb_
5887 .push_slot::<bool>(GRUAttrs::VT_LINEAR_BEFORE_RESET, linear_before_reset, false);
5888 }
5889 #[inline]
5890 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> GRUAttrsBuilder<'a, 'b, A> {
5891 let start = _fbb.start_table();
5892 GRUAttrsBuilder {
5893 fbb_: _fbb,
5894 start_: start,
5895 }
5896 }
5897 #[inline]
5898 pub fn finish(self) -> flatbuffers::WIPOffset<GRUAttrs<'a>> {
5899 let o = self.fbb_.end_table(self.start_);
5900 flatbuffers::WIPOffset::new(o.value())
5901 }
5902}
5903
5904impl core::fmt::Debug for GRUAttrs<'_> {
5905 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5906 let mut ds = f.debug_struct("GRUAttrs");
5907 ds.field("direction", &self.direction());
5908 ds.field("hidden_size", &self.hidden_size());
5909 ds.field("linear_before_reset", &self.linear_before_reset());
5910 ds.finish()
5911 }
5912}
5913pub enum HardSigmoidAttrsOffset {}
5914#[derive(Copy, Clone, PartialEq)]
5915
5916pub struct HardSigmoidAttrs<'a> {
5917 pub _tab: flatbuffers::Table<'a>,
5918}
5919
5920impl<'a> flatbuffers::Follow<'a> for HardSigmoidAttrs<'a> {
5921 type Inner = HardSigmoidAttrs<'a>;
5922 #[inline]
5923 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5924 Self {
5925 _tab: flatbuffers::Table::new(buf, loc),
5926 }
5927 }
5928}
5929
5930impl<'a> HardSigmoidAttrs<'a> {
5931 pub const VT_ALPHA: flatbuffers::VOffsetT = 4;
5932 pub const VT_BETA: flatbuffers::VOffsetT = 6;
5933
5934 #[inline]
5935 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5936 HardSigmoidAttrs { _tab: table }
5937 }
5938 #[allow(unused_mut)]
5939 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
5940 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
5941 args: &'args HardSigmoidAttrsArgs,
5942 ) -> flatbuffers::WIPOffset<HardSigmoidAttrs<'bldr>> {
5943 let mut builder = HardSigmoidAttrsBuilder::new(_fbb);
5944 builder.add_beta(args.beta);
5945 builder.add_alpha(args.alpha);
5946 builder.finish()
5947 }
5948
5949 #[inline]
5950 pub fn alpha(&self) -> f32 {
5951 unsafe {
5955 self._tab
5956 .get::<f32>(HardSigmoidAttrs::VT_ALPHA, Some(0.0))
5957 .unwrap()
5958 }
5959 }
5960 #[inline]
5961 pub fn beta(&self) -> f32 {
5962 unsafe {
5966 self._tab
5967 .get::<f32>(HardSigmoidAttrs::VT_BETA, Some(0.0))
5968 .unwrap()
5969 }
5970 }
5971}
5972
5973impl flatbuffers::Verifiable for HardSigmoidAttrs<'_> {
5974 #[inline]
5975 fn run_verifier(
5976 v: &mut flatbuffers::Verifier,
5977 pos: usize,
5978 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5979 use self::flatbuffers::Verifiable;
5980 v.visit_table(pos)?
5981 .visit_field::<f32>("alpha", Self::VT_ALPHA, false)?
5982 .visit_field::<f32>("beta", Self::VT_BETA, false)?
5983 .finish();
5984 Ok(())
5985 }
5986}
5987pub struct HardSigmoidAttrsArgs {
5988 pub alpha: f32,
5989 pub beta: f32,
5990}
5991impl<'a> Default for HardSigmoidAttrsArgs {
5992 #[inline]
5993 fn default() -> Self {
5994 HardSigmoidAttrsArgs {
5995 alpha: 0.0,
5996 beta: 0.0,
5997 }
5998 }
5999}
6000
6001pub struct HardSigmoidAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6002 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6003 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6004}
6005impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> HardSigmoidAttrsBuilder<'a, 'b, A> {
6006 #[inline]
6007 pub fn add_alpha(&mut self, alpha: f32) {
6008 self.fbb_
6009 .push_slot::<f32>(HardSigmoidAttrs::VT_ALPHA, alpha, 0.0);
6010 }
6011 #[inline]
6012 pub fn add_beta(&mut self, beta: f32) {
6013 self.fbb_
6014 .push_slot::<f32>(HardSigmoidAttrs::VT_BETA, beta, 0.0);
6015 }
6016 #[inline]
6017 pub fn new(
6018 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6019 ) -> HardSigmoidAttrsBuilder<'a, 'b, A> {
6020 let start = _fbb.start_table();
6021 HardSigmoidAttrsBuilder {
6022 fbb_: _fbb,
6023 start_: start,
6024 }
6025 }
6026 #[inline]
6027 pub fn finish(self) -> flatbuffers::WIPOffset<HardSigmoidAttrs<'a>> {
6028 let o = self.fbb_.end_table(self.start_);
6029 flatbuffers::WIPOffset::new(o.value())
6030 }
6031}
6032
6033impl core::fmt::Debug for HardSigmoidAttrs<'_> {
6034 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6035 let mut ds = f.debug_struct("HardSigmoidAttrs");
6036 ds.field("alpha", &self.alpha());
6037 ds.field("beta", &self.beta());
6038 ds.finish()
6039 }
6040}
6041pub enum IfAttrsOffset {}
6042#[derive(Copy, Clone, PartialEq)]
6043
6044pub struct IfAttrs<'a> {
6045 pub _tab: flatbuffers::Table<'a>,
6046}
6047
6048impl<'a> flatbuffers::Follow<'a> for IfAttrs<'a> {
6049 type Inner = IfAttrs<'a>;
6050 #[inline]
6051 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
6052 Self {
6053 _tab: flatbuffers::Table::new(buf, loc),
6054 }
6055 }
6056}
6057
6058impl<'a> IfAttrs<'a> {
6059 pub const VT_THEN_BRANCH: flatbuffers::VOffsetT = 4;
6060 pub const VT_ELSE_BRANCH: flatbuffers::VOffsetT = 6;
6061
6062 #[inline]
6063 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
6064 IfAttrs { _tab: table }
6065 }
6066 #[allow(unused_mut)]
6067 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
6068 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
6069 args: &'args IfAttrsArgs<'args>,
6070 ) -> flatbuffers::WIPOffset<IfAttrs<'bldr>> {
6071 let mut builder = IfAttrsBuilder::new(_fbb);
6072 if let Some(x) = args.else_branch {
6073 builder.add_else_branch(x);
6074 }
6075 if let Some(x) = args.then_branch {
6076 builder.add_then_branch(x);
6077 }
6078 builder.finish()
6079 }
6080
6081 #[inline]
6082 pub fn then_branch(&self) -> Option<Graph<'a>> {
6083 unsafe {
6087 self._tab
6088 .get::<flatbuffers::ForwardsUOffset<Graph>>(IfAttrs::VT_THEN_BRANCH, None)
6089 }
6090 }
6091 #[inline]
6092 pub fn else_branch(&self) -> Option<Graph<'a>> {
6093 unsafe {
6097 self._tab
6098 .get::<flatbuffers::ForwardsUOffset<Graph>>(IfAttrs::VT_ELSE_BRANCH, None)
6099 }
6100 }
6101}
6102
6103impl flatbuffers::Verifiable for IfAttrs<'_> {
6104 #[inline]
6105 fn run_verifier(
6106 v: &mut flatbuffers::Verifier,
6107 pos: usize,
6108 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
6109 use self::flatbuffers::Verifiable;
6110 v.visit_table(pos)?
6111 .visit_field::<flatbuffers::ForwardsUOffset<Graph>>(
6112 "then_branch",
6113 Self::VT_THEN_BRANCH,
6114 false,
6115 )?
6116 .visit_field::<flatbuffers::ForwardsUOffset<Graph>>(
6117 "else_branch",
6118 Self::VT_ELSE_BRANCH,
6119 false,
6120 )?
6121 .finish();
6122 Ok(())
6123 }
6124}
6125pub struct IfAttrsArgs<'a> {
6126 pub then_branch: Option<flatbuffers::WIPOffset<Graph<'a>>>,
6127 pub else_branch: Option<flatbuffers::WIPOffset<Graph<'a>>>,
6128}
6129impl<'a> Default for IfAttrsArgs<'a> {
6130 #[inline]
6131 fn default() -> Self {
6132 IfAttrsArgs {
6133 then_branch: None,
6134 else_branch: None,
6135 }
6136 }
6137}
6138
6139pub struct IfAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6140 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6141 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6142}
6143impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> IfAttrsBuilder<'a, 'b, A> {
6144 #[inline]
6145 pub fn add_then_branch(&mut self, then_branch: flatbuffers::WIPOffset<Graph<'b>>) {
6146 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Graph>>(
6147 IfAttrs::VT_THEN_BRANCH,
6148 then_branch,
6149 );
6150 }
6151 #[inline]
6152 pub fn add_else_branch(&mut self, else_branch: flatbuffers::WIPOffset<Graph<'b>>) {
6153 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Graph>>(
6154 IfAttrs::VT_ELSE_BRANCH,
6155 else_branch,
6156 );
6157 }
6158 #[inline]
6159 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> IfAttrsBuilder<'a, 'b, A> {
6160 let start = _fbb.start_table();
6161 IfAttrsBuilder {
6162 fbb_: _fbb,
6163 start_: start,
6164 }
6165 }
6166 #[inline]
6167 pub fn finish(self) -> flatbuffers::WIPOffset<IfAttrs<'a>> {
6168 let o = self.fbb_.end_table(self.start_);
6169 flatbuffers::WIPOffset::new(o.value())
6170 }
6171}
6172
6173impl core::fmt::Debug for IfAttrs<'_> {
6174 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6175 let mut ds = f.debug_struct("IfAttrs");
6176 ds.field("then_branch", &self.then_branch());
6177 ds.field("else_branch", &self.else_branch());
6178 ds.finish()
6179 }
6180}
6181pub enum LeakyReluAttrsOffset {}
6182#[derive(Copy, Clone, PartialEq)]
6183
6184pub struct LeakyReluAttrs<'a> {
6185 pub _tab: flatbuffers::Table<'a>,
6186}
6187
6188impl<'a> flatbuffers::Follow<'a> for LeakyReluAttrs<'a> {
6189 type Inner = LeakyReluAttrs<'a>;
6190 #[inline]
6191 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
6192 Self {
6193 _tab: flatbuffers::Table::new(buf, loc),
6194 }
6195 }
6196}
6197
6198impl<'a> LeakyReluAttrs<'a> {
6199 pub const VT_ALPHA: flatbuffers::VOffsetT = 4;
6200
6201 #[inline]
6202 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
6203 LeakyReluAttrs { _tab: table }
6204 }
6205 #[allow(unused_mut)]
6206 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
6207 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
6208 args: &'args LeakyReluAttrsArgs,
6209 ) -> flatbuffers::WIPOffset<LeakyReluAttrs<'bldr>> {
6210 let mut builder = LeakyReluAttrsBuilder::new(_fbb);
6211 builder.add_alpha(args.alpha);
6212 builder.finish()
6213 }
6214
6215 #[inline]
6216 pub fn alpha(&self) -> f32 {
6217 unsafe {
6221 self._tab
6222 .get::<f32>(LeakyReluAttrs::VT_ALPHA, Some(0.0))
6223 .unwrap()
6224 }
6225 }
6226}
6227
6228impl flatbuffers::Verifiable for LeakyReluAttrs<'_> {
6229 #[inline]
6230 fn run_verifier(
6231 v: &mut flatbuffers::Verifier,
6232 pos: usize,
6233 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
6234 use self::flatbuffers::Verifiable;
6235 v.visit_table(pos)?
6236 .visit_field::<f32>("alpha", Self::VT_ALPHA, false)?
6237 .finish();
6238 Ok(())
6239 }
6240}
6241pub struct LeakyReluAttrsArgs {
6242 pub alpha: f32,
6243}
6244impl<'a> Default for LeakyReluAttrsArgs {
6245 #[inline]
6246 fn default() -> Self {
6247 LeakyReluAttrsArgs { alpha: 0.0 }
6248 }
6249}
6250
6251pub struct LeakyReluAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6252 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6253 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6254}
6255impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> LeakyReluAttrsBuilder<'a, 'b, A> {
6256 #[inline]
6257 pub fn add_alpha(&mut self, alpha: f32) {
6258 self.fbb_
6259 .push_slot::<f32>(LeakyReluAttrs::VT_ALPHA, alpha, 0.0);
6260 }
6261 #[inline]
6262 pub fn new(
6263 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6264 ) -> LeakyReluAttrsBuilder<'a, 'b, A> {
6265 let start = _fbb.start_table();
6266 LeakyReluAttrsBuilder {
6267 fbb_: _fbb,
6268 start_: start,
6269 }
6270 }
6271 #[inline]
6272 pub fn finish(self) -> flatbuffers::WIPOffset<LeakyReluAttrs<'a>> {
6273 let o = self.fbb_.end_table(self.start_);
6274 flatbuffers::WIPOffset::new(o.value())
6275 }
6276}
6277
6278impl core::fmt::Debug for LeakyReluAttrs<'_> {
6279 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6280 let mut ds = f.debug_struct("LeakyReluAttrs");
6281 ds.field("alpha", &self.alpha());
6282 ds.finish()
6283 }
6284}
6285pub enum LSTMAttrsOffset {}
6286#[derive(Copy, Clone, PartialEq)]
6287
6288pub struct LSTMAttrs<'a> {
6289 pub _tab: flatbuffers::Table<'a>,
6290}
6291
6292impl<'a> flatbuffers::Follow<'a> for LSTMAttrs<'a> {
6293 type Inner = LSTMAttrs<'a>;
6294 #[inline]
6295 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
6296 Self {
6297 _tab: flatbuffers::Table::new(buf, loc),
6298 }
6299 }
6300}
6301
6302impl<'a> LSTMAttrs<'a> {
6303 pub const VT_DIRECTION: flatbuffers::VOffsetT = 4;
6304 pub const VT_HIDDEN_SIZE: flatbuffers::VOffsetT = 6;
6305
6306 #[inline]
6307 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
6308 LSTMAttrs { _tab: table }
6309 }
6310 #[allow(unused_mut)]
6311 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
6312 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
6313 args: &'args LSTMAttrsArgs,
6314 ) -> flatbuffers::WIPOffset<LSTMAttrs<'bldr>> {
6315 let mut builder = LSTMAttrsBuilder::new(_fbb);
6316 builder.add_hidden_size(args.hidden_size);
6317 builder.add_direction(args.direction);
6318 builder.finish()
6319 }
6320
6321 #[inline]
6322 pub fn direction(&self) -> RNNDirection {
6323 unsafe {
6327 self._tab
6328 .get::<RNNDirection>(LSTMAttrs::VT_DIRECTION, Some(RNNDirection::Forward))
6329 .unwrap()
6330 }
6331 }
6332 #[inline]
6333 pub fn hidden_size(&self) -> u32 {
6334 unsafe {
6338 self._tab
6339 .get::<u32>(LSTMAttrs::VT_HIDDEN_SIZE, Some(0))
6340 .unwrap()
6341 }
6342 }
6343}
6344
6345impl flatbuffers::Verifiable for LSTMAttrs<'_> {
6346 #[inline]
6347 fn run_verifier(
6348 v: &mut flatbuffers::Verifier,
6349 pos: usize,
6350 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
6351 use self::flatbuffers::Verifiable;
6352 v.visit_table(pos)?
6353 .visit_field::<RNNDirection>("direction", Self::VT_DIRECTION, false)?
6354 .visit_field::<u32>("hidden_size", Self::VT_HIDDEN_SIZE, false)?
6355 .finish();
6356 Ok(())
6357 }
6358}
6359pub struct LSTMAttrsArgs {
6360 pub direction: RNNDirection,
6361 pub hidden_size: u32,
6362}
6363impl<'a> Default for LSTMAttrsArgs {
6364 #[inline]
6365 fn default() -> Self {
6366 LSTMAttrsArgs {
6367 direction: RNNDirection::Forward,
6368 hidden_size: 0,
6369 }
6370 }
6371}
6372
6373pub struct LSTMAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6374 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6375 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6376}
6377impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> LSTMAttrsBuilder<'a, 'b, A> {
6378 #[inline]
6379 pub fn add_direction(&mut self, direction: RNNDirection) {
6380 self.fbb_.push_slot::<RNNDirection>(
6381 LSTMAttrs::VT_DIRECTION,
6382 direction,
6383 RNNDirection::Forward,
6384 );
6385 }
6386 #[inline]
6387 pub fn add_hidden_size(&mut self, hidden_size: u32) {
6388 self.fbb_
6389 .push_slot::<u32>(LSTMAttrs::VT_HIDDEN_SIZE, hidden_size, 0);
6390 }
6391 #[inline]
6392 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> LSTMAttrsBuilder<'a, 'b, A> {
6393 let start = _fbb.start_table();
6394 LSTMAttrsBuilder {
6395 fbb_: _fbb,
6396 start_: start,
6397 }
6398 }
6399 #[inline]
6400 pub fn finish(self) -> flatbuffers::WIPOffset<LSTMAttrs<'a>> {
6401 let o = self.fbb_.end_table(self.start_);
6402 flatbuffers::WIPOffset::new(o.value())
6403 }
6404}
6405
6406impl core::fmt::Debug for LSTMAttrs<'_> {
6407 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6408 let mut ds = f.debug_struct("LSTMAttrs");
6409 ds.field("direction", &self.direction());
6410 ds.field("hidden_size", &self.hidden_size());
6411 ds.finish()
6412 }
6413}
6414pub enum MaxPoolAttrsOffset {}
6415#[derive(Copy, Clone, PartialEq)]
6416
6417pub struct MaxPoolAttrs<'a> {
6418 pub _tab: flatbuffers::Table<'a>,
6419}
6420
6421impl<'a> flatbuffers::Follow<'a> for MaxPoolAttrs<'a> {
6422 type Inner = MaxPoolAttrs<'a>;
6423 #[inline]
6424 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
6425 Self {
6426 _tab: flatbuffers::Table::new(buf, loc),
6427 }
6428 }
6429}
6430
6431impl<'a> MaxPoolAttrs<'a> {
6432 pub const VT_KERNEL_SIZE: flatbuffers::VOffsetT = 4;
6433 pub const VT_AUTO_PAD: flatbuffers::VOffsetT = 6;
6434 pub const VT_PADS: flatbuffers::VOffsetT = 8;
6435 pub const VT_STRIDES: flatbuffers::VOffsetT = 10;
6436 pub const VT_CEIL_MODE: flatbuffers::VOffsetT = 12;
6437
6438 #[inline]
6439 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
6440 MaxPoolAttrs { _tab: table }
6441 }
6442 #[allow(unused_mut)]
6443 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
6444 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
6445 args: &'args MaxPoolAttrsArgs<'args>,
6446 ) -> flatbuffers::WIPOffset<MaxPoolAttrs<'bldr>> {
6447 let mut builder = MaxPoolAttrsBuilder::new(_fbb);
6448 if let Some(x) = args.strides {
6449 builder.add_strides(x);
6450 }
6451 if let Some(x) = args.pads {
6452 builder.add_pads(x);
6453 }
6454 if let Some(x) = args.kernel_size {
6455 builder.add_kernel_size(x);
6456 }
6457 builder.add_ceil_mode(args.ceil_mode);
6458 builder.add_auto_pad(args.auto_pad);
6459 builder.finish()
6460 }
6461
6462 #[inline]
6463 pub fn kernel_size(&self) -> flatbuffers::Vector<'a, u32> {
6464 unsafe {
6468 self._tab
6469 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
6470 MaxPoolAttrs::VT_KERNEL_SIZE,
6471 None,
6472 )
6473 .unwrap()
6474 }
6475 }
6476 #[inline]
6477 pub fn auto_pad(&self) -> AutoPad {
6478 unsafe {
6482 self._tab
6483 .get::<AutoPad>(MaxPoolAttrs::VT_AUTO_PAD, Some(AutoPad::Same))
6484 .unwrap()
6485 }
6486 }
6487 #[inline]
6488 pub fn pads(&self) -> Option<flatbuffers::Vector<'a, u32>> {
6489 unsafe {
6493 self._tab
6494 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
6495 MaxPoolAttrs::VT_PADS,
6496 None,
6497 )
6498 }
6499 }
6500 #[inline]
6501 pub fn strides(&self) -> Option<flatbuffers::Vector<'a, u32>> {
6502 unsafe {
6506 self._tab
6507 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
6508 MaxPoolAttrs::VT_STRIDES,
6509 None,
6510 )
6511 }
6512 }
6513 #[inline]
6514 pub fn ceil_mode(&self) -> bool {
6515 unsafe {
6519 self._tab
6520 .get::<bool>(MaxPoolAttrs::VT_CEIL_MODE, Some(false))
6521 .unwrap()
6522 }
6523 }
6524}
6525
6526impl flatbuffers::Verifiable for MaxPoolAttrs<'_> {
6527 #[inline]
6528 fn run_verifier(
6529 v: &mut flatbuffers::Verifier,
6530 pos: usize,
6531 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
6532 use self::flatbuffers::Verifiable;
6533 v.visit_table(pos)?
6534 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
6535 "kernel_size",
6536 Self::VT_KERNEL_SIZE,
6537 true,
6538 )?
6539 .visit_field::<AutoPad>("auto_pad", Self::VT_AUTO_PAD, false)?
6540 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
6541 "pads",
6542 Self::VT_PADS,
6543 false,
6544 )?
6545 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
6546 "strides",
6547 Self::VT_STRIDES,
6548 false,
6549 )?
6550 .visit_field::<bool>("ceil_mode", Self::VT_CEIL_MODE, false)?
6551 .finish();
6552 Ok(())
6553 }
6554}
6555pub struct MaxPoolAttrsArgs<'a> {
6556 pub kernel_size: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
6557 pub auto_pad: AutoPad,
6558 pub pads: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
6559 pub strides: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
6560 pub ceil_mode: bool,
6561}
6562impl<'a> Default for MaxPoolAttrsArgs<'a> {
6563 #[inline]
6564 fn default() -> Self {
6565 MaxPoolAttrsArgs {
6566 kernel_size: None, auto_pad: AutoPad::Same,
6568 pads: None,
6569 strides: None,
6570 ceil_mode: false,
6571 }
6572 }
6573}
6574
6575pub struct MaxPoolAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6576 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6577 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6578}
6579impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> MaxPoolAttrsBuilder<'a, 'b, A> {
6580 #[inline]
6581 pub fn add_kernel_size(
6582 &mut self,
6583 kernel_size: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>,
6584 ) {
6585 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
6586 MaxPoolAttrs::VT_KERNEL_SIZE,
6587 kernel_size,
6588 );
6589 }
6590 #[inline]
6591 pub fn add_auto_pad(&mut self, auto_pad: AutoPad) {
6592 self.fbb_
6593 .push_slot::<AutoPad>(MaxPoolAttrs::VT_AUTO_PAD, auto_pad, AutoPad::Same);
6594 }
6595 #[inline]
6596 pub fn add_pads(&mut self, pads: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
6597 self.fbb_
6598 .push_slot_always::<flatbuffers::WIPOffset<_>>(MaxPoolAttrs::VT_PADS, pads);
6599 }
6600 #[inline]
6601 pub fn add_strides(&mut self, strides: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
6602 self.fbb_
6603 .push_slot_always::<flatbuffers::WIPOffset<_>>(MaxPoolAttrs::VT_STRIDES, strides);
6604 }
6605 #[inline]
6606 pub fn add_ceil_mode(&mut self, ceil_mode: bool) {
6607 self.fbb_
6608 .push_slot::<bool>(MaxPoolAttrs::VT_CEIL_MODE, ceil_mode, false);
6609 }
6610 #[inline]
6611 pub fn new(
6612 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6613 ) -> MaxPoolAttrsBuilder<'a, 'b, A> {
6614 let start = _fbb.start_table();
6615 MaxPoolAttrsBuilder {
6616 fbb_: _fbb,
6617 start_: start,
6618 }
6619 }
6620 #[inline]
6621 pub fn finish(self) -> flatbuffers::WIPOffset<MaxPoolAttrs<'a>> {
6622 let o = self.fbb_.end_table(self.start_);
6623 self.fbb_
6624 .required(o, MaxPoolAttrs::VT_KERNEL_SIZE, "kernel_size");
6625 flatbuffers::WIPOffset::new(o.value())
6626 }
6627}
6628
6629impl core::fmt::Debug for MaxPoolAttrs<'_> {
6630 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6631 let mut ds = f.debug_struct("MaxPoolAttrs");
6632 ds.field("kernel_size", &self.kernel_size());
6633 ds.field("auto_pad", &self.auto_pad());
6634 ds.field("pads", &self.pads());
6635 ds.field("strides", &self.strides());
6636 ds.field("ceil_mode", &self.ceil_mode());
6637 ds.finish()
6638 }
6639}
6640pub enum ModAttrsOffset {}
6641#[derive(Copy, Clone, PartialEq)]
6642
6643pub struct ModAttrs<'a> {
6644 pub _tab: flatbuffers::Table<'a>,
6645}
6646
6647impl<'a> flatbuffers::Follow<'a> for ModAttrs<'a> {
6648 type Inner = ModAttrs<'a>;
6649 #[inline]
6650 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
6651 Self {
6652 _tab: flatbuffers::Table::new(buf, loc),
6653 }
6654 }
6655}
6656
6657impl<'a> ModAttrs<'a> {
6658 pub const VT_FMOD: flatbuffers::VOffsetT = 4;
6659
6660 #[inline]
6661 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
6662 ModAttrs { _tab: table }
6663 }
6664 #[allow(unused_mut)]
6665 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
6666 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
6667 args: &'args ModAttrsArgs,
6668 ) -> flatbuffers::WIPOffset<ModAttrs<'bldr>> {
6669 let mut builder = ModAttrsBuilder::new(_fbb);
6670 builder.add_fmod(args.fmod);
6671 builder.finish()
6672 }
6673
6674 #[inline]
6675 pub fn fmod(&self) -> bool {
6676 unsafe {
6680 self._tab
6681 .get::<bool>(ModAttrs::VT_FMOD, Some(false))
6682 .unwrap()
6683 }
6684 }
6685}
6686
6687impl flatbuffers::Verifiable for ModAttrs<'_> {
6688 #[inline]
6689 fn run_verifier(
6690 v: &mut flatbuffers::Verifier,
6691 pos: usize,
6692 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
6693 use self::flatbuffers::Verifiable;
6694 v.visit_table(pos)?
6695 .visit_field::<bool>("fmod", Self::VT_FMOD, false)?
6696 .finish();
6697 Ok(())
6698 }
6699}
6700pub struct ModAttrsArgs {
6701 pub fmod: bool,
6702}
6703impl<'a> Default for ModAttrsArgs {
6704 #[inline]
6705 fn default() -> Self {
6706 ModAttrsArgs { fmod: false }
6707 }
6708}
6709
6710pub struct ModAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6711 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6712 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6713}
6714impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ModAttrsBuilder<'a, 'b, A> {
6715 #[inline]
6716 pub fn add_fmod(&mut self, fmod: bool) {
6717 self.fbb_.push_slot::<bool>(ModAttrs::VT_FMOD, fmod, false);
6718 }
6719 #[inline]
6720 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ModAttrsBuilder<'a, 'b, A> {
6721 let start = _fbb.start_table();
6722 ModAttrsBuilder {
6723 fbb_: _fbb,
6724 start_: start,
6725 }
6726 }
6727 #[inline]
6728 pub fn finish(self) -> flatbuffers::WIPOffset<ModAttrs<'a>> {
6729 let o = self.fbb_.end_table(self.start_);
6730 flatbuffers::WIPOffset::new(o.value())
6731 }
6732}
6733
6734impl core::fmt::Debug for ModAttrs<'_> {
6735 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6736 let mut ds = f.debug_struct("ModAttrs");
6737 ds.field("fmod", &self.fmod());
6738 ds.finish()
6739 }
6740}
6741pub enum NonMaxSuppressionAttrsOffset {}
6742#[derive(Copy, Clone, PartialEq)]
6743
6744pub struct NonMaxSuppressionAttrs<'a> {
6745 pub _tab: flatbuffers::Table<'a>,
6746}
6747
6748impl<'a> flatbuffers::Follow<'a> for NonMaxSuppressionAttrs<'a> {
6749 type Inner = NonMaxSuppressionAttrs<'a>;
6750 #[inline]
6751 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
6752 Self {
6753 _tab: flatbuffers::Table::new(buf, loc),
6754 }
6755 }
6756}
6757
6758impl<'a> NonMaxSuppressionAttrs<'a> {
6759 pub const VT_BOX_ORDER: flatbuffers::VOffsetT = 4;
6760
6761 #[inline]
6762 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
6763 NonMaxSuppressionAttrs { _tab: table }
6764 }
6765 #[allow(unused_mut)]
6766 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
6767 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
6768 args: &'args NonMaxSuppressionAttrsArgs,
6769 ) -> flatbuffers::WIPOffset<NonMaxSuppressionAttrs<'bldr>> {
6770 let mut builder = NonMaxSuppressionAttrsBuilder::new(_fbb);
6771 builder.add_box_order(args.box_order);
6772 builder.finish()
6773 }
6774
6775 #[inline]
6776 pub fn box_order(&self) -> NMSBoxOrder {
6777 unsafe {
6781 self._tab
6782 .get::<NMSBoxOrder>(
6783 NonMaxSuppressionAttrs::VT_BOX_ORDER,
6784 Some(NMSBoxOrder::TopLeftBottomRight),
6785 )
6786 .unwrap()
6787 }
6788 }
6789}
6790
6791impl flatbuffers::Verifiable for NonMaxSuppressionAttrs<'_> {
6792 #[inline]
6793 fn run_verifier(
6794 v: &mut flatbuffers::Verifier,
6795 pos: usize,
6796 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
6797 use self::flatbuffers::Verifiable;
6798 v.visit_table(pos)?
6799 .visit_field::<NMSBoxOrder>("box_order", Self::VT_BOX_ORDER, false)?
6800 .finish();
6801 Ok(())
6802 }
6803}
6804pub struct NonMaxSuppressionAttrsArgs {
6805 pub box_order: NMSBoxOrder,
6806}
6807impl<'a> Default for NonMaxSuppressionAttrsArgs {
6808 #[inline]
6809 fn default() -> Self {
6810 NonMaxSuppressionAttrsArgs {
6811 box_order: NMSBoxOrder::TopLeftBottomRight,
6812 }
6813 }
6814}
6815
6816pub struct NonMaxSuppressionAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6817 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6818 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6819}
6820impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> NonMaxSuppressionAttrsBuilder<'a, 'b, A> {
6821 #[inline]
6822 pub fn add_box_order(&mut self, box_order: NMSBoxOrder) {
6823 self.fbb_.push_slot::<NMSBoxOrder>(
6824 NonMaxSuppressionAttrs::VT_BOX_ORDER,
6825 box_order,
6826 NMSBoxOrder::TopLeftBottomRight,
6827 );
6828 }
6829 #[inline]
6830 pub fn new(
6831 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6832 ) -> NonMaxSuppressionAttrsBuilder<'a, 'b, A> {
6833 let start = _fbb.start_table();
6834 NonMaxSuppressionAttrsBuilder {
6835 fbb_: _fbb,
6836 start_: start,
6837 }
6838 }
6839 #[inline]
6840 pub fn finish(self) -> flatbuffers::WIPOffset<NonMaxSuppressionAttrs<'a>> {
6841 let o = self.fbb_.end_table(self.start_);
6842 flatbuffers::WIPOffset::new(o.value())
6843 }
6844}
6845
6846impl core::fmt::Debug for NonMaxSuppressionAttrs<'_> {
6847 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6848 let mut ds = f.debug_struct("NonMaxSuppressionAttrs");
6849 ds.field("box_order", &self.box_order());
6850 ds.finish()
6851 }
6852}
6853pub enum OneHotAttrsOffset {}
6854#[derive(Copy, Clone, PartialEq)]
6855
6856pub struct OneHotAttrs<'a> {
6857 pub _tab: flatbuffers::Table<'a>,
6858}
6859
6860impl<'a> flatbuffers::Follow<'a> for OneHotAttrs<'a> {
6861 type Inner = OneHotAttrs<'a>;
6862 #[inline]
6863 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
6864 Self {
6865 _tab: flatbuffers::Table::new(buf, loc),
6866 }
6867 }
6868}
6869
6870impl<'a> OneHotAttrs<'a> {
6871 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
6872
6873 #[inline]
6874 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
6875 OneHotAttrs { _tab: table }
6876 }
6877 #[allow(unused_mut)]
6878 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
6879 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
6880 args: &'args OneHotAttrsArgs,
6881 ) -> flatbuffers::WIPOffset<OneHotAttrs<'bldr>> {
6882 let mut builder = OneHotAttrsBuilder::new(_fbb);
6883 builder.add_axis(args.axis);
6884 builder.finish()
6885 }
6886
6887 #[inline]
6888 pub fn axis(&self) -> i32 {
6889 unsafe { self._tab.get::<i32>(OneHotAttrs::VT_AXIS, Some(0)).unwrap() }
6893 }
6894}
6895
6896impl flatbuffers::Verifiable for OneHotAttrs<'_> {
6897 #[inline]
6898 fn run_verifier(
6899 v: &mut flatbuffers::Verifier,
6900 pos: usize,
6901 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
6902 use self::flatbuffers::Verifiable;
6903 v.visit_table(pos)?
6904 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
6905 .finish();
6906 Ok(())
6907 }
6908}
6909pub struct OneHotAttrsArgs {
6910 pub axis: i32,
6911}
6912impl<'a> Default for OneHotAttrsArgs {
6913 #[inline]
6914 fn default() -> Self {
6915 OneHotAttrsArgs { axis: 0 }
6916 }
6917}
6918
6919pub struct OneHotAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
6920 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6921 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
6922}
6923impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> OneHotAttrsBuilder<'a, 'b, A> {
6924 #[inline]
6925 pub fn add_axis(&mut self, axis: i32) {
6926 self.fbb_.push_slot::<i32>(OneHotAttrs::VT_AXIS, axis, 0);
6927 }
6928 #[inline]
6929 pub fn new(
6930 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
6931 ) -> OneHotAttrsBuilder<'a, 'b, A> {
6932 let start = _fbb.start_table();
6933 OneHotAttrsBuilder {
6934 fbb_: _fbb,
6935 start_: start,
6936 }
6937 }
6938 #[inline]
6939 pub fn finish(self) -> flatbuffers::WIPOffset<OneHotAttrs<'a>> {
6940 let o = self.fbb_.end_table(self.start_);
6941 flatbuffers::WIPOffset::new(o.value())
6942 }
6943}
6944
6945impl core::fmt::Debug for OneHotAttrs<'_> {
6946 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6947 let mut ds = f.debug_struct("OneHotAttrs");
6948 ds.field("axis", &self.axis());
6949 ds.finish()
6950 }
6951}
6952pub enum PadAttrsOffset {}
6953#[derive(Copy, Clone, PartialEq)]
6954
6955pub struct PadAttrs<'a> {
6956 pub _tab: flatbuffers::Table<'a>,
6957}
6958
6959impl<'a> flatbuffers::Follow<'a> for PadAttrs<'a> {
6960 type Inner = PadAttrs<'a>;
6961 #[inline]
6962 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
6963 Self {
6964 _tab: flatbuffers::Table::new(buf, loc),
6965 }
6966 }
6967}
6968
6969impl<'a> PadAttrs<'a> {
6970 pub const VT_MODE: flatbuffers::VOffsetT = 4;
6971
6972 #[inline]
6973 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
6974 PadAttrs { _tab: table }
6975 }
6976 #[allow(unused_mut)]
6977 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
6978 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
6979 args: &'args PadAttrsArgs,
6980 ) -> flatbuffers::WIPOffset<PadAttrs<'bldr>> {
6981 let mut builder = PadAttrsBuilder::new(_fbb);
6982 builder.add_mode(args.mode);
6983 builder.finish()
6984 }
6985
6986 #[inline]
6987 pub fn mode(&self) -> PadMode {
6988 unsafe {
6992 self._tab
6993 .get::<PadMode>(PadAttrs::VT_MODE, Some(PadMode::Constant))
6994 .unwrap()
6995 }
6996 }
6997}
6998
6999impl flatbuffers::Verifiable for PadAttrs<'_> {
7000 #[inline]
7001 fn run_verifier(
7002 v: &mut flatbuffers::Verifier,
7003 pos: usize,
7004 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
7005 use self::flatbuffers::Verifiable;
7006 v.visit_table(pos)?
7007 .visit_field::<PadMode>("mode", Self::VT_MODE, false)?
7008 .finish();
7009 Ok(())
7010 }
7011}
7012pub struct PadAttrsArgs {
7013 pub mode: PadMode,
7014}
7015impl<'a> Default for PadAttrsArgs {
7016 #[inline]
7017 fn default() -> Self {
7018 PadAttrsArgs {
7019 mode: PadMode::Constant,
7020 }
7021 }
7022}
7023
7024pub struct PadAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
7025 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7026 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
7027}
7028impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> PadAttrsBuilder<'a, 'b, A> {
7029 #[inline]
7030 pub fn add_mode(&mut self, mode: PadMode) {
7031 self.fbb_
7032 .push_slot::<PadMode>(PadAttrs::VT_MODE, mode, PadMode::Constant);
7033 }
7034 #[inline]
7035 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> PadAttrsBuilder<'a, 'b, A> {
7036 let start = _fbb.start_table();
7037 PadAttrsBuilder {
7038 fbb_: _fbb,
7039 start_: start,
7040 }
7041 }
7042 #[inline]
7043 pub fn finish(self) -> flatbuffers::WIPOffset<PadAttrs<'a>> {
7044 let o = self.fbb_.end_table(self.start_);
7045 flatbuffers::WIPOffset::new(o.value())
7046 }
7047}
7048
7049impl core::fmt::Debug for PadAttrs<'_> {
7050 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7051 let mut ds = f.debug_struct("PadAttrs");
7052 ds.field("mode", &self.mode());
7053 ds.finish()
7054 }
7055}
7056pub enum QuantizeLinearAttrsOffset {}
7057#[derive(Copy, Clone, PartialEq)]
7058
7059pub struct QuantizeLinearAttrs<'a> {
7060 pub _tab: flatbuffers::Table<'a>,
7061}
7062
7063impl<'a> flatbuffers::Follow<'a> for QuantizeLinearAttrs<'a> {
7064 type Inner = QuantizeLinearAttrs<'a>;
7065 #[inline]
7066 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
7067 Self {
7068 _tab: flatbuffers::Table::new(buf, loc),
7069 }
7070 }
7071}
7072
7073impl<'a> QuantizeLinearAttrs<'a> {
7074 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
7075 pub const VT_OUTPUT_DTYPE: flatbuffers::VOffsetT = 6;
7076
7077 #[inline]
7078 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
7079 QuantizeLinearAttrs { _tab: table }
7080 }
7081 #[allow(unused_mut)]
7082 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
7083 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
7084 args: &'args QuantizeLinearAttrsArgs,
7085 ) -> flatbuffers::WIPOffset<QuantizeLinearAttrs<'bldr>> {
7086 let mut builder = QuantizeLinearAttrsBuilder::new(_fbb);
7087 builder.add_axis(args.axis);
7088 if let Some(x) = args.output_dtype {
7089 builder.add_output_dtype(x);
7090 }
7091 builder.finish()
7092 }
7093
7094 #[inline]
7095 pub fn axis(&self) -> i32 {
7096 unsafe {
7100 self._tab
7101 .get::<i32>(QuantizeLinearAttrs::VT_AXIS, Some(0))
7102 .unwrap()
7103 }
7104 }
7105 #[inline]
7106 pub fn output_dtype(&self) -> Option<DataType> {
7107 unsafe {
7111 self._tab
7112 .get::<DataType>(QuantizeLinearAttrs::VT_OUTPUT_DTYPE, None)
7113 }
7114 }
7115}
7116
7117impl flatbuffers::Verifiable for QuantizeLinearAttrs<'_> {
7118 #[inline]
7119 fn run_verifier(
7120 v: &mut flatbuffers::Verifier,
7121 pos: usize,
7122 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
7123 use self::flatbuffers::Verifiable;
7124 v.visit_table(pos)?
7125 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
7126 .visit_field::<DataType>("output_dtype", Self::VT_OUTPUT_DTYPE, false)?
7127 .finish();
7128 Ok(())
7129 }
7130}
7131pub struct QuantizeLinearAttrsArgs {
7132 pub axis: i32,
7133 pub output_dtype: Option<DataType>,
7134}
7135impl<'a> Default for QuantizeLinearAttrsArgs {
7136 #[inline]
7137 fn default() -> Self {
7138 QuantizeLinearAttrsArgs {
7139 axis: 0,
7140 output_dtype: None,
7141 }
7142 }
7143}
7144
7145pub struct QuantizeLinearAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
7146 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7147 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
7148}
7149impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> QuantizeLinearAttrsBuilder<'a, 'b, A> {
7150 #[inline]
7151 pub fn add_axis(&mut self, axis: i32) {
7152 self.fbb_
7153 .push_slot::<i32>(QuantizeLinearAttrs::VT_AXIS, axis, 0);
7154 }
7155 #[inline]
7156 pub fn add_output_dtype(&mut self, output_dtype: DataType) {
7157 self.fbb_
7158 .push_slot_always::<DataType>(QuantizeLinearAttrs::VT_OUTPUT_DTYPE, output_dtype);
7159 }
7160 #[inline]
7161 pub fn new(
7162 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7163 ) -> QuantizeLinearAttrsBuilder<'a, 'b, A> {
7164 let start = _fbb.start_table();
7165 QuantizeLinearAttrsBuilder {
7166 fbb_: _fbb,
7167 start_: start,
7168 }
7169 }
7170 #[inline]
7171 pub fn finish(self) -> flatbuffers::WIPOffset<QuantizeLinearAttrs<'a>> {
7172 let o = self.fbb_.end_table(self.start_);
7173 flatbuffers::WIPOffset::new(o.value())
7174 }
7175}
7176
7177impl core::fmt::Debug for QuantizeLinearAttrs<'_> {
7178 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7179 let mut ds = f.debug_struct("QuantizeLinearAttrs");
7180 ds.field("axis", &self.axis());
7181 ds.field("output_dtype", &self.output_dtype());
7182 ds.finish()
7183 }
7184}
7185pub enum RandomNormalAttrsOffset {}
7186#[derive(Copy, Clone, PartialEq)]
7187
7188pub struct RandomNormalAttrs<'a> {
7189 pub _tab: flatbuffers::Table<'a>,
7190}
7191
7192impl<'a> flatbuffers::Follow<'a> for RandomNormalAttrs<'a> {
7193 type Inner = RandomNormalAttrs<'a>;
7194 #[inline]
7195 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
7196 Self {
7197 _tab: flatbuffers::Table::new(buf, loc),
7198 }
7199 }
7200}
7201
7202impl<'a> RandomNormalAttrs<'a> {
7203 pub const VT_MEAN: flatbuffers::VOffsetT = 4;
7204 pub const VT_SCALE: flatbuffers::VOffsetT = 6;
7205 pub const VT_SEED: flatbuffers::VOffsetT = 8;
7206 pub const VT_SHAPE: flatbuffers::VOffsetT = 10;
7207
7208 #[inline]
7209 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
7210 RandomNormalAttrs { _tab: table }
7211 }
7212 #[allow(unused_mut)]
7213 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
7214 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
7215 args: &'args RandomNormalAttrsArgs<'args>,
7216 ) -> flatbuffers::WIPOffset<RandomNormalAttrs<'bldr>> {
7217 let mut builder = RandomNormalAttrsBuilder::new(_fbb);
7218 if let Some(x) = args.shape {
7219 builder.add_shape(x);
7220 }
7221 if let Some(x) = args.seed {
7222 builder.add_seed(x);
7223 }
7224 builder.add_scale(args.scale);
7225 builder.add_mean(args.mean);
7226 builder.finish()
7227 }
7228
7229 #[inline]
7230 pub fn mean(&self) -> f32 {
7231 unsafe {
7235 self._tab
7236 .get::<f32>(RandomNormalAttrs::VT_MEAN, Some(0.0))
7237 .unwrap()
7238 }
7239 }
7240 #[inline]
7241 pub fn scale(&self) -> f32 {
7242 unsafe {
7246 self._tab
7247 .get::<f32>(RandomNormalAttrs::VT_SCALE, Some(0.0))
7248 .unwrap()
7249 }
7250 }
7251 #[inline]
7252 pub fn seed(&self) -> Option<f32> {
7253 unsafe { self._tab.get::<f32>(RandomNormalAttrs::VT_SEED, None) }
7257 }
7258 #[inline]
7259 pub fn shape(&self) -> Option<flatbuffers::Vector<'a, u32>> {
7260 unsafe {
7264 self._tab
7265 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
7266 RandomNormalAttrs::VT_SHAPE,
7267 None,
7268 )
7269 }
7270 }
7271}
7272
7273impl flatbuffers::Verifiable for RandomNormalAttrs<'_> {
7274 #[inline]
7275 fn run_verifier(
7276 v: &mut flatbuffers::Verifier,
7277 pos: usize,
7278 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
7279 use self::flatbuffers::Verifiable;
7280 v.visit_table(pos)?
7281 .visit_field::<f32>("mean", Self::VT_MEAN, false)?
7282 .visit_field::<f32>("scale", Self::VT_SCALE, false)?
7283 .visit_field::<f32>("seed", Self::VT_SEED, false)?
7284 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
7285 "shape",
7286 Self::VT_SHAPE,
7287 false,
7288 )?
7289 .finish();
7290 Ok(())
7291 }
7292}
7293pub struct RandomNormalAttrsArgs<'a> {
7294 pub mean: f32,
7295 pub scale: f32,
7296 pub seed: Option<f32>,
7297 pub shape: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
7298}
7299impl<'a> Default for RandomNormalAttrsArgs<'a> {
7300 #[inline]
7301 fn default() -> Self {
7302 RandomNormalAttrsArgs {
7303 mean: 0.0,
7304 scale: 0.0,
7305 seed: None,
7306 shape: None,
7307 }
7308 }
7309}
7310
7311pub struct RandomNormalAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
7312 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7313 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
7314}
7315impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RandomNormalAttrsBuilder<'a, 'b, A> {
7316 #[inline]
7317 pub fn add_mean(&mut self, mean: f32) {
7318 self.fbb_
7319 .push_slot::<f32>(RandomNormalAttrs::VT_MEAN, mean, 0.0);
7320 }
7321 #[inline]
7322 pub fn add_scale(&mut self, scale: f32) {
7323 self.fbb_
7324 .push_slot::<f32>(RandomNormalAttrs::VT_SCALE, scale, 0.0);
7325 }
7326 #[inline]
7327 pub fn add_seed(&mut self, seed: f32) {
7328 self.fbb_
7329 .push_slot_always::<f32>(RandomNormalAttrs::VT_SEED, seed);
7330 }
7331 #[inline]
7332 pub fn add_shape(&mut self, shape: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
7333 self.fbb_
7334 .push_slot_always::<flatbuffers::WIPOffset<_>>(RandomNormalAttrs::VT_SHAPE, shape);
7335 }
7336 #[inline]
7337 pub fn new(
7338 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7339 ) -> RandomNormalAttrsBuilder<'a, 'b, A> {
7340 let start = _fbb.start_table();
7341 RandomNormalAttrsBuilder {
7342 fbb_: _fbb,
7343 start_: start,
7344 }
7345 }
7346 #[inline]
7347 pub fn finish(self) -> flatbuffers::WIPOffset<RandomNormalAttrs<'a>> {
7348 let o = self.fbb_.end_table(self.start_);
7349 flatbuffers::WIPOffset::new(o.value())
7350 }
7351}
7352
7353impl core::fmt::Debug for RandomNormalAttrs<'_> {
7354 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7355 let mut ds = f.debug_struct("RandomNormalAttrs");
7356 ds.field("mean", &self.mean());
7357 ds.field("scale", &self.scale());
7358 ds.field("seed", &self.seed());
7359 ds.field("shape", &self.shape());
7360 ds.finish()
7361 }
7362}
7363pub enum RandomNormalLikeAttrsOffset {}
7364#[derive(Copy, Clone, PartialEq)]
7365
7366pub struct RandomNormalLikeAttrs<'a> {
7367 pub _tab: flatbuffers::Table<'a>,
7368}
7369
7370impl<'a> flatbuffers::Follow<'a> for RandomNormalLikeAttrs<'a> {
7371 type Inner = RandomNormalLikeAttrs<'a>;
7372 #[inline]
7373 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
7374 Self {
7375 _tab: flatbuffers::Table::new(buf, loc),
7376 }
7377 }
7378}
7379
7380impl<'a> RandomNormalLikeAttrs<'a> {
7381 pub const VT_MEAN: flatbuffers::VOffsetT = 4;
7382 pub const VT_SCALE: flatbuffers::VOffsetT = 6;
7383 pub const VT_SEED: flatbuffers::VOffsetT = 8;
7384
7385 #[inline]
7386 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
7387 RandomNormalLikeAttrs { _tab: table }
7388 }
7389 #[allow(unused_mut)]
7390 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
7391 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
7392 args: &'args RandomNormalLikeAttrsArgs,
7393 ) -> flatbuffers::WIPOffset<RandomNormalLikeAttrs<'bldr>> {
7394 let mut builder = RandomNormalLikeAttrsBuilder::new(_fbb);
7395 if let Some(x) = args.seed {
7396 builder.add_seed(x);
7397 }
7398 builder.add_scale(args.scale);
7399 builder.add_mean(args.mean);
7400 builder.finish()
7401 }
7402
7403 #[inline]
7404 pub fn mean(&self) -> f32 {
7405 unsafe {
7409 self._tab
7410 .get::<f32>(RandomNormalLikeAttrs::VT_MEAN, Some(0.0))
7411 .unwrap()
7412 }
7413 }
7414 #[inline]
7415 pub fn scale(&self) -> f32 {
7416 unsafe {
7420 self._tab
7421 .get::<f32>(RandomNormalLikeAttrs::VT_SCALE, Some(0.0))
7422 .unwrap()
7423 }
7424 }
7425 #[inline]
7426 pub fn seed(&self) -> Option<f32> {
7427 unsafe { self._tab.get::<f32>(RandomNormalLikeAttrs::VT_SEED, None) }
7431 }
7432}
7433
7434impl flatbuffers::Verifiable for RandomNormalLikeAttrs<'_> {
7435 #[inline]
7436 fn run_verifier(
7437 v: &mut flatbuffers::Verifier,
7438 pos: usize,
7439 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
7440 use self::flatbuffers::Verifiable;
7441 v.visit_table(pos)?
7442 .visit_field::<f32>("mean", Self::VT_MEAN, false)?
7443 .visit_field::<f32>("scale", Self::VT_SCALE, false)?
7444 .visit_field::<f32>("seed", Self::VT_SEED, false)?
7445 .finish();
7446 Ok(())
7447 }
7448}
7449pub struct RandomNormalLikeAttrsArgs {
7450 pub mean: f32,
7451 pub scale: f32,
7452 pub seed: Option<f32>,
7453}
7454impl<'a> Default for RandomNormalLikeAttrsArgs {
7455 #[inline]
7456 fn default() -> Self {
7457 RandomNormalLikeAttrsArgs {
7458 mean: 0.0,
7459 scale: 0.0,
7460 seed: None,
7461 }
7462 }
7463}
7464
7465pub struct RandomNormalLikeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
7466 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7467 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
7468}
7469impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RandomNormalLikeAttrsBuilder<'a, 'b, A> {
7470 #[inline]
7471 pub fn add_mean(&mut self, mean: f32) {
7472 self.fbb_
7473 .push_slot::<f32>(RandomNormalLikeAttrs::VT_MEAN, mean, 0.0);
7474 }
7475 #[inline]
7476 pub fn add_scale(&mut self, scale: f32) {
7477 self.fbb_
7478 .push_slot::<f32>(RandomNormalLikeAttrs::VT_SCALE, scale, 0.0);
7479 }
7480 #[inline]
7481 pub fn add_seed(&mut self, seed: f32) {
7482 self.fbb_
7483 .push_slot_always::<f32>(RandomNormalLikeAttrs::VT_SEED, seed);
7484 }
7485 #[inline]
7486 pub fn new(
7487 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7488 ) -> RandomNormalLikeAttrsBuilder<'a, 'b, A> {
7489 let start = _fbb.start_table();
7490 RandomNormalLikeAttrsBuilder {
7491 fbb_: _fbb,
7492 start_: start,
7493 }
7494 }
7495 #[inline]
7496 pub fn finish(self) -> flatbuffers::WIPOffset<RandomNormalLikeAttrs<'a>> {
7497 let o = self.fbb_.end_table(self.start_);
7498 flatbuffers::WIPOffset::new(o.value())
7499 }
7500}
7501
7502impl core::fmt::Debug for RandomNormalLikeAttrs<'_> {
7503 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7504 let mut ds = f.debug_struct("RandomNormalLikeAttrs");
7505 ds.field("mean", &self.mean());
7506 ds.field("scale", &self.scale());
7507 ds.field("seed", &self.seed());
7508 ds.finish()
7509 }
7510}
7511pub enum RandomUniformAttrsOffset {}
7512#[derive(Copy, Clone, PartialEq)]
7513
7514pub struct RandomUniformAttrs<'a> {
7515 pub _tab: flatbuffers::Table<'a>,
7516}
7517
7518impl<'a> flatbuffers::Follow<'a> for RandomUniformAttrs<'a> {
7519 type Inner = RandomUniformAttrs<'a>;
7520 #[inline]
7521 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
7522 Self {
7523 _tab: flatbuffers::Table::new(buf, loc),
7524 }
7525 }
7526}
7527
7528impl<'a> RandomUniformAttrs<'a> {
7529 pub const VT_SHAPE: flatbuffers::VOffsetT = 4;
7530 pub const VT_HIGH: flatbuffers::VOffsetT = 6;
7531 pub const VT_LOW: flatbuffers::VOffsetT = 8;
7532 pub const VT_SEED: flatbuffers::VOffsetT = 10;
7533
7534 #[inline]
7535 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
7536 RandomUniformAttrs { _tab: table }
7537 }
7538 #[allow(unused_mut)]
7539 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
7540 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
7541 args: &'args RandomUniformAttrsArgs<'args>,
7542 ) -> flatbuffers::WIPOffset<RandomUniformAttrs<'bldr>> {
7543 let mut builder = RandomUniformAttrsBuilder::new(_fbb);
7544 if let Some(x) = args.seed {
7545 builder.add_seed(x);
7546 }
7547 builder.add_low(args.low);
7548 builder.add_high(args.high);
7549 if let Some(x) = args.shape {
7550 builder.add_shape(x);
7551 }
7552 builder.finish()
7553 }
7554
7555 #[inline]
7556 pub fn shape(&self) -> Option<flatbuffers::Vector<'a, u32>> {
7557 unsafe {
7561 self._tab
7562 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
7563 RandomUniformAttrs::VT_SHAPE,
7564 None,
7565 )
7566 }
7567 }
7568 #[inline]
7569 pub fn high(&self) -> f32 {
7570 unsafe {
7574 self._tab
7575 .get::<f32>(RandomUniformAttrs::VT_HIGH, Some(0.0))
7576 .unwrap()
7577 }
7578 }
7579 #[inline]
7580 pub fn low(&self) -> f32 {
7581 unsafe {
7585 self._tab
7586 .get::<f32>(RandomUniformAttrs::VT_LOW, Some(0.0))
7587 .unwrap()
7588 }
7589 }
7590 #[inline]
7591 pub fn seed(&self) -> Option<f32> {
7592 unsafe { self._tab.get::<f32>(RandomUniformAttrs::VT_SEED, None) }
7596 }
7597}
7598
7599impl flatbuffers::Verifiable for RandomUniformAttrs<'_> {
7600 #[inline]
7601 fn run_verifier(
7602 v: &mut flatbuffers::Verifier,
7603 pos: usize,
7604 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
7605 use self::flatbuffers::Verifiable;
7606 v.visit_table(pos)?
7607 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
7608 "shape",
7609 Self::VT_SHAPE,
7610 false,
7611 )?
7612 .visit_field::<f32>("high", Self::VT_HIGH, false)?
7613 .visit_field::<f32>("low", Self::VT_LOW, false)?
7614 .visit_field::<f32>("seed", Self::VT_SEED, false)?
7615 .finish();
7616 Ok(())
7617 }
7618}
7619pub struct RandomUniformAttrsArgs<'a> {
7620 pub shape: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
7621 pub high: f32,
7622 pub low: f32,
7623 pub seed: Option<f32>,
7624}
7625impl<'a> Default for RandomUniformAttrsArgs<'a> {
7626 #[inline]
7627 fn default() -> Self {
7628 RandomUniformAttrsArgs {
7629 shape: None,
7630 high: 0.0,
7631 low: 0.0,
7632 seed: None,
7633 }
7634 }
7635}
7636
7637pub struct RandomUniformAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
7638 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7639 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
7640}
7641impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RandomUniformAttrsBuilder<'a, 'b, A> {
7642 #[inline]
7643 pub fn add_shape(&mut self, shape: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
7644 self.fbb_
7645 .push_slot_always::<flatbuffers::WIPOffset<_>>(RandomUniformAttrs::VT_SHAPE, shape);
7646 }
7647 #[inline]
7648 pub fn add_high(&mut self, high: f32) {
7649 self.fbb_
7650 .push_slot::<f32>(RandomUniformAttrs::VT_HIGH, high, 0.0);
7651 }
7652 #[inline]
7653 pub fn add_low(&mut self, low: f32) {
7654 self.fbb_
7655 .push_slot::<f32>(RandomUniformAttrs::VT_LOW, low, 0.0);
7656 }
7657 #[inline]
7658 pub fn add_seed(&mut self, seed: f32) {
7659 self.fbb_
7660 .push_slot_always::<f32>(RandomUniformAttrs::VT_SEED, seed);
7661 }
7662 #[inline]
7663 pub fn new(
7664 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7665 ) -> RandomUniformAttrsBuilder<'a, 'b, A> {
7666 let start = _fbb.start_table();
7667 RandomUniformAttrsBuilder {
7668 fbb_: _fbb,
7669 start_: start,
7670 }
7671 }
7672 #[inline]
7673 pub fn finish(self) -> flatbuffers::WIPOffset<RandomUniformAttrs<'a>> {
7674 let o = self.fbb_.end_table(self.start_);
7675 flatbuffers::WIPOffset::new(o.value())
7676 }
7677}
7678
7679impl core::fmt::Debug for RandomUniformAttrs<'_> {
7680 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7681 let mut ds = f.debug_struct("RandomUniformAttrs");
7682 ds.field("shape", &self.shape());
7683 ds.field("high", &self.high());
7684 ds.field("low", &self.low());
7685 ds.field("seed", &self.seed());
7686 ds.finish()
7687 }
7688}
7689pub enum RandomUniformLikeAttrsOffset {}
7690#[derive(Copy, Clone, PartialEq)]
7691
7692pub struct RandomUniformLikeAttrs<'a> {
7693 pub _tab: flatbuffers::Table<'a>,
7694}
7695
7696impl<'a> flatbuffers::Follow<'a> for RandomUniformLikeAttrs<'a> {
7697 type Inner = RandomUniformLikeAttrs<'a>;
7698 #[inline]
7699 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
7700 Self {
7701 _tab: flatbuffers::Table::new(buf, loc),
7702 }
7703 }
7704}
7705
7706impl<'a> RandomUniformLikeAttrs<'a> {
7707 pub const VT_HIGH: flatbuffers::VOffsetT = 4;
7708 pub const VT_LOW: flatbuffers::VOffsetT = 6;
7709 pub const VT_SEED: flatbuffers::VOffsetT = 8;
7710
7711 #[inline]
7712 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
7713 RandomUniformLikeAttrs { _tab: table }
7714 }
7715 #[allow(unused_mut)]
7716 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
7717 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
7718 args: &'args RandomUniformLikeAttrsArgs,
7719 ) -> flatbuffers::WIPOffset<RandomUniformLikeAttrs<'bldr>> {
7720 let mut builder = RandomUniformLikeAttrsBuilder::new(_fbb);
7721 if let Some(x) = args.seed {
7722 builder.add_seed(x);
7723 }
7724 builder.add_low(args.low);
7725 builder.add_high(args.high);
7726 builder.finish()
7727 }
7728
7729 #[inline]
7730 pub fn high(&self) -> f32 {
7731 unsafe {
7735 self._tab
7736 .get::<f32>(RandomUniformLikeAttrs::VT_HIGH, Some(0.0))
7737 .unwrap()
7738 }
7739 }
7740 #[inline]
7741 pub fn low(&self) -> f32 {
7742 unsafe {
7746 self._tab
7747 .get::<f32>(RandomUniformLikeAttrs::VT_LOW, Some(0.0))
7748 .unwrap()
7749 }
7750 }
7751 #[inline]
7752 pub fn seed(&self) -> Option<f32> {
7753 unsafe { self._tab.get::<f32>(RandomUniformLikeAttrs::VT_SEED, None) }
7757 }
7758}
7759
7760impl flatbuffers::Verifiable for RandomUniformLikeAttrs<'_> {
7761 #[inline]
7762 fn run_verifier(
7763 v: &mut flatbuffers::Verifier,
7764 pos: usize,
7765 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
7766 use self::flatbuffers::Verifiable;
7767 v.visit_table(pos)?
7768 .visit_field::<f32>("high", Self::VT_HIGH, false)?
7769 .visit_field::<f32>("low", Self::VT_LOW, false)?
7770 .visit_field::<f32>("seed", Self::VT_SEED, false)?
7771 .finish();
7772 Ok(())
7773 }
7774}
7775pub struct RandomUniformLikeAttrsArgs {
7776 pub high: f32,
7777 pub low: f32,
7778 pub seed: Option<f32>,
7779}
7780impl<'a> Default for RandomUniformLikeAttrsArgs {
7781 #[inline]
7782 fn default() -> Self {
7783 RandomUniformLikeAttrsArgs {
7784 high: 0.0,
7785 low: 0.0,
7786 seed: None,
7787 }
7788 }
7789}
7790
7791pub struct RandomUniformLikeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
7792 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7793 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
7794}
7795impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> RandomUniformLikeAttrsBuilder<'a, 'b, A> {
7796 #[inline]
7797 pub fn add_high(&mut self, high: f32) {
7798 self.fbb_
7799 .push_slot::<f32>(RandomUniformLikeAttrs::VT_HIGH, high, 0.0);
7800 }
7801 #[inline]
7802 pub fn add_low(&mut self, low: f32) {
7803 self.fbb_
7804 .push_slot::<f32>(RandomUniformLikeAttrs::VT_LOW, low, 0.0);
7805 }
7806 #[inline]
7807 pub fn add_seed(&mut self, seed: f32) {
7808 self.fbb_
7809 .push_slot_always::<f32>(RandomUniformLikeAttrs::VT_SEED, seed);
7810 }
7811 #[inline]
7812 pub fn new(
7813 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7814 ) -> RandomUniformLikeAttrsBuilder<'a, 'b, A> {
7815 let start = _fbb.start_table();
7816 RandomUniformLikeAttrsBuilder {
7817 fbb_: _fbb,
7818 start_: start,
7819 }
7820 }
7821 #[inline]
7822 pub fn finish(self) -> flatbuffers::WIPOffset<RandomUniformLikeAttrs<'a>> {
7823 let o = self.fbb_.end_table(self.start_);
7824 flatbuffers::WIPOffset::new(o.value())
7825 }
7826}
7827
7828impl core::fmt::Debug for RandomUniformLikeAttrs<'_> {
7829 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7830 let mut ds = f.debug_struct("RandomUniformLikeAttrs");
7831 ds.field("high", &self.high());
7832 ds.field("low", &self.low());
7833 ds.field("seed", &self.seed());
7834 ds.finish()
7835 }
7836}
7837pub enum ReduceMeanAttrsOffset {}
7838#[derive(Copy, Clone, PartialEq)]
7839
7840pub struct ReduceMeanAttrs<'a> {
7841 pub _tab: flatbuffers::Table<'a>,
7842}
7843
7844impl<'a> flatbuffers::Follow<'a> for ReduceMeanAttrs<'a> {
7845 type Inner = ReduceMeanAttrs<'a>;
7846 #[inline]
7847 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
7848 Self {
7849 _tab: flatbuffers::Table::new(buf, loc),
7850 }
7851 }
7852}
7853
7854impl<'a> ReduceMeanAttrs<'a> {
7855 pub const VT_AXES: flatbuffers::VOffsetT = 4;
7856 pub const VT_KEEP_DIMS: flatbuffers::VOffsetT = 6;
7857
7858 #[inline]
7859 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
7860 ReduceMeanAttrs { _tab: table }
7861 }
7862 #[allow(unused_mut)]
7863 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
7864 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
7865 args: &'args ReduceMeanAttrsArgs<'args>,
7866 ) -> flatbuffers::WIPOffset<ReduceMeanAttrs<'bldr>> {
7867 let mut builder = ReduceMeanAttrsBuilder::new(_fbb);
7868 if let Some(x) = args.axes {
7869 builder.add_axes(x);
7870 }
7871 builder.add_keep_dims(args.keep_dims);
7872 builder.finish()
7873 }
7874
7875 #[inline]
7876 pub fn axes(&self) -> Option<flatbuffers::Vector<'a, i32>> {
7877 unsafe {
7881 self._tab
7882 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(
7883 ReduceMeanAttrs::VT_AXES,
7884 None,
7885 )
7886 }
7887 }
7888 #[inline]
7889 pub fn keep_dims(&self) -> bool {
7890 unsafe {
7894 self._tab
7895 .get::<bool>(ReduceMeanAttrs::VT_KEEP_DIMS, Some(false))
7896 .unwrap()
7897 }
7898 }
7899}
7900
7901impl flatbuffers::Verifiable for ReduceMeanAttrs<'_> {
7902 #[inline]
7903 fn run_verifier(
7904 v: &mut flatbuffers::Verifier,
7905 pos: usize,
7906 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
7907 use self::flatbuffers::Verifiable;
7908 v.visit_table(pos)?
7909 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>(
7910 "axes",
7911 Self::VT_AXES,
7912 false,
7913 )?
7914 .visit_field::<bool>("keep_dims", Self::VT_KEEP_DIMS, false)?
7915 .finish();
7916 Ok(())
7917 }
7918}
7919pub struct ReduceMeanAttrsArgs<'a> {
7920 pub axes: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
7921 pub keep_dims: bool,
7922}
7923impl<'a> Default for ReduceMeanAttrsArgs<'a> {
7924 #[inline]
7925 fn default() -> Self {
7926 ReduceMeanAttrsArgs {
7927 axes: None,
7928 keep_dims: false,
7929 }
7930 }
7931}
7932
7933pub struct ReduceMeanAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
7934 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7935 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
7936}
7937impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ReduceMeanAttrsBuilder<'a, 'b, A> {
7938 #[inline]
7939 pub fn add_axes(&mut self, axes: flatbuffers::WIPOffset<flatbuffers::Vector<'b, i32>>) {
7940 self.fbb_
7941 .push_slot_always::<flatbuffers::WIPOffset<_>>(ReduceMeanAttrs::VT_AXES, axes);
7942 }
7943 #[inline]
7944 pub fn add_keep_dims(&mut self, keep_dims: bool) {
7945 self.fbb_
7946 .push_slot::<bool>(ReduceMeanAttrs::VT_KEEP_DIMS, keep_dims, false);
7947 }
7948 #[inline]
7949 pub fn new(
7950 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
7951 ) -> ReduceMeanAttrsBuilder<'a, 'b, A> {
7952 let start = _fbb.start_table();
7953 ReduceMeanAttrsBuilder {
7954 fbb_: _fbb,
7955 start_: start,
7956 }
7957 }
7958 #[inline]
7959 pub fn finish(self) -> flatbuffers::WIPOffset<ReduceMeanAttrs<'a>> {
7960 let o = self.fbb_.end_table(self.start_);
7961 flatbuffers::WIPOffset::new(o.value())
7962 }
7963}
7964
7965impl core::fmt::Debug for ReduceMeanAttrs<'_> {
7966 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
7967 let mut ds = f.debug_struct("ReduceMeanAttrs");
7968 ds.field("axes", &self.axes());
7969 ds.field("keep_dims", &self.keep_dims());
7970 ds.finish()
7971 }
7972}
7973pub enum ReshapeAttrsOffset {}
7974#[derive(Copy, Clone, PartialEq)]
7975
7976pub struct ReshapeAttrs<'a> {
7977 pub _tab: flatbuffers::Table<'a>,
7978}
7979
7980impl<'a> flatbuffers::Follow<'a> for ReshapeAttrs<'a> {
7981 type Inner = ReshapeAttrs<'a>;
7982 #[inline]
7983 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
7984 Self {
7985 _tab: flatbuffers::Table::new(buf, loc),
7986 }
7987 }
7988}
7989
7990impl<'a> ReshapeAttrs<'a> {
7991 pub const VT_ALLOW_ZERO: flatbuffers::VOffsetT = 4;
7992
7993 #[inline]
7994 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
7995 ReshapeAttrs { _tab: table }
7996 }
7997 #[allow(unused_mut)]
7998 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
7999 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8000 args: &'args ReshapeAttrsArgs,
8001 ) -> flatbuffers::WIPOffset<ReshapeAttrs<'bldr>> {
8002 let mut builder = ReshapeAttrsBuilder::new(_fbb);
8003 builder.add_allow_zero(args.allow_zero);
8004 builder.finish()
8005 }
8006
8007 #[inline]
8008 pub fn allow_zero(&self) -> bool {
8009 unsafe {
8013 self._tab
8014 .get::<bool>(ReshapeAttrs::VT_ALLOW_ZERO, Some(false))
8015 .unwrap()
8016 }
8017 }
8018}
8019
8020impl flatbuffers::Verifiable for ReshapeAttrs<'_> {
8021 #[inline]
8022 fn run_verifier(
8023 v: &mut flatbuffers::Verifier,
8024 pos: usize,
8025 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8026 use self::flatbuffers::Verifiable;
8027 v.visit_table(pos)?
8028 .visit_field::<bool>("allow_zero", Self::VT_ALLOW_ZERO, false)?
8029 .finish();
8030 Ok(())
8031 }
8032}
8033pub struct ReshapeAttrsArgs {
8034 pub allow_zero: bool,
8035}
8036impl<'a> Default for ReshapeAttrsArgs {
8037 #[inline]
8038 fn default() -> Self {
8039 ReshapeAttrsArgs { allow_zero: false }
8040 }
8041}
8042
8043pub struct ReshapeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
8044 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8045 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
8046}
8047impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ReshapeAttrsBuilder<'a, 'b, A> {
8048 #[inline]
8049 pub fn add_allow_zero(&mut self, allow_zero: bool) {
8050 self.fbb_
8051 .push_slot::<bool>(ReshapeAttrs::VT_ALLOW_ZERO, allow_zero, false);
8052 }
8053 #[inline]
8054 pub fn new(
8055 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8056 ) -> ReshapeAttrsBuilder<'a, 'b, A> {
8057 let start = _fbb.start_table();
8058 ReshapeAttrsBuilder {
8059 fbb_: _fbb,
8060 start_: start,
8061 }
8062 }
8063 #[inline]
8064 pub fn finish(self) -> flatbuffers::WIPOffset<ReshapeAttrs<'a>> {
8065 let o = self.fbb_.end_table(self.start_);
8066 flatbuffers::WIPOffset::new(o.value())
8067 }
8068}
8069
8070impl core::fmt::Debug for ReshapeAttrs<'_> {
8071 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8072 let mut ds = f.debug_struct("ReshapeAttrs");
8073 ds.field("allow_zero", &self.allow_zero());
8074 ds.finish()
8075 }
8076}
8077pub enum ResizeAttrsOffset {}
8078#[derive(Copy, Clone, PartialEq)]
8079
8080pub struct ResizeAttrs<'a> {
8081 pub _tab: flatbuffers::Table<'a>,
8082}
8083
8084impl<'a> flatbuffers::Follow<'a> for ResizeAttrs<'a> {
8085 type Inner = ResizeAttrs<'a>;
8086 #[inline]
8087 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
8088 Self {
8089 _tab: flatbuffers::Table::new(buf, loc),
8090 }
8091 }
8092}
8093
8094impl<'a> ResizeAttrs<'a> {
8095 pub const VT_MODE: flatbuffers::VOffsetT = 4;
8096 pub const VT_COORD_MODE: flatbuffers::VOffsetT = 6;
8097 pub const VT_NEAREST_MODE: flatbuffers::VOffsetT = 8;
8098
8099 #[inline]
8100 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
8101 ResizeAttrs { _tab: table }
8102 }
8103 #[allow(unused_mut)]
8104 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
8105 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8106 args: &'args ResizeAttrsArgs,
8107 ) -> flatbuffers::WIPOffset<ResizeAttrs<'bldr>> {
8108 let mut builder = ResizeAttrsBuilder::new(_fbb);
8109 builder.add_nearest_mode(args.nearest_mode);
8110 builder.add_coord_mode(args.coord_mode);
8111 builder.add_mode(args.mode);
8112 builder.finish()
8113 }
8114
8115 #[inline]
8116 pub fn mode(&self) -> ResizeMode {
8117 unsafe {
8121 self._tab
8122 .get::<ResizeMode>(ResizeAttrs::VT_MODE, Some(ResizeMode::Nearest))
8123 .unwrap()
8124 }
8125 }
8126 #[inline]
8127 pub fn coord_mode(&self) -> CoordTransformMode {
8128 unsafe {
8132 self._tab
8133 .get::<CoordTransformMode>(
8134 ResizeAttrs::VT_COORD_MODE,
8135 Some(CoordTransformMode::HalfPixel),
8136 )
8137 .unwrap()
8138 }
8139 }
8140 #[inline]
8141 pub fn nearest_mode(&self) -> NearestMode {
8142 unsafe {
8146 self._tab
8147 .get::<NearestMode>(ResizeAttrs::VT_NEAREST_MODE, Some(NearestMode::Floor))
8148 .unwrap()
8149 }
8150 }
8151}
8152
8153impl flatbuffers::Verifiable for ResizeAttrs<'_> {
8154 #[inline]
8155 fn run_verifier(
8156 v: &mut flatbuffers::Verifier,
8157 pos: usize,
8158 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8159 use self::flatbuffers::Verifiable;
8160 v.visit_table(pos)?
8161 .visit_field::<ResizeMode>("mode", Self::VT_MODE, false)?
8162 .visit_field::<CoordTransformMode>("coord_mode", Self::VT_COORD_MODE, false)?
8163 .visit_field::<NearestMode>("nearest_mode", Self::VT_NEAREST_MODE, false)?
8164 .finish();
8165 Ok(())
8166 }
8167}
8168pub struct ResizeAttrsArgs {
8169 pub mode: ResizeMode,
8170 pub coord_mode: CoordTransformMode,
8171 pub nearest_mode: NearestMode,
8172}
8173impl<'a> Default for ResizeAttrsArgs {
8174 #[inline]
8175 fn default() -> Self {
8176 ResizeAttrsArgs {
8177 mode: ResizeMode::Nearest,
8178 coord_mode: CoordTransformMode::HalfPixel,
8179 nearest_mode: NearestMode::Floor,
8180 }
8181 }
8182}
8183
8184pub struct ResizeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
8185 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8186 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
8187}
8188impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ResizeAttrsBuilder<'a, 'b, A> {
8189 #[inline]
8190 pub fn add_mode(&mut self, mode: ResizeMode) {
8191 self.fbb_
8192 .push_slot::<ResizeMode>(ResizeAttrs::VT_MODE, mode, ResizeMode::Nearest);
8193 }
8194 #[inline]
8195 pub fn add_coord_mode(&mut self, coord_mode: CoordTransformMode) {
8196 self.fbb_.push_slot::<CoordTransformMode>(
8197 ResizeAttrs::VT_COORD_MODE,
8198 coord_mode,
8199 CoordTransformMode::HalfPixel,
8200 );
8201 }
8202 #[inline]
8203 pub fn add_nearest_mode(&mut self, nearest_mode: NearestMode) {
8204 self.fbb_.push_slot::<NearestMode>(
8205 ResizeAttrs::VT_NEAREST_MODE,
8206 nearest_mode,
8207 NearestMode::Floor,
8208 );
8209 }
8210 #[inline]
8211 pub fn new(
8212 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8213 ) -> ResizeAttrsBuilder<'a, 'b, A> {
8214 let start = _fbb.start_table();
8215 ResizeAttrsBuilder {
8216 fbb_: _fbb,
8217 start_: start,
8218 }
8219 }
8220 #[inline]
8221 pub fn finish(self) -> flatbuffers::WIPOffset<ResizeAttrs<'a>> {
8222 let o = self.fbb_.end_table(self.start_);
8223 flatbuffers::WIPOffset::new(o.value())
8224 }
8225}
8226
8227impl core::fmt::Debug for ResizeAttrs<'_> {
8228 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8229 let mut ds = f.debug_struct("ResizeAttrs");
8230 ds.field("mode", &self.mode());
8231 ds.field("coord_mode", &self.coord_mode());
8232 ds.field("nearest_mode", &self.nearest_mode());
8233 ds.finish()
8234 }
8235}
8236pub enum ScatterElementsAttrsOffset {}
8237#[derive(Copy, Clone, PartialEq)]
8238
8239pub struct ScatterElementsAttrs<'a> {
8240 pub _tab: flatbuffers::Table<'a>,
8241}
8242
8243impl<'a> flatbuffers::Follow<'a> for ScatterElementsAttrs<'a> {
8244 type Inner = ScatterElementsAttrs<'a>;
8245 #[inline]
8246 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
8247 Self {
8248 _tab: flatbuffers::Table::new(buf, loc),
8249 }
8250 }
8251}
8252
8253impl<'a> ScatterElementsAttrs<'a> {
8254 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
8255 pub const VT_REDUCTION: flatbuffers::VOffsetT = 6;
8256
8257 #[inline]
8258 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
8259 ScatterElementsAttrs { _tab: table }
8260 }
8261 #[allow(unused_mut)]
8262 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
8263 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8264 args: &'args ScatterElementsAttrsArgs,
8265 ) -> flatbuffers::WIPOffset<ScatterElementsAttrs<'bldr>> {
8266 let mut builder = ScatterElementsAttrsBuilder::new(_fbb);
8267 builder.add_axis(args.axis);
8268 builder.add_reduction(args.reduction);
8269 builder.finish()
8270 }
8271
8272 #[inline]
8273 pub fn axis(&self) -> i32 {
8274 unsafe {
8278 self._tab
8279 .get::<i32>(ScatterElementsAttrs::VT_AXIS, Some(0))
8280 .unwrap()
8281 }
8282 }
8283 #[inline]
8284 pub fn reduction(&self) -> ScatterReduction {
8285 unsafe {
8289 self._tab
8290 .get::<ScatterReduction>(
8291 ScatterElementsAttrs::VT_REDUCTION,
8292 Some(ScatterReduction::None),
8293 )
8294 .unwrap()
8295 }
8296 }
8297}
8298
8299impl flatbuffers::Verifiable for ScatterElementsAttrs<'_> {
8300 #[inline]
8301 fn run_verifier(
8302 v: &mut flatbuffers::Verifier,
8303 pos: usize,
8304 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8305 use self::flatbuffers::Verifiable;
8306 v.visit_table(pos)?
8307 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
8308 .visit_field::<ScatterReduction>("reduction", Self::VT_REDUCTION, false)?
8309 .finish();
8310 Ok(())
8311 }
8312}
8313pub struct ScatterElementsAttrsArgs {
8314 pub axis: i32,
8315 pub reduction: ScatterReduction,
8316}
8317impl<'a> Default for ScatterElementsAttrsArgs {
8318 #[inline]
8319 fn default() -> Self {
8320 ScatterElementsAttrsArgs {
8321 axis: 0,
8322 reduction: ScatterReduction::None,
8323 }
8324 }
8325}
8326
8327pub struct ScatterElementsAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
8328 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8329 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
8330}
8331impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ScatterElementsAttrsBuilder<'a, 'b, A> {
8332 #[inline]
8333 pub fn add_axis(&mut self, axis: i32) {
8334 self.fbb_
8335 .push_slot::<i32>(ScatterElementsAttrs::VT_AXIS, axis, 0);
8336 }
8337 #[inline]
8338 pub fn add_reduction(&mut self, reduction: ScatterReduction) {
8339 self.fbb_.push_slot::<ScatterReduction>(
8340 ScatterElementsAttrs::VT_REDUCTION,
8341 reduction,
8342 ScatterReduction::None,
8343 );
8344 }
8345 #[inline]
8346 pub fn new(
8347 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8348 ) -> ScatterElementsAttrsBuilder<'a, 'b, A> {
8349 let start = _fbb.start_table();
8350 ScatterElementsAttrsBuilder {
8351 fbb_: _fbb,
8352 start_: start,
8353 }
8354 }
8355 #[inline]
8356 pub fn finish(self) -> flatbuffers::WIPOffset<ScatterElementsAttrs<'a>> {
8357 let o = self.fbb_.end_table(self.start_);
8358 flatbuffers::WIPOffset::new(o.value())
8359 }
8360}
8361
8362impl core::fmt::Debug for ScatterElementsAttrs<'_> {
8363 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8364 let mut ds = f.debug_struct("ScatterElementsAttrs");
8365 ds.field("axis", &self.axis());
8366 ds.field("reduction", &self.reduction());
8367 ds.finish()
8368 }
8369}
8370pub enum ScatterNDAttrsOffset {}
8371#[derive(Copy, Clone, PartialEq)]
8372
8373pub struct ScatterNDAttrs<'a> {
8374 pub _tab: flatbuffers::Table<'a>,
8375}
8376
8377impl<'a> flatbuffers::Follow<'a> for ScatterNDAttrs<'a> {
8378 type Inner = ScatterNDAttrs<'a>;
8379 #[inline]
8380 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
8381 Self {
8382 _tab: flatbuffers::Table::new(buf, loc),
8383 }
8384 }
8385}
8386
8387impl<'a> ScatterNDAttrs<'a> {
8388 pub const VT_REDUCTION: flatbuffers::VOffsetT = 4;
8389
8390 #[inline]
8391 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
8392 ScatterNDAttrs { _tab: table }
8393 }
8394 #[allow(unused_mut)]
8395 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
8396 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8397 args: &'args ScatterNDAttrsArgs,
8398 ) -> flatbuffers::WIPOffset<ScatterNDAttrs<'bldr>> {
8399 let mut builder = ScatterNDAttrsBuilder::new(_fbb);
8400 builder.add_reduction(args.reduction);
8401 builder.finish()
8402 }
8403
8404 #[inline]
8405 pub fn reduction(&self) -> ScatterReduction {
8406 unsafe {
8410 self._tab
8411 .get::<ScatterReduction>(ScatterNDAttrs::VT_REDUCTION, Some(ScatterReduction::None))
8412 .unwrap()
8413 }
8414 }
8415}
8416
8417impl flatbuffers::Verifiable for ScatterNDAttrs<'_> {
8418 #[inline]
8419 fn run_verifier(
8420 v: &mut flatbuffers::Verifier,
8421 pos: usize,
8422 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8423 use self::flatbuffers::Verifiable;
8424 v.visit_table(pos)?
8425 .visit_field::<ScatterReduction>("reduction", Self::VT_REDUCTION, false)?
8426 .finish();
8427 Ok(())
8428 }
8429}
8430pub struct ScatterNDAttrsArgs {
8431 pub reduction: ScatterReduction,
8432}
8433impl<'a> Default for ScatterNDAttrsArgs {
8434 #[inline]
8435 fn default() -> Self {
8436 ScatterNDAttrsArgs {
8437 reduction: ScatterReduction::None,
8438 }
8439 }
8440}
8441
8442pub struct ScatterNDAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
8443 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8444 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
8445}
8446impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ScatterNDAttrsBuilder<'a, 'b, A> {
8447 #[inline]
8448 pub fn add_reduction(&mut self, reduction: ScatterReduction) {
8449 self.fbb_.push_slot::<ScatterReduction>(
8450 ScatterNDAttrs::VT_REDUCTION,
8451 reduction,
8452 ScatterReduction::None,
8453 );
8454 }
8455 #[inline]
8456 pub fn new(
8457 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8458 ) -> ScatterNDAttrsBuilder<'a, 'b, A> {
8459 let start = _fbb.start_table();
8460 ScatterNDAttrsBuilder {
8461 fbb_: _fbb,
8462 start_: start,
8463 }
8464 }
8465 #[inline]
8466 pub fn finish(self) -> flatbuffers::WIPOffset<ScatterNDAttrs<'a>> {
8467 let o = self.fbb_.end_table(self.start_);
8468 flatbuffers::WIPOffset::new(o.value())
8469 }
8470}
8471
8472impl core::fmt::Debug for ScatterNDAttrs<'_> {
8473 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8474 let mut ds = f.debug_struct("ScatterNDAttrs");
8475 ds.field("reduction", &self.reduction());
8476 ds.finish()
8477 }
8478}
8479pub enum SequenceEmptyAttrsOffset {}
8480#[derive(Copy, Clone, PartialEq)]
8481
8482pub struct SequenceEmptyAttrs<'a> {
8483 pub _tab: flatbuffers::Table<'a>,
8484}
8485
8486impl<'a> flatbuffers::Follow<'a> for SequenceEmptyAttrs<'a> {
8487 type Inner = SequenceEmptyAttrs<'a>;
8488 #[inline]
8489 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
8490 Self {
8491 _tab: flatbuffers::Table::new(buf, loc),
8492 }
8493 }
8494}
8495
8496impl<'a> SequenceEmptyAttrs<'a> {
8497 pub const VT_DTYPE: flatbuffers::VOffsetT = 4;
8498
8499 #[inline]
8500 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
8501 SequenceEmptyAttrs { _tab: table }
8502 }
8503 #[allow(unused_mut)]
8504 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
8505 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8506 args: &'args SequenceEmptyAttrsArgs,
8507 ) -> flatbuffers::WIPOffset<SequenceEmptyAttrs<'bldr>> {
8508 let mut builder = SequenceEmptyAttrsBuilder::new(_fbb);
8509 if let Some(x) = args.dtype {
8510 builder.add_dtype(x);
8511 }
8512 builder.finish()
8513 }
8514
8515 #[inline]
8516 pub fn dtype(&self) -> Option<DataType> {
8517 unsafe {
8521 self._tab
8522 .get::<DataType>(SequenceEmptyAttrs::VT_DTYPE, None)
8523 }
8524 }
8525}
8526
8527impl flatbuffers::Verifiable for SequenceEmptyAttrs<'_> {
8528 #[inline]
8529 fn run_verifier(
8530 v: &mut flatbuffers::Verifier,
8531 pos: usize,
8532 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8533 use self::flatbuffers::Verifiable;
8534 v.visit_table(pos)?
8535 .visit_field::<DataType>("dtype", Self::VT_DTYPE, false)?
8536 .finish();
8537 Ok(())
8538 }
8539}
8540pub struct SequenceEmptyAttrsArgs {
8541 pub dtype: Option<DataType>,
8542}
8543impl<'a> Default for SequenceEmptyAttrsArgs {
8544 #[inline]
8545 fn default() -> Self {
8546 SequenceEmptyAttrsArgs { dtype: None }
8547 }
8548}
8549
8550pub struct SequenceEmptyAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
8551 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8552 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
8553}
8554impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SequenceEmptyAttrsBuilder<'a, 'b, A> {
8555 #[inline]
8556 pub fn add_dtype(&mut self, dtype: DataType) {
8557 self.fbb_
8558 .push_slot_always::<DataType>(SequenceEmptyAttrs::VT_DTYPE, dtype);
8559 }
8560 #[inline]
8561 pub fn new(
8562 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8563 ) -> SequenceEmptyAttrsBuilder<'a, 'b, A> {
8564 let start = _fbb.start_table();
8565 SequenceEmptyAttrsBuilder {
8566 fbb_: _fbb,
8567 start_: start,
8568 }
8569 }
8570 #[inline]
8571 pub fn finish(self) -> flatbuffers::WIPOffset<SequenceEmptyAttrs<'a>> {
8572 let o = self.fbb_.end_table(self.start_);
8573 flatbuffers::WIPOffset::new(o.value())
8574 }
8575}
8576
8577impl core::fmt::Debug for SequenceEmptyAttrs<'_> {
8578 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8579 let mut ds = f.debug_struct("SequenceEmptyAttrs");
8580 ds.field("dtype", &self.dtype());
8581 ds.finish()
8582 }
8583}
8584pub enum ShapeAttrsOffset {}
8585#[derive(Copy, Clone, PartialEq)]
8586
8587pub struct ShapeAttrs<'a> {
8588 pub _tab: flatbuffers::Table<'a>,
8589}
8590
8591impl<'a> flatbuffers::Follow<'a> for ShapeAttrs<'a> {
8592 type Inner = ShapeAttrs<'a>;
8593 #[inline]
8594 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
8595 Self {
8596 _tab: flatbuffers::Table::new(buf, loc),
8597 }
8598 }
8599}
8600
8601impl<'a> ShapeAttrs<'a> {
8602 pub const VT_START: flatbuffers::VOffsetT = 4;
8603 pub const VT_END: flatbuffers::VOffsetT = 6;
8604
8605 #[inline]
8606 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
8607 ShapeAttrs { _tab: table }
8608 }
8609 #[allow(unused_mut)]
8610 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
8611 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8612 args: &'args ShapeAttrsArgs,
8613 ) -> flatbuffers::WIPOffset<ShapeAttrs<'bldr>> {
8614 let mut builder = ShapeAttrsBuilder::new(_fbb);
8615 if let Some(x) = args.end {
8616 builder.add_end(x);
8617 }
8618 if let Some(x) = args.start {
8619 builder.add_start(x);
8620 }
8621 builder.finish()
8622 }
8623
8624 #[inline]
8625 pub fn start(&self) -> Option<i32> {
8626 unsafe { self._tab.get::<i32>(ShapeAttrs::VT_START, None) }
8630 }
8631 #[inline]
8632 pub fn end(&self) -> Option<i32> {
8633 unsafe { self._tab.get::<i32>(ShapeAttrs::VT_END, None) }
8637 }
8638}
8639
8640impl flatbuffers::Verifiable for ShapeAttrs<'_> {
8641 #[inline]
8642 fn run_verifier(
8643 v: &mut flatbuffers::Verifier,
8644 pos: usize,
8645 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8646 use self::flatbuffers::Verifiable;
8647 v.visit_table(pos)?
8648 .visit_field::<i32>("start", Self::VT_START, false)?
8649 .visit_field::<i32>("end", Self::VT_END, false)?
8650 .finish();
8651 Ok(())
8652 }
8653}
8654pub struct ShapeAttrsArgs {
8655 pub start: Option<i32>,
8656 pub end: Option<i32>,
8657}
8658impl<'a> Default for ShapeAttrsArgs {
8659 #[inline]
8660 fn default() -> Self {
8661 ShapeAttrsArgs {
8662 start: None,
8663 end: None,
8664 }
8665 }
8666}
8667
8668pub struct ShapeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
8669 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8670 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
8671}
8672impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ShapeAttrsBuilder<'a, 'b, A> {
8673 #[inline]
8674 pub fn add_start(&mut self, start: i32) {
8675 self.fbb_
8676 .push_slot_always::<i32>(ShapeAttrs::VT_START, start);
8677 }
8678 #[inline]
8679 pub fn add_end(&mut self, end: i32) {
8680 self.fbb_.push_slot_always::<i32>(ShapeAttrs::VT_END, end);
8681 }
8682 #[inline]
8683 pub fn new(
8684 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8685 ) -> ShapeAttrsBuilder<'a, 'b, A> {
8686 let start = _fbb.start_table();
8687 ShapeAttrsBuilder {
8688 fbb_: _fbb,
8689 start_: start,
8690 }
8691 }
8692 #[inline]
8693 pub fn finish(self) -> flatbuffers::WIPOffset<ShapeAttrs<'a>> {
8694 let o = self.fbb_.end_table(self.start_);
8695 flatbuffers::WIPOffset::new(o.value())
8696 }
8697}
8698
8699impl core::fmt::Debug for ShapeAttrs<'_> {
8700 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8701 let mut ds = f.debug_struct("ShapeAttrs");
8702 ds.field("start", &self.start());
8703 ds.field("end", &self.end());
8704 ds.finish()
8705 }
8706}
8707pub enum SoftmaxAttrsOffset {}
8708#[derive(Copy, Clone, PartialEq)]
8709
8710pub struct SoftmaxAttrs<'a> {
8711 pub _tab: flatbuffers::Table<'a>,
8712}
8713
8714impl<'a> flatbuffers::Follow<'a> for SoftmaxAttrs<'a> {
8715 type Inner = SoftmaxAttrs<'a>;
8716 #[inline]
8717 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
8718 Self {
8719 _tab: flatbuffers::Table::new(buf, loc),
8720 }
8721 }
8722}
8723
8724impl<'a> SoftmaxAttrs<'a> {
8725 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
8726
8727 #[inline]
8728 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
8729 SoftmaxAttrs { _tab: table }
8730 }
8731 #[allow(unused_mut)]
8732 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
8733 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8734 args: &'args SoftmaxAttrsArgs,
8735 ) -> flatbuffers::WIPOffset<SoftmaxAttrs<'bldr>> {
8736 let mut builder = SoftmaxAttrsBuilder::new(_fbb);
8737 builder.add_axis(args.axis);
8738 builder.finish()
8739 }
8740
8741 #[inline]
8742 pub fn axis(&self) -> i32 {
8743 unsafe {
8747 self._tab
8748 .get::<i32>(SoftmaxAttrs::VT_AXIS, Some(0))
8749 .unwrap()
8750 }
8751 }
8752}
8753
8754impl flatbuffers::Verifiable for SoftmaxAttrs<'_> {
8755 #[inline]
8756 fn run_verifier(
8757 v: &mut flatbuffers::Verifier,
8758 pos: usize,
8759 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8760 use self::flatbuffers::Verifiable;
8761 v.visit_table(pos)?
8762 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
8763 .finish();
8764 Ok(())
8765 }
8766}
8767pub struct SoftmaxAttrsArgs {
8768 pub axis: i32,
8769}
8770impl<'a> Default for SoftmaxAttrsArgs {
8771 #[inline]
8772 fn default() -> Self {
8773 SoftmaxAttrsArgs { axis: 0 }
8774 }
8775}
8776
8777pub struct SoftmaxAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
8778 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8779 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
8780}
8781impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SoftmaxAttrsBuilder<'a, 'b, A> {
8782 #[inline]
8783 pub fn add_axis(&mut self, axis: i32) {
8784 self.fbb_.push_slot::<i32>(SoftmaxAttrs::VT_AXIS, axis, 0);
8785 }
8786 #[inline]
8787 pub fn new(
8788 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8789 ) -> SoftmaxAttrsBuilder<'a, 'b, A> {
8790 let start = _fbb.start_table();
8791 SoftmaxAttrsBuilder {
8792 fbb_: _fbb,
8793 start_: start,
8794 }
8795 }
8796 #[inline]
8797 pub fn finish(self) -> flatbuffers::WIPOffset<SoftmaxAttrs<'a>> {
8798 let o = self.fbb_.end_table(self.start_);
8799 flatbuffers::WIPOffset::new(o.value())
8800 }
8801}
8802
8803impl core::fmt::Debug for SoftmaxAttrs<'_> {
8804 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8805 let mut ds = f.debug_struct("SoftmaxAttrs");
8806 ds.field("axis", &self.axis());
8807 ds.finish()
8808 }
8809}
8810pub enum SplitAttrsOffset {}
8811#[derive(Copy, Clone, PartialEq)]
8812
8813pub struct SplitAttrs<'a> {
8814 pub _tab: flatbuffers::Table<'a>,
8815}
8816
8817impl<'a> flatbuffers::Follow<'a> for SplitAttrs<'a> {
8818 type Inner = SplitAttrs<'a>;
8819 #[inline]
8820 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
8821 Self {
8822 _tab: flatbuffers::Table::new(buf, loc),
8823 }
8824 }
8825}
8826
8827impl<'a> SplitAttrs<'a> {
8828 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
8829 pub const VT_NUM_OUTPUTS: flatbuffers::VOffsetT = 6;
8830
8831 #[inline]
8832 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
8833 SplitAttrs { _tab: table }
8834 }
8835 #[allow(unused_mut)]
8836 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
8837 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8838 args: &'args SplitAttrsArgs,
8839 ) -> flatbuffers::WIPOffset<SplitAttrs<'bldr>> {
8840 let mut builder = SplitAttrsBuilder::new(_fbb);
8841 if let Some(x) = args.num_outputs {
8842 builder.add_num_outputs(x);
8843 }
8844 builder.add_axis(args.axis);
8845 builder.finish()
8846 }
8847
8848 #[inline]
8849 pub fn axis(&self) -> i32 {
8850 unsafe { self._tab.get::<i32>(SplitAttrs::VT_AXIS, Some(0)).unwrap() }
8854 }
8855 #[inline]
8856 pub fn num_outputs(&self) -> Option<i32> {
8857 unsafe { self._tab.get::<i32>(SplitAttrs::VT_NUM_OUTPUTS, None) }
8861 }
8862}
8863
8864impl flatbuffers::Verifiable for SplitAttrs<'_> {
8865 #[inline]
8866 fn run_verifier(
8867 v: &mut flatbuffers::Verifier,
8868 pos: usize,
8869 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8870 use self::flatbuffers::Verifiable;
8871 v.visit_table(pos)?
8872 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
8873 .visit_field::<i32>("num_outputs", Self::VT_NUM_OUTPUTS, false)?
8874 .finish();
8875 Ok(())
8876 }
8877}
8878pub struct SplitAttrsArgs {
8879 pub axis: i32,
8880 pub num_outputs: Option<i32>,
8881}
8882impl<'a> Default for SplitAttrsArgs {
8883 #[inline]
8884 fn default() -> Self {
8885 SplitAttrsArgs {
8886 axis: 0,
8887 num_outputs: None,
8888 }
8889 }
8890}
8891
8892pub struct SplitAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
8893 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8894 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
8895}
8896impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SplitAttrsBuilder<'a, 'b, A> {
8897 #[inline]
8898 pub fn add_axis(&mut self, axis: i32) {
8899 self.fbb_.push_slot::<i32>(SplitAttrs::VT_AXIS, axis, 0);
8900 }
8901 #[inline]
8902 pub fn add_num_outputs(&mut self, num_outputs: i32) {
8903 self.fbb_
8904 .push_slot_always::<i32>(SplitAttrs::VT_NUM_OUTPUTS, num_outputs);
8905 }
8906 #[inline]
8907 pub fn new(
8908 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
8909 ) -> SplitAttrsBuilder<'a, 'b, A> {
8910 let start = _fbb.start_table();
8911 SplitAttrsBuilder {
8912 fbb_: _fbb,
8913 start_: start,
8914 }
8915 }
8916 #[inline]
8917 pub fn finish(self) -> flatbuffers::WIPOffset<SplitAttrs<'a>> {
8918 let o = self.fbb_.end_table(self.start_);
8919 flatbuffers::WIPOffset::new(o.value())
8920 }
8921}
8922
8923impl core::fmt::Debug for SplitAttrs<'_> {
8924 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
8925 let mut ds = f.debug_struct("SplitAttrs");
8926 ds.field("axis", &self.axis());
8927 ds.field("num_outputs", &self.num_outputs());
8928 ds.finish()
8929 }
8930}
8931pub enum SplitToSequenceAttrsOffset {}
8932#[derive(Copy, Clone, PartialEq)]
8933
8934pub struct SplitToSequenceAttrs<'a> {
8935 pub _tab: flatbuffers::Table<'a>,
8936}
8937
8938impl<'a> flatbuffers::Follow<'a> for SplitToSequenceAttrs<'a> {
8939 type Inner = SplitToSequenceAttrs<'a>;
8940 #[inline]
8941 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
8942 Self {
8943 _tab: flatbuffers::Table::new(buf, loc),
8944 }
8945 }
8946}
8947
8948impl<'a> SplitToSequenceAttrs<'a> {
8949 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
8950 pub const VT_KEEP_DIMS: flatbuffers::VOffsetT = 6;
8951
8952 #[inline]
8953 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
8954 SplitToSequenceAttrs { _tab: table }
8955 }
8956 #[allow(unused_mut)]
8957 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
8958 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
8959 args: &'args SplitToSequenceAttrsArgs,
8960 ) -> flatbuffers::WIPOffset<SplitToSequenceAttrs<'bldr>> {
8961 let mut builder = SplitToSequenceAttrsBuilder::new(_fbb);
8962 builder.add_axis(args.axis);
8963 builder.add_keep_dims(args.keep_dims);
8964 builder.finish()
8965 }
8966
8967 #[inline]
8968 pub fn axis(&self) -> i32 {
8969 unsafe {
8973 self._tab
8974 .get::<i32>(SplitToSequenceAttrs::VT_AXIS, Some(0))
8975 .unwrap()
8976 }
8977 }
8978 #[inline]
8979 pub fn keep_dims(&self) -> bool {
8980 unsafe {
8984 self._tab
8985 .get::<bool>(SplitToSequenceAttrs::VT_KEEP_DIMS, Some(true))
8986 .unwrap()
8987 }
8988 }
8989}
8990
8991impl flatbuffers::Verifiable for SplitToSequenceAttrs<'_> {
8992 #[inline]
8993 fn run_verifier(
8994 v: &mut flatbuffers::Verifier,
8995 pos: usize,
8996 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
8997 use self::flatbuffers::Verifiable;
8998 v.visit_table(pos)?
8999 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
9000 .visit_field::<bool>("keep_dims", Self::VT_KEEP_DIMS, false)?
9001 .finish();
9002 Ok(())
9003 }
9004}
9005pub struct SplitToSequenceAttrsArgs {
9006 pub axis: i32,
9007 pub keep_dims: bool,
9008}
9009impl<'a> Default for SplitToSequenceAttrsArgs {
9010 #[inline]
9011 fn default() -> Self {
9012 SplitToSequenceAttrsArgs {
9013 axis: 0,
9014 keep_dims: true,
9015 }
9016 }
9017}
9018
9019pub struct SplitToSequenceAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
9020 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
9021 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
9022}
9023impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> SplitToSequenceAttrsBuilder<'a, 'b, A> {
9024 #[inline]
9025 pub fn add_axis(&mut self, axis: i32) {
9026 self.fbb_
9027 .push_slot::<i32>(SplitToSequenceAttrs::VT_AXIS, axis, 0);
9028 }
9029 #[inline]
9030 pub fn add_keep_dims(&mut self, keep_dims: bool) {
9031 self.fbb_
9032 .push_slot::<bool>(SplitToSequenceAttrs::VT_KEEP_DIMS, keep_dims, true);
9033 }
9034 #[inline]
9035 pub fn new(
9036 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
9037 ) -> SplitToSequenceAttrsBuilder<'a, 'b, A> {
9038 let start = _fbb.start_table();
9039 SplitToSequenceAttrsBuilder {
9040 fbb_: _fbb,
9041 start_: start,
9042 }
9043 }
9044 #[inline]
9045 pub fn finish(self) -> flatbuffers::WIPOffset<SplitToSequenceAttrs<'a>> {
9046 let o = self.fbb_.end_table(self.start_);
9047 flatbuffers::WIPOffset::new(o.value())
9048 }
9049}
9050
9051impl core::fmt::Debug for SplitToSequenceAttrs<'_> {
9052 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9053 let mut ds = f.debug_struct("SplitToSequenceAttrs");
9054 ds.field("axis", &self.axis());
9055 ds.field("keep_dims", &self.keep_dims());
9056 ds.finish()
9057 }
9058}
9059pub enum STFTAttrsOffset {}
9060#[derive(Copy, Clone, PartialEq)]
9061
9062pub struct STFTAttrs<'a> {
9063 pub _tab: flatbuffers::Table<'a>,
9064}
9065
9066impl<'a> flatbuffers::Follow<'a> for STFTAttrs<'a> {
9067 type Inner = STFTAttrs<'a>;
9068 #[inline]
9069 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
9070 Self {
9071 _tab: flatbuffers::Table::new(buf, loc),
9072 }
9073 }
9074}
9075
9076impl<'a> STFTAttrs<'a> {
9077 pub const VT_ONESIDED: flatbuffers::VOffsetT = 4;
9078
9079 #[inline]
9080 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
9081 STFTAttrs { _tab: table }
9082 }
9083 #[allow(unused_mut)]
9084 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
9085 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
9086 args: &'args STFTAttrsArgs,
9087 ) -> flatbuffers::WIPOffset<STFTAttrs<'bldr>> {
9088 let mut builder = STFTAttrsBuilder::new(_fbb);
9089 builder.add_onesided(args.onesided);
9090 builder.finish()
9091 }
9092
9093 #[inline]
9094 pub fn onesided(&self) -> bool {
9095 unsafe {
9099 self._tab
9100 .get::<bool>(STFTAttrs::VT_ONESIDED, Some(true))
9101 .unwrap()
9102 }
9103 }
9104}
9105
9106impl flatbuffers::Verifiable for STFTAttrs<'_> {
9107 #[inline]
9108 fn run_verifier(
9109 v: &mut flatbuffers::Verifier,
9110 pos: usize,
9111 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
9112 use self::flatbuffers::Verifiable;
9113 v.visit_table(pos)?
9114 .visit_field::<bool>("onesided", Self::VT_ONESIDED, false)?
9115 .finish();
9116 Ok(())
9117 }
9118}
9119pub struct STFTAttrsArgs {
9120 pub onesided: bool,
9121}
9122impl<'a> Default for STFTAttrsArgs {
9123 #[inline]
9124 fn default() -> Self {
9125 STFTAttrsArgs { onesided: true }
9126 }
9127}
9128
9129pub struct STFTAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
9130 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
9131 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
9132}
9133impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> STFTAttrsBuilder<'a, 'b, A> {
9134 #[inline]
9135 pub fn add_onesided(&mut self, onesided: bool) {
9136 self.fbb_
9137 .push_slot::<bool>(STFTAttrs::VT_ONESIDED, onesided, true);
9138 }
9139 #[inline]
9140 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> STFTAttrsBuilder<'a, 'b, A> {
9141 let start = _fbb.start_table();
9142 STFTAttrsBuilder {
9143 fbb_: _fbb,
9144 start_: start,
9145 }
9146 }
9147 #[inline]
9148 pub fn finish(self) -> flatbuffers::WIPOffset<STFTAttrs<'a>> {
9149 let o = self.fbb_.end_table(self.start_);
9150 flatbuffers::WIPOffset::new(o.value())
9151 }
9152}
9153
9154impl core::fmt::Debug for STFTAttrs<'_> {
9155 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9156 let mut ds = f.debug_struct("STFTAttrs");
9157 ds.field("onesided", &self.onesided());
9158 ds.finish()
9159 }
9160}
9161pub enum TopKAttrsOffset {}
9162#[derive(Copy, Clone, PartialEq)]
9163
9164pub struct TopKAttrs<'a> {
9165 pub _tab: flatbuffers::Table<'a>,
9166}
9167
9168impl<'a> flatbuffers::Follow<'a> for TopKAttrs<'a> {
9169 type Inner = TopKAttrs<'a>;
9170 #[inline]
9171 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
9172 Self {
9173 _tab: flatbuffers::Table::new(buf, loc),
9174 }
9175 }
9176}
9177
9178impl<'a> TopKAttrs<'a> {
9179 pub const VT_AXIS: flatbuffers::VOffsetT = 4;
9180 pub const VT_LARGEST: flatbuffers::VOffsetT = 6;
9181 pub const VT_SORTED: flatbuffers::VOffsetT = 8;
9182
9183 #[inline]
9184 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
9185 TopKAttrs { _tab: table }
9186 }
9187 #[allow(unused_mut)]
9188 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
9189 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
9190 args: &'args TopKAttrsArgs,
9191 ) -> flatbuffers::WIPOffset<TopKAttrs<'bldr>> {
9192 let mut builder = TopKAttrsBuilder::new(_fbb);
9193 builder.add_axis(args.axis);
9194 builder.add_sorted(args.sorted);
9195 builder.add_largest(args.largest);
9196 builder.finish()
9197 }
9198
9199 #[inline]
9200 pub fn axis(&self) -> i32 {
9201 unsafe { self._tab.get::<i32>(TopKAttrs::VT_AXIS, Some(0)).unwrap() }
9205 }
9206 #[inline]
9207 pub fn largest(&self) -> bool {
9208 unsafe {
9212 self._tab
9213 .get::<bool>(TopKAttrs::VT_LARGEST, Some(false))
9214 .unwrap()
9215 }
9216 }
9217 #[inline]
9218 pub fn sorted(&self) -> bool {
9219 unsafe {
9223 self._tab
9224 .get::<bool>(TopKAttrs::VT_SORTED, Some(false))
9225 .unwrap()
9226 }
9227 }
9228}
9229
9230impl flatbuffers::Verifiable for TopKAttrs<'_> {
9231 #[inline]
9232 fn run_verifier(
9233 v: &mut flatbuffers::Verifier,
9234 pos: usize,
9235 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
9236 use self::flatbuffers::Verifiable;
9237 v.visit_table(pos)?
9238 .visit_field::<i32>("axis", Self::VT_AXIS, false)?
9239 .visit_field::<bool>("largest", Self::VT_LARGEST, false)?
9240 .visit_field::<bool>("sorted", Self::VT_SORTED, false)?
9241 .finish();
9242 Ok(())
9243 }
9244}
9245pub struct TopKAttrsArgs {
9246 pub axis: i32,
9247 pub largest: bool,
9248 pub sorted: bool,
9249}
9250impl<'a> Default for TopKAttrsArgs {
9251 #[inline]
9252 fn default() -> Self {
9253 TopKAttrsArgs {
9254 axis: 0,
9255 largest: false,
9256 sorted: false,
9257 }
9258 }
9259}
9260
9261pub struct TopKAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
9262 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
9263 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
9264}
9265impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TopKAttrsBuilder<'a, 'b, A> {
9266 #[inline]
9267 pub fn add_axis(&mut self, axis: i32) {
9268 self.fbb_.push_slot::<i32>(TopKAttrs::VT_AXIS, axis, 0);
9269 }
9270 #[inline]
9271 pub fn add_largest(&mut self, largest: bool) {
9272 self.fbb_
9273 .push_slot::<bool>(TopKAttrs::VT_LARGEST, largest, false);
9274 }
9275 #[inline]
9276 pub fn add_sorted(&mut self, sorted: bool) {
9277 self.fbb_
9278 .push_slot::<bool>(TopKAttrs::VT_SORTED, sorted, false);
9279 }
9280 #[inline]
9281 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> TopKAttrsBuilder<'a, 'b, A> {
9282 let start = _fbb.start_table();
9283 TopKAttrsBuilder {
9284 fbb_: _fbb,
9285 start_: start,
9286 }
9287 }
9288 #[inline]
9289 pub fn finish(self) -> flatbuffers::WIPOffset<TopKAttrs<'a>> {
9290 let o = self.fbb_.end_table(self.start_);
9291 flatbuffers::WIPOffset::new(o.value())
9292 }
9293}
9294
9295impl core::fmt::Debug for TopKAttrs<'_> {
9296 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9297 let mut ds = f.debug_struct("TopKAttrs");
9298 ds.field("axis", &self.axis());
9299 ds.field("largest", &self.largest());
9300 ds.field("sorted", &self.sorted());
9301 ds.finish()
9302 }
9303}
9304pub enum TransposeAttrsOffset {}
9305#[derive(Copy, Clone, PartialEq)]
9306
9307pub struct TransposeAttrs<'a> {
9308 pub _tab: flatbuffers::Table<'a>,
9309}
9310
9311impl<'a> flatbuffers::Follow<'a> for TransposeAttrs<'a> {
9312 type Inner = TransposeAttrs<'a>;
9313 #[inline]
9314 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
9315 Self {
9316 _tab: flatbuffers::Table::new(buf, loc),
9317 }
9318 }
9319}
9320
9321impl<'a> TransposeAttrs<'a> {
9322 pub const VT_PERM: flatbuffers::VOffsetT = 4;
9323
9324 #[inline]
9325 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
9326 TransposeAttrs { _tab: table }
9327 }
9328 #[allow(unused_mut)]
9329 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
9330 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
9331 args: &'args TransposeAttrsArgs<'args>,
9332 ) -> flatbuffers::WIPOffset<TransposeAttrs<'bldr>> {
9333 let mut builder = TransposeAttrsBuilder::new(_fbb);
9334 if let Some(x) = args.perm {
9335 builder.add_perm(x);
9336 }
9337 builder.finish()
9338 }
9339
9340 #[inline]
9341 pub fn perm(&self) -> Option<flatbuffers::Vector<'a, u32>> {
9342 unsafe {
9346 self._tab
9347 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
9348 TransposeAttrs::VT_PERM,
9349 None,
9350 )
9351 }
9352 }
9353}
9354
9355impl flatbuffers::Verifiable for TransposeAttrs<'_> {
9356 #[inline]
9357 fn run_verifier(
9358 v: &mut flatbuffers::Verifier,
9359 pos: usize,
9360 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
9361 use self::flatbuffers::Verifiable;
9362 v.visit_table(pos)?
9363 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
9364 "perm",
9365 Self::VT_PERM,
9366 false,
9367 )?
9368 .finish();
9369 Ok(())
9370 }
9371}
9372pub struct TransposeAttrsArgs<'a> {
9373 pub perm: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
9374}
9375impl<'a> Default for TransposeAttrsArgs<'a> {
9376 #[inline]
9377 fn default() -> Self {
9378 TransposeAttrsArgs { perm: None }
9379 }
9380}
9381
9382pub struct TransposeAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
9383 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
9384 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
9385}
9386impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TransposeAttrsBuilder<'a, 'b, A> {
9387 #[inline]
9388 pub fn add_perm(&mut self, perm: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
9389 self.fbb_
9390 .push_slot_always::<flatbuffers::WIPOffset<_>>(TransposeAttrs::VT_PERM, perm);
9391 }
9392 #[inline]
9393 pub fn new(
9394 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
9395 ) -> TransposeAttrsBuilder<'a, 'b, A> {
9396 let start = _fbb.start_table();
9397 TransposeAttrsBuilder {
9398 fbb_: _fbb,
9399 start_: start,
9400 }
9401 }
9402 #[inline]
9403 pub fn finish(self) -> flatbuffers::WIPOffset<TransposeAttrs<'a>> {
9404 let o = self.fbb_.end_table(self.start_);
9405 flatbuffers::WIPOffset::new(o.value())
9406 }
9407}
9408
9409impl core::fmt::Debug for TransposeAttrs<'_> {
9410 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9411 let mut ds = f.debug_struct("TransposeAttrs");
9412 ds.field("perm", &self.perm());
9413 ds.finish()
9414 }
9415}
9416pub enum TriluAttrsOffset {}
9417#[derive(Copy, Clone, PartialEq)]
9418
9419pub struct TriluAttrs<'a> {
9420 pub _tab: flatbuffers::Table<'a>,
9421}
9422
9423impl<'a> flatbuffers::Follow<'a> for TriluAttrs<'a> {
9424 type Inner = TriluAttrs<'a>;
9425 #[inline]
9426 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
9427 Self {
9428 _tab: flatbuffers::Table::new(buf, loc),
9429 }
9430 }
9431}
9432
9433impl<'a> TriluAttrs<'a> {
9434 pub const VT_UPPER: flatbuffers::VOffsetT = 4;
9435
9436 #[inline]
9437 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
9438 TriluAttrs { _tab: table }
9439 }
9440 #[allow(unused_mut)]
9441 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
9442 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
9443 args: &'args TriluAttrsArgs,
9444 ) -> flatbuffers::WIPOffset<TriluAttrs<'bldr>> {
9445 let mut builder = TriluAttrsBuilder::new(_fbb);
9446 builder.add_upper(args.upper);
9447 builder.finish()
9448 }
9449
9450 #[inline]
9451 pub fn upper(&self) -> bool {
9452 unsafe {
9456 self._tab
9457 .get::<bool>(TriluAttrs::VT_UPPER, Some(false))
9458 .unwrap()
9459 }
9460 }
9461}
9462
9463impl flatbuffers::Verifiable for TriluAttrs<'_> {
9464 #[inline]
9465 fn run_verifier(
9466 v: &mut flatbuffers::Verifier,
9467 pos: usize,
9468 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
9469 use self::flatbuffers::Verifiable;
9470 v.visit_table(pos)?
9471 .visit_field::<bool>("upper", Self::VT_UPPER, false)?
9472 .finish();
9473 Ok(())
9474 }
9475}
9476pub struct TriluAttrsArgs {
9477 pub upper: bool,
9478}
9479impl<'a> Default for TriluAttrsArgs {
9480 #[inline]
9481 fn default() -> Self {
9482 TriluAttrsArgs { upper: false }
9483 }
9484}
9485
9486pub struct TriluAttrsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
9487 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
9488 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
9489}
9490impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> TriluAttrsBuilder<'a, 'b, A> {
9491 #[inline]
9492 pub fn add_upper(&mut self, upper: bool) {
9493 self.fbb_
9494 .push_slot::<bool>(TriluAttrs::VT_UPPER, upper, false);
9495 }
9496 #[inline]
9497 pub fn new(
9498 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
9499 ) -> TriluAttrsBuilder<'a, 'b, A> {
9500 let start = _fbb.start_table();
9501 TriluAttrsBuilder {
9502 fbb_: _fbb,
9503 start_: start,
9504 }
9505 }
9506 #[inline]
9507 pub fn finish(self) -> flatbuffers::WIPOffset<TriluAttrs<'a>> {
9508 let o = self.fbb_.end_table(self.start_);
9509 flatbuffers::WIPOffset::new(o.value())
9510 }
9511}
9512
9513impl core::fmt::Debug for TriluAttrs<'_> {
9514 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
9515 let mut ds = f.debug_struct("TriluAttrs");
9516 ds.field("upper", &self.upper());
9517 ds.finish()
9518 }
9519}
9520pub enum OperatorNodeOffset {}
9521#[derive(Copy, Clone, PartialEq)]
9522
9523pub struct OperatorNode<'a> {
9524 pub _tab: flatbuffers::Table<'a>,
9525}
9526
9527impl<'a> flatbuffers::Follow<'a> for OperatorNode<'a> {
9528 type Inner = OperatorNode<'a>;
9529 #[inline]
9530 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
9531 Self {
9532 _tab: flatbuffers::Table::new(buf, loc),
9533 }
9534 }
9535}
9536
9537impl<'a> OperatorNode<'a> {
9538 pub const VT_TYPE_: flatbuffers::VOffsetT = 4;
9539 pub const VT_ATTRS_TYPE: flatbuffers::VOffsetT = 6;
9540 pub const VT_ATTRS: flatbuffers::VOffsetT = 8;
9541 pub const VT_INPUTS: flatbuffers::VOffsetT = 10;
9542 pub const VT_OUTPUTS: flatbuffers::VOffsetT = 12;
9543
9544 #[inline]
9545 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
9546 OperatorNode { _tab: table }
9547 }
9548 #[allow(unused_mut)]
9549 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
9550 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
9551 args: &'args OperatorNodeArgs<'args>,
9552 ) -> flatbuffers::WIPOffset<OperatorNode<'bldr>> {
9553 let mut builder = OperatorNodeBuilder::new(_fbb);
9554 if let Some(x) = args.outputs {
9555 builder.add_outputs(x);
9556 }
9557 if let Some(x) = args.inputs {
9558 builder.add_inputs(x);
9559 }
9560 if let Some(x) = args.attrs {
9561 builder.add_attrs(x);
9562 }
9563 builder.add_attrs_type(args.attrs_type);
9564 builder.add_type_(args.type_);
9565 builder.finish()
9566 }
9567
9568 #[inline]
9569 pub fn type_(&self) -> OperatorType {
9570 unsafe {
9574 self._tab
9575 .get::<OperatorType>(OperatorNode::VT_TYPE_, Some(OperatorType::Add))
9576 .unwrap()
9577 }
9578 }
9579 #[inline]
9580 pub fn attrs_type(&self) -> OperatorAttrs {
9581 unsafe {
9585 self._tab
9586 .get::<OperatorAttrs>(OperatorNode::VT_ATTRS_TYPE, Some(OperatorAttrs::NONE))
9587 .unwrap()
9588 }
9589 }
9590 #[inline]
9591 pub fn attrs(&self) -> Option<flatbuffers::Table<'a>> {
9592 unsafe {
9596 self._tab
9597 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
9598 OperatorNode::VT_ATTRS,
9599 None,
9600 )
9601 }
9602 }
9603 #[inline]
9604 pub fn inputs(&self) -> Option<flatbuffers::Vector<'a, i32>> {
9605 unsafe {
9609 self._tab
9610 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(
9611 OperatorNode::VT_INPUTS,
9612 None,
9613 )
9614 }
9615 }
9616 #[inline]
9617 pub fn outputs(&self) -> Option<flatbuffers::Vector<'a, i32>> {
9618 unsafe {
9622 self._tab
9623 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(
9624 OperatorNode::VT_OUTPUTS,
9625 None,
9626 )
9627 }
9628 }
9629 #[inline]
9630 #[allow(non_snake_case)]
9631 pub fn attrs_as_arg_max_attrs(&self) -> Option<ArgMaxAttrs<'a>> {
9632 if self.attrs_type() == OperatorAttrs::ArgMaxAttrs {
9633 self.attrs().map(|t| {
9634 unsafe { ArgMaxAttrs::init_from_table(t) }
9638 })
9639 } else {
9640 None
9641 }
9642 }
9643
9644 #[inline]
9645 #[allow(non_snake_case)]
9646 pub fn attrs_as_average_pool_attrs(&self) -> Option<AveragePoolAttrs<'a>> {
9647 if self.attrs_type() == OperatorAttrs::AveragePoolAttrs {
9648 self.attrs().map(|t| {
9649 unsafe { AveragePoolAttrs::init_from_table(t) }
9653 })
9654 } else {
9655 None
9656 }
9657 }
9658
9659 #[inline]
9660 #[allow(non_snake_case)]
9661 pub fn attrs_as_batch_normalization_attrs(&self) -> Option<BatchNormalizationAttrs<'a>> {
9662 if self.attrs_type() == OperatorAttrs::BatchNormalizationAttrs {
9663 self.attrs().map(|t| {
9664 unsafe { BatchNormalizationAttrs::init_from_table(t) }
9668 })
9669 } else {
9670 None
9671 }
9672 }
9673
9674 #[inline]
9675 #[allow(non_snake_case)]
9676 pub fn attrs_as_cast_attrs(&self) -> Option<CastAttrs<'a>> {
9677 if self.attrs_type() == OperatorAttrs::CastAttrs {
9678 self.attrs().map(|t| {
9679 unsafe { CastAttrs::init_from_table(t) }
9683 })
9684 } else {
9685 None
9686 }
9687 }
9688
9689 #[inline]
9690 #[allow(non_snake_case)]
9691 pub fn attrs_as_concat_attrs(&self) -> Option<ConcatAttrs<'a>> {
9692 if self.attrs_type() == OperatorAttrs::ConcatAttrs {
9693 self.attrs().map(|t| {
9694 unsafe { ConcatAttrs::init_from_table(t) }
9698 })
9699 } else {
9700 None
9701 }
9702 }
9703
9704 #[inline]
9705 #[allow(non_snake_case)]
9706 pub fn attrs_as_constant_of_shape_attrs(&self) -> Option<ConstantOfShapeAttrs<'a>> {
9707 if self.attrs_type() == OperatorAttrs::ConstantOfShapeAttrs {
9708 self.attrs().map(|t| {
9709 unsafe { ConstantOfShapeAttrs::init_from_table(t) }
9713 })
9714 } else {
9715 None
9716 }
9717 }
9718
9719 #[inline]
9720 #[allow(non_snake_case)]
9721 pub fn attrs_as_conv_attrs(&self) -> Option<ConvAttrs<'a>> {
9722 if self.attrs_type() == OperatorAttrs::ConvAttrs {
9723 self.attrs().map(|t| {
9724 unsafe { ConvAttrs::init_from_table(t) }
9728 })
9729 } else {
9730 None
9731 }
9732 }
9733
9734 #[inline]
9735 #[allow(non_snake_case)]
9736 pub fn attrs_as_conv_transpose_attrs(&self) -> Option<ConvTransposeAttrs<'a>> {
9737 if self.attrs_type() == OperatorAttrs::ConvTransposeAttrs {
9738 self.attrs().map(|t| {
9739 unsafe { ConvTransposeAttrs::init_from_table(t) }
9743 })
9744 } else {
9745 None
9746 }
9747 }
9748
9749 #[inline]
9750 #[allow(non_snake_case)]
9751 pub fn attrs_as_flatten_attrs(&self) -> Option<FlattenAttrs<'a>> {
9752 if self.attrs_type() == OperatorAttrs::FlattenAttrs {
9753 self.attrs().map(|t| {
9754 unsafe { FlattenAttrs::init_from_table(t) }
9758 })
9759 } else {
9760 None
9761 }
9762 }
9763
9764 #[inline]
9765 #[allow(non_snake_case)]
9766 pub fn attrs_as_gather_attrs(&self) -> Option<GatherAttrs<'a>> {
9767 if self.attrs_type() == OperatorAttrs::GatherAttrs {
9768 self.attrs().map(|t| {
9769 unsafe { GatherAttrs::init_from_table(t) }
9773 })
9774 } else {
9775 None
9776 }
9777 }
9778
9779 #[inline]
9780 #[allow(non_snake_case)]
9781 pub fn attrs_as_gemm_attrs(&self) -> Option<GemmAttrs<'a>> {
9782 if self.attrs_type() == OperatorAttrs::GemmAttrs {
9783 self.attrs().map(|t| {
9784 unsafe { GemmAttrs::init_from_table(t) }
9788 })
9789 } else {
9790 None
9791 }
9792 }
9793
9794 #[inline]
9795 #[allow(non_snake_case)]
9796 pub fn attrs_as_gruattrs(&self) -> Option<GRUAttrs<'a>> {
9797 if self.attrs_type() == OperatorAttrs::GRUAttrs {
9798 self.attrs().map(|t| {
9799 unsafe { GRUAttrs::init_from_table(t) }
9803 })
9804 } else {
9805 None
9806 }
9807 }
9808
9809 #[inline]
9810 #[allow(non_snake_case)]
9811 pub fn attrs_as_leaky_relu_attrs(&self) -> Option<LeakyReluAttrs<'a>> {
9812 if self.attrs_type() == OperatorAttrs::LeakyReluAttrs {
9813 self.attrs().map(|t| {
9814 unsafe { LeakyReluAttrs::init_from_table(t) }
9818 })
9819 } else {
9820 None
9821 }
9822 }
9823
9824 #[inline]
9825 #[allow(non_snake_case)]
9826 pub fn attrs_as_lstmattrs(&self) -> Option<LSTMAttrs<'a>> {
9827 if self.attrs_type() == OperatorAttrs::LSTMAttrs {
9828 self.attrs().map(|t| {
9829 unsafe { LSTMAttrs::init_from_table(t) }
9833 })
9834 } else {
9835 None
9836 }
9837 }
9838
9839 #[inline]
9840 #[allow(non_snake_case)]
9841 pub fn attrs_as_max_pool_attrs(&self) -> Option<MaxPoolAttrs<'a>> {
9842 if self.attrs_type() == OperatorAttrs::MaxPoolAttrs {
9843 self.attrs().map(|t| {
9844 unsafe { MaxPoolAttrs::init_from_table(t) }
9848 })
9849 } else {
9850 None
9851 }
9852 }
9853
9854 #[inline]
9855 #[allow(non_snake_case)]
9856 pub fn attrs_as_reduce_mean_attrs(&self) -> Option<ReduceMeanAttrs<'a>> {
9857 if self.attrs_type() == OperatorAttrs::ReduceMeanAttrs {
9858 self.attrs().map(|t| {
9859 unsafe { ReduceMeanAttrs::init_from_table(t) }
9863 })
9864 } else {
9865 None
9866 }
9867 }
9868
9869 #[inline]
9870 #[allow(non_snake_case)]
9871 pub fn attrs_as_reshape_attrs(&self) -> Option<ReshapeAttrs<'a>> {
9872 if self.attrs_type() == OperatorAttrs::ReshapeAttrs {
9873 self.attrs().map(|t| {
9874 unsafe { ReshapeAttrs::init_from_table(t) }
9878 })
9879 } else {
9880 None
9881 }
9882 }
9883
9884 #[inline]
9885 #[allow(non_snake_case)]
9886 pub fn attrs_as_resize_attrs(&self) -> Option<ResizeAttrs<'a>> {
9887 if self.attrs_type() == OperatorAttrs::ResizeAttrs {
9888 self.attrs().map(|t| {
9889 unsafe { ResizeAttrs::init_from_table(t) }
9893 })
9894 } else {
9895 None
9896 }
9897 }
9898
9899 #[inline]
9900 #[allow(non_snake_case)]
9901 pub fn attrs_as_split_attrs(&self) -> Option<SplitAttrs<'a>> {
9902 if self.attrs_type() == OperatorAttrs::SplitAttrs {
9903 self.attrs().map(|t| {
9904 unsafe { SplitAttrs::init_from_table(t) }
9908 })
9909 } else {
9910 None
9911 }
9912 }
9913
9914 #[inline]
9915 #[allow(non_snake_case)]
9916 pub fn attrs_as_softmax_attrs(&self) -> Option<SoftmaxAttrs<'a>> {
9917 if self.attrs_type() == OperatorAttrs::SoftmaxAttrs {
9918 self.attrs().map(|t| {
9919 unsafe { SoftmaxAttrs::init_from_table(t) }
9923 })
9924 } else {
9925 None
9926 }
9927 }
9928
9929 #[inline]
9930 #[allow(non_snake_case)]
9931 pub fn attrs_as_transpose_attrs(&self) -> Option<TransposeAttrs<'a>> {
9932 if self.attrs_type() == OperatorAttrs::TransposeAttrs {
9933 self.attrs().map(|t| {
9934 unsafe { TransposeAttrs::init_from_table(t) }
9938 })
9939 } else {
9940 None
9941 }
9942 }
9943
9944 #[inline]
9945 #[allow(non_snake_case)]
9946 pub fn attrs_as_mod_attrs(&self) -> Option<ModAttrs<'a>> {
9947 if self.attrs_type() == OperatorAttrs::ModAttrs {
9948 self.attrs().map(|t| {
9949 unsafe { ModAttrs::init_from_table(t) }
9953 })
9954 } else {
9955 None
9956 }
9957 }
9958
9959 #[inline]
9960 #[allow(non_snake_case)]
9961 pub fn attrs_as_scatter_elements_attrs(&self) -> Option<ScatterElementsAttrs<'a>> {
9962 if self.attrs_type() == OperatorAttrs::ScatterElementsAttrs {
9963 self.attrs().map(|t| {
9964 unsafe { ScatterElementsAttrs::init_from_table(t) }
9968 })
9969 } else {
9970 None
9971 }
9972 }
9973
9974 #[inline]
9975 #[allow(non_snake_case)]
9976 pub fn attrs_as_one_hot_attrs(&self) -> Option<OneHotAttrs<'a>> {
9977 if self.attrs_type() == OperatorAttrs::OneHotAttrs {
9978 self.attrs().map(|t| {
9979 unsafe { OneHotAttrs::init_from_table(t) }
9983 })
9984 } else {
9985 None
9986 }
9987 }
9988
9989 #[inline]
9990 #[allow(non_snake_case)]
9991 pub fn attrs_as_top_kattrs(&self) -> Option<TopKAttrs<'a>> {
9992 if self.attrs_type() == OperatorAttrs::TopKAttrs {
9993 self.attrs().map(|t| {
9994 unsafe { TopKAttrs::init_from_table(t) }
9998 })
9999 } else {
10000 None
10001 }
10002 }
10003
10004 #[inline]
10005 #[allow(non_snake_case)]
10006 pub fn attrs_as_hard_sigmoid_attrs(&self) -> Option<HardSigmoidAttrs<'a>> {
10007 if self.attrs_type() == OperatorAttrs::HardSigmoidAttrs {
10008 self.attrs().map(|t| {
10009 unsafe { HardSigmoidAttrs::init_from_table(t) }
10013 })
10014 } else {
10015 None
10016 }
10017 }
10018
10019 #[inline]
10020 #[allow(non_snake_case)]
10021 pub fn attrs_as_trilu_attrs(&self) -> Option<TriluAttrs<'a>> {
10022 if self.attrs_type() == OperatorAttrs::TriluAttrs {
10023 self.attrs().map(|t| {
10024 unsafe { TriluAttrs::init_from_table(t) }
10028 })
10029 } else {
10030 None
10031 }
10032 }
10033
10034 #[inline]
10035 #[allow(non_snake_case)]
10036 pub fn attrs_as_scatter_ndattrs(&self) -> Option<ScatterNDAttrs<'a>> {
10037 if self.attrs_type() == OperatorAttrs::ScatterNDAttrs {
10038 self.attrs().map(|t| {
10039 unsafe { ScatterNDAttrs::init_from_table(t) }
10043 })
10044 } else {
10045 None
10046 }
10047 }
10048
10049 #[inline]
10050 #[allow(non_snake_case)]
10051 pub fn attrs_as_non_max_suppression_attrs(&self) -> Option<NonMaxSuppressionAttrs<'a>> {
10052 if self.attrs_type() == OperatorAttrs::NonMaxSuppressionAttrs {
10053 self.attrs().map(|t| {
10054 unsafe { NonMaxSuppressionAttrs::init_from_table(t) }
10058 })
10059 } else {
10060 None
10061 }
10062 }
10063
10064 #[inline]
10065 #[allow(non_snake_case)]
10066 pub fn attrs_as_layer_normalization_attrs(&self) -> Option<LayerNormalizationAttrs<'a>> {
10067 if self.attrs_type() == OperatorAttrs::LayerNormalizationAttrs {
10068 self.attrs().map(|t| {
10069 unsafe { LayerNormalizationAttrs::init_from_table(t) }
10073 })
10074 } else {
10075 None
10076 }
10077 }
10078
10079 #[inline]
10080 #[allow(non_snake_case)]
10081 pub fn attrs_as_random_uniform_attrs(&self) -> Option<RandomUniformAttrs<'a>> {
10082 if self.attrs_type() == OperatorAttrs::RandomUniformAttrs {
10083 self.attrs().map(|t| {
10084 unsafe { RandomUniformAttrs::init_from_table(t) }
10088 })
10089 } else {
10090 None
10091 }
10092 }
10093
10094 #[inline]
10095 #[allow(non_snake_case)]
10096 pub fn attrs_as_elu_attrs(&self) -> Option<EluAttrs<'a>> {
10097 if self.attrs_type() == OperatorAttrs::EluAttrs {
10098 self.attrs().map(|t| {
10099 unsafe { EluAttrs::init_from_table(t) }
10103 })
10104 } else {
10105 None
10106 }
10107 }
10108
10109 #[inline]
10110 #[allow(non_snake_case)]
10111 pub fn attrs_as_random_uniform_like_attrs(&self) -> Option<RandomUniformLikeAttrs<'a>> {
10112 if self.attrs_type() == OperatorAttrs::RandomUniformLikeAttrs {
10113 self.attrs().map(|t| {
10114 unsafe { RandomUniformLikeAttrs::init_from_table(t) }
10118 })
10119 } else {
10120 None
10121 }
10122 }
10123
10124 #[inline]
10125 #[allow(non_snake_case)]
10126 pub fn attrs_as_random_normal_attrs(&self) -> Option<RandomNormalAttrs<'a>> {
10127 if self.attrs_type() == OperatorAttrs::RandomNormalAttrs {
10128 self.attrs().map(|t| {
10129 unsafe { RandomNormalAttrs::init_from_table(t) }
10133 })
10134 } else {
10135 None
10136 }
10137 }
10138
10139 #[inline]
10140 #[allow(non_snake_case)]
10141 pub fn attrs_as_random_normal_like_attrs(&self) -> Option<RandomNormalLikeAttrs<'a>> {
10142 if self.attrs_type() == OperatorAttrs::RandomNormalLikeAttrs {
10143 self.attrs().map(|t| {
10144 unsafe { RandomNormalLikeAttrs::init_from_table(t) }
10148 })
10149 } else {
10150 None
10151 }
10152 }
10153
10154 #[inline]
10155 #[allow(non_snake_case)]
10156 pub fn attrs_as_gather_ndattrs(&self) -> Option<GatherNDAttrs<'a>> {
10157 if self.attrs_type() == OperatorAttrs::GatherNDAttrs {
10158 self.attrs().map(|t| {
10159 unsafe { GatherNDAttrs::init_from_table(t) }
10163 })
10164 } else {
10165 None
10166 }
10167 }
10168
10169 #[inline]
10170 #[allow(non_snake_case)]
10171 pub fn attrs_as_gelu_attrs(&self) -> Option<GeluAttrs<'a>> {
10172 if self.attrs_type() == OperatorAttrs::GeluAttrs {
10173 self.attrs().map(|t| {
10174 unsafe { GeluAttrs::init_from_table(t) }
10178 })
10179 } else {
10180 None
10181 }
10182 }
10183
10184 #[inline]
10185 #[allow(non_snake_case)]
10186 pub fn attrs_as_einsum_attrs(&self) -> Option<EinsumAttrs<'a>> {
10187 if self.attrs_type() == OperatorAttrs::EinsumAttrs {
10188 self.attrs().map(|t| {
10189 unsafe { EinsumAttrs::init_from_table(t) }
10193 })
10194 } else {
10195 None
10196 }
10197 }
10198
10199 #[inline]
10200 #[allow(non_snake_case)]
10201 pub fn attrs_as_if_attrs(&self) -> Option<IfAttrs<'a>> {
10202 if self.attrs_type() == OperatorAttrs::IfAttrs {
10203 self.attrs().map(|t| {
10204 unsafe { IfAttrs::init_from_table(t) }
10208 })
10209 } else {
10210 None
10211 }
10212 }
10213
10214 #[inline]
10215 #[allow(non_snake_case)]
10216 pub fn attrs_as_pad_attrs(&self) -> Option<PadAttrs<'a>> {
10217 if self.attrs_type() == OperatorAttrs::PadAttrs {
10218 self.attrs().map(|t| {
10219 unsafe { PadAttrs::init_from_table(t) }
10223 })
10224 } else {
10225 None
10226 }
10227 }
10228
10229 #[inline]
10230 #[allow(non_snake_case)]
10231 pub fn attrs_as_dequantize_linear_attrs(&self) -> Option<DequantizeLinearAttrs<'a>> {
10232 if self.attrs_type() == OperatorAttrs::DequantizeLinearAttrs {
10233 self.attrs().map(|t| {
10234 unsafe { DequantizeLinearAttrs::init_from_table(t) }
10238 })
10239 } else {
10240 None
10241 }
10242 }
10243
10244 #[inline]
10245 #[allow(non_snake_case)]
10246 pub fn attrs_as_quantize_linear_attrs(&self) -> Option<QuantizeLinearAttrs<'a>> {
10247 if self.attrs_type() == OperatorAttrs::QuantizeLinearAttrs {
10248 self.attrs().map(|t| {
10249 unsafe { QuantizeLinearAttrs::init_from_table(t) }
10253 })
10254 } else {
10255 None
10256 }
10257 }
10258
10259 #[inline]
10260 #[allow(non_snake_case)]
10261 pub fn attrs_as_depth_to_space_attrs(&self) -> Option<DepthToSpaceAttrs<'a>> {
10262 if self.attrs_type() == OperatorAttrs::DepthToSpaceAttrs {
10263 self.attrs().map(|t| {
10264 unsafe { DepthToSpaceAttrs::init_from_table(t) }
10268 })
10269 } else {
10270 None
10271 }
10272 }
10273
10274 #[inline]
10275 #[allow(non_snake_case)]
10276 pub fn attrs_as_cast_like_attrs(&self) -> Option<CastLikeAttrs<'a>> {
10277 if self.attrs_type() == OperatorAttrs::CastLikeAttrs {
10278 self.attrs().map(|t| {
10279 unsafe { CastLikeAttrs::init_from_table(t) }
10283 })
10284 } else {
10285 None
10286 }
10287 }
10288
10289 #[inline]
10290 #[allow(non_snake_case)]
10291 pub fn attrs_as_shape_attrs(&self) -> Option<ShapeAttrs<'a>> {
10292 if self.attrs_type() == OperatorAttrs::ShapeAttrs {
10293 self.attrs().map(|t| {
10294 unsafe { ShapeAttrs::init_from_table(t) }
10298 })
10299 } else {
10300 None
10301 }
10302 }
10303
10304 #[inline]
10305 #[allow(non_snake_case)]
10306 pub fn attrs_as_dropout_attrs(&self) -> Option<DropoutAttrs<'a>> {
10307 if self.attrs_type() == OperatorAttrs::DropoutAttrs {
10308 self.attrs().map(|t| {
10309 unsafe { DropoutAttrs::init_from_table(t) }
10313 })
10314 } else {
10315 None
10316 }
10317 }
10318
10319 #[inline]
10320 #[allow(non_snake_case)]
10321 pub fn attrs_as_eye_like_attrs(&self) -> Option<EyeLikeAttrs<'a>> {
10322 if self.attrs_type() == OperatorAttrs::EyeLikeAttrs {
10323 self.attrs().map(|t| {
10324 unsafe { EyeLikeAttrs::init_from_table(t) }
10328 })
10329 } else {
10330 None
10331 }
10332 }
10333
10334 #[inline]
10335 #[allow(non_snake_case)]
10336 pub fn attrs_as_is_inf_attrs(&self) -> Option<IsInfAttrs<'a>> {
10337 if self.attrs_type() == OperatorAttrs::IsInfAttrs {
10338 self.attrs().map(|t| {
10339 unsafe { IsInfAttrs::init_from_table(t) }
10343 })
10344 } else {
10345 None
10346 }
10347 }
10348
10349 #[inline]
10350 #[allow(non_snake_case)]
10351 pub fn attrs_as_loop_attrs(&self) -> Option<LoopAttrs<'a>> {
10352 if self.attrs_type() == OperatorAttrs::LoopAttrs {
10353 self.attrs().map(|t| {
10354 unsafe { LoopAttrs::init_from_table(t) }
10358 })
10359 } else {
10360 None
10361 }
10362 }
10363
10364 #[inline]
10365 #[allow(non_snake_case)]
10366 pub fn attrs_as_sequence_empty_attrs(&self) -> Option<SequenceEmptyAttrs<'a>> {
10367 if self.attrs_type() == OperatorAttrs::SequenceEmptyAttrs {
10368 self.attrs().map(|t| {
10369 unsafe { SequenceEmptyAttrs::init_from_table(t) }
10373 })
10374 } else {
10375 None
10376 }
10377 }
10378
10379 #[inline]
10380 #[allow(non_snake_case)]
10381 pub fn attrs_as_concat_from_sequence_attrs(&self) -> Option<ConcatFromSequenceAttrs<'a>> {
10382 if self.attrs_type() == OperatorAttrs::ConcatFromSequenceAttrs {
10383 self.attrs().map(|t| {
10384 unsafe { ConcatFromSequenceAttrs::init_from_table(t) }
10388 })
10389 } else {
10390 None
10391 }
10392 }
10393
10394 #[inline]
10395 #[allow(non_snake_case)]
10396 pub fn attrs_as_split_to_sequence_attrs(&self) -> Option<SplitToSequenceAttrs<'a>> {
10397 if self.attrs_type() == OperatorAttrs::SplitToSequenceAttrs {
10398 self.attrs().map(|t| {
10399 unsafe { SplitToSequenceAttrs::init_from_table(t) }
10403 })
10404 } else {
10405 None
10406 }
10407 }
10408
10409 #[inline]
10410 #[allow(non_snake_case)]
10411 pub fn attrs_as_grid_sample_attrs(&self) -> Option<GridSampleAttrs<'a>> {
10412 if self.attrs_type() == OperatorAttrs::GridSampleAttrs {
10413 self.attrs().map(|t| {
10414 unsafe { GridSampleAttrs::init_from_table(t) }
10418 })
10419 } else {
10420 None
10421 }
10422 }
10423
10424 #[inline]
10425 #[allow(non_snake_case)]
10426 pub fn attrs_as_stftattrs(&self) -> Option<STFTAttrs<'a>> {
10427 if self.attrs_type() == OperatorAttrs::STFTAttrs {
10428 self.attrs().map(|t| {
10429 unsafe { STFTAttrs::init_from_table(t) }
10433 })
10434 } else {
10435 None
10436 }
10437 }
10438}
10439
10440impl flatbuffers::Verifiable for OperatorNode<'_> {
10441 #[inline]
10442 fn run_verifier(
10443 v: &mut flatbuffers::Verifier,
10444 pos: usize,
10445 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
10446 use self::flatbuffers::Verifiable;
10447 v.visit_table(pos)?
10448 .visit_field::<OperatorType>("type_", Self::VT_TYPE_, false)?
10449 .visit_union::<OperatorAttrs, _>("attrs_type", Self::VT_ATTRS_TYPE, "attrs", Self::VT_ATTRS, false, |key, v, pos| {
10450 match key {
10451 OperatorAttrs::ArgMaxAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ArgMaxAttrs>>("OperatorAttrs::ArgMaxAttrs", pos),
10452 OperatorAttrs::AveragePoolAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<AveragePoolAttrs>>("OperatorAttrs::AveragePoolAttrs", pos),
10453 OperatorAttrs::BatchNormalizationAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<BatchNormalizationAttrs>>("OperatorAttrs::BatchNormalizationAttrs", pos),
10454 OperatorAttrs::CastAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<CastAttrs>>("OperatorAttrs::CastAttrs", pos),
10455 OperatorAttrs::ConcatAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ConcatAttrs>>("OperatorAttrs::ConcatAttrs", pos),
10456 OperatorAttrs::ConstantOfShapeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ConstantOfShapeAttrs>>("OperatorAttrs::ConstantOfShapeAttrs", pos),
10457 OperatorAttrs::ConvAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ConvAttrs>>("OperatorAttrs::ConvAttrs", pos),
10458 OperatorAttrs::ConvTransposeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ConvTransposeAttrs>>("OperatorAttrs::ConvTransposeAttrs", pos),
10459 OperatorAttrs::FlattenAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<FlattenAttrs>>("OperatorAttrs::FlattenAttrs", pos),
10460 OperatorAttrs::GatherAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GatherAttrs>>("OperatorAttrs::GatherAttrs", pos),
10461 OperatorAttrs::GemmAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GemmAttrs>>("OperatorAttrs::GemmAttrs", pos),
10462 OperatorAttrs::GRUAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GRUAttrs>>("OperatorAttrs::GRUAttrs", pos),
10463 OperatorAttrs::LeakyReluAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<LeakyReluAttrs>>("OperatorAttrs::LeakyReluAttrs", pos),
10464 OperatorAttrs::LSTMAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<LSTMAttrs>>("OperatorAttrs::LSTMAttrs", pos),
10465 OperatorAttrs::MaxPoolAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<MaxPoolAttrs>>("OperatorAttrs::MaxPoolAttrs", pos),
10466 OperatorAttrs::ReduceMeanAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ReduceMeanAttrs>>("OperatorAttrs::ReduceMeanAttrs", pos),
10467 OperatorAttrs::ReshapeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ReshapeAttrs>>("OperatorAttrs::ReshapeAttrs", pos),
10468 OperatorAttrs::ResizeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ResizeAttrs>>("OperatorAttrs::ResizeAttrs", pos),
10469 OperatorAttrs::SplitAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<SplitAttrs>>("OperatorAttrs::SplitAttrs", pos),
10470 OperatorAttrs::SoftmaxAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<SoftmaxAttrs>>("OperatorAttrs::SoftmaxAttrs", pos),
10471 OperatorAttrs::TransposeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<TransposeAttrs>>("OperatorAttrs::TransposeAttrs", pos),
10472 OperatorAttrs::ModAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ModAttrs>>("OperatorAttrs::ModAttrs", pos),
10473 OperatorAttrs::ScatterElementsAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ScatterElementsAttrs>>("OperatorAttrs::ScatterElementsAttrs", pos),
10474 OperatorAttrs::OneHotAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<OneHotAttrs>>("OperatorAttrs::OneHotAttrs", pos),
10475 OperatorAttrs::TopKAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<TopKAttrs>>("OperatorAttrs::TopKAttrs", pos),
10476 OperatorAttrs::HardSigmoidAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<HardSigmoidAttrs>>("OperatorAttrs::HardSigmoidAttrs", pos),
10477 OperatorAttrs::TriluAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<TriluAttrs>>("OperatorAttrs::TriluAttrs", pos),
10478 OperatorAttrs::ScatterNDAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ScatterNDAttrs>>("OperatorAttrs::ScatterNDAttrs", pos),
10479 OperatorAttrs::NonMaxSuppressionAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<NonMaxSuppressionAttrs>>("OperatorAttrs::NonMaxSuppressionAttrs", pos),
10480 OperatorAttrs::LayerNormalizationAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<LayerNormalizationAttrs>>("OperatorAttrs::LayerNormalizationAttrs", pos),
10481 OperatorAttrs::RandomUniformAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RandomUniformAttrs>>("OperatorAttrs::RandomUniformAttrs", pos),
10482 OperatorAttrs::EluAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<EluAttrs>>("OperatorAttrs::EluAttrs", pos),
10483 OperatorAttrs::RandomUniformLikeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RandomUniformLikeAttrs>>("OperatorAttrs::RandomUniformLikeAttrs", pos),
10484 OperatorAttrs::RandomNormalAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RandomNormalAttrs>>("OperatorAttrs::RandomNormalAttrs", pos),
10485 OperatorAttrs::RandomNormalLikeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<RandomNormalLikeAttrs>>("OperatorAttrs::RandomNormalLikeAttrs", pos),
10486 OperatorAttrs::GatherNDAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GatherNDAttrs>>("OperatorAttrs::GatherNDAttrs", pos),
10487 OperatorAttrs::GeluAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GeluAttrs>>("OperatorAttrs::GeluAttrs", pos),
10488 OperatorAttrs::EinsumAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<EinsumAttrs>>("OperatorAttrs::EinsumAttrs", pos),
10489 OperatorAttrs::IfAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<IfAttrs>>("OperatorAttrs::IfAttrs", pos),
10490 OperatorAttrs::PadAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<PadAttrs>>("OperatorAttrs::PadAttrs", pos),
10491 OperatorAttrs::DequantizeLinearAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<DequantizeLinearAttrs>>("OperatorAttrs::DequantizeLinearAttrs", pos),
10492 OperatorAttrs::QuantizeLinearAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<QuantizeLinearAttrs>>("OperatorAttrs::QuantizeLinearAttrs", pos),
10493 OperatorAttrs::DepthToSpaceAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<DepthToSpaceAttrs>>("OperatorAttrs::DepthToSpaceAttrs", pos),
10494 OperatorAttrs::CastLikeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<CastLikeAttrs>>("OperatorAttrs::CastLikeAttrs", pos),
10495 OperatorAttrs::ShapeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ShapeAttrs>>("OperatorAttrs::ShapeAttrs", pos),
10496 OperatorAttrs::DropoutAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<DropoutAttrs>>("OperatorAttrs::DropoutAttrs", pos),
10497 OperatorAttrs::EyeLikeAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<EyeLikeAttrs>>("OperatorAttrs::EyeLikeAttrs", pos),
10498 OperatorAttrs::IsInfAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<IsInfAttrs>>("OperatorAttrs::IsInfAttrs", pos),
10499 OperatorAttrs::LoopAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<LoopAttrs>>("OperatorAttrs::LoopAttrs", pos),
10500 OperatorAttrs::SequenceEmptyAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<SequenceEmptyAttrs>>("OperatorAttrs::SequenceEmptyAttrs", pos),
10501 OperatorAttrs::ConcatFromSequenceAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<ConcatFromSequenceAttrs>>("OperatorAttrs::ConcatFromSequenceAttrs", pos),
10502 OperatorAttrs::SplitToSequenceAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<SplitToSequenceAttrs>>("OperatorAttrs::SplitToSequenceAttrs", pos),
10503 OperatorAttrs::GridSampleAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<GridSampleAttrs>>("OperatorAttrs::GridSampleAttrs", pos),
10504 OperatorAttrs::STFTAttrs => v.verify_union_variant::<flatbuffers::ForwardsUOffset<STFTAttrs>>("OperatorAttrs::STFTAttrs", pos),
10505 _ => Ok(()),
10506 }
10507 })?
10508 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("inputs", Self::VT_INPUTS, false)?
10509 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>("outputs", Self::VT_OUTPUTS, false)?
10510 .finish();
10511 Ok(())
10512 }
10513}
10514pub struct OperatorNodeArgs<'a> {
10515 pub type_: OperatorType,
10516 pub attrs_type: OperatorAttrs,
10517 pub attrs: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
10518 pub inputs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
10519 pub outputs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
10520}
10521impl<'a> Default for OperatorNodeArgs<'a> {
10522 #[inline]
10523 fn default() -> Self {
10524 OperatorNodeArgs {
10525 type_: OperatorType::Add,
10526 attrs_type: OperatorAttrs::NONE,
10527 attrs: None,
10528 inputs: None,
10529 outputs: None,
10530 }
10531 }
10532}
10533
10534pub struct OperatorNodeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
10535 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
10536 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
10537}
10538impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> OperatorNodeBuilder<'a, 'b, A> {
10539 #[inline]
10540 pub fn add_type_(&mut self, type_: OperatorType) {
10541 self.fbb_
10542 .push_slot::<OperatorType>(OperatorNode::VT_TYPE_, type_, OperatorType::Add);
10543 }
10544 #[inline]
10545 pub fn add_attrs_type(&mut self, attrs_type: OperatorAttrs) {
10546 self.fbb_.push_slot::<OperatorAttrs>(
10547 OperatorNode::VT_ATTRS_TYPE,
10548 attrs_type,
10549 OperatorAttrs::NONE,
10550 );
10551 }
10552 #[inline]
10553 pub fn add_attrs(&mut self, attrs: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
10554 self.fbb_
10555 .push_slot_always::<flatbuffers::WIPOffset<_>>(OperatorNode::VT_ATTRS, attrs);
10556 }
10557 #[inline]
10558 pub fn add_inputs(&mut self, inputs: flatbuffers::WIPOffset<flatbuffers::Vector<'b, i32>>) {
10559 self.fbb_
10560 .push_slot_always::<flatbuffers::WIPOffset<_>>(OperatorNode::VT_INPUTS, inputs);
10561 }
10562 #[inline]
10563 pub fn add_outputs(&mut self, outputs: flatbuffers::WIPOffset<flatbuffers::Vector<'b, i32>>) {
10564 self.fbb_
10565 .push_slot_always::<flatbuffers::WIPOffset<_>>(OperatorNode::VT_OUTPUTS, outputs);
10566 }
10567 #[inline]
10568 pub fn new(
10569 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
10570 ) -> OperatorNodeBuilder<'a, 'b, A> {
10571 let start = _fbb.start_table();
10572 OperatorNodeBuilder {
10573 fbb_: _fbb,
10574 start_: start,
10575 }
10576 }
10577 #[inline]
10578 pub fn finish(self) -> flatbuffers::WIPOffset<OperatorNode<'a>> {
10579 let o = self.fbb_.end_table(self.start_);
10580 flatbuffers::WIPOffset::new(o.value())
10581 }
10582}
10583
10584impl core::fmt::Debug for OperatorNode<'_> {
10585 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
10586 let mut ds = f.debug_struct("OperatorNode");
10587 ds.field("type_", &self.type_());
10588 ds.field("attrs_type", &self.attrs_type());
10589 match self.attrs_type() {
10590 OperatorAttrs::ArgMaxAttrs => {
10591 if let Some(x) = self.attrs_as_arg_max_attrs() {
10592 ds.field("attrs", &x)
10593 } else {
10594 ds.field(
10595 "attrs",
10596 &"InvalidFlatbuffer: Union discriminant does not match value.",
10597 )
10598 }
10599 }
10600 OperatorAttrs::AveragePoolAttrs => {
10601 if let Some(x) = self.attrs_as_average_pool_attrs() {
10602 ds.field("attrs", &x)
10603 } else {
10604 ds.field(
10605 "attrs",
10606 &"InvalidFlatbuffer: Union discriminant does not match value.",
10607 )
10608 }
10609 }
10610 OperatorAttrs::BatchNormalizationAttrs => {
10611 if let Some(x) = self.attrs_as_batch_normalization_attrs() {
10612 ds.field("attrs", &x)
10613 } else {
10614 ds.field(
10615 "attrs",
10616 &"InvalidFlatbuffer: Union discriminant does not match value.",
10617 )
10618 }
10619 }
10620 OperatorAttrs::CastAttrs => {
10621 if let Some(x) = self.attrs_as_cast_attrs() {
10622 ds.field("attrs", &x)
10623 } else {
10624 ds.field(
10625 "attrs",
10626 &"InvalidFlatbuffer: Union discriminant does not match value.",
10627 )
10628 }
10629 }
10630 OperatorAttrs::ConcatAttrs => {
10631 if let Some(x) = self.attrs_as_concat_attrs() {
10632 ds.field("attrs", &x)
10633 } else {
10634 ds.field(
10635 "attrs",
10636 &"InvalidFlatbuffer: Union discriminant does not match value.",
10637 )
10638 }
10639 }
10640 OperatorAttrs::ConstantOfShapeAttrs => {
10641 if let Some(x) = self.attrs_as_constant_of_shape_attrs() {
10642 ds.field("attrs", &x)
10643 } else {
10644 ds.field(
10645 "attrs",
10646 &"InvalidFlatbuffer: Union discriminant does not match value.",
10647 )
10648 }
10649 }
10650 OperatorAttrs::ConvAttrs => {
10651 if let Some(x) = self.attrs_as_conv_attrs() {
10652 ds.field("attrs", &x)
10653 } else {
10654 ds.field(
10655 "attrs",
10656 &"InvalidFlatbuffer: Union discriminant does not match value.",
10657 )
10658 }
10659 }
10660 OperatorAttrs::ConvTransposeAttrs => {
10661 if let Some(x) = self.attrs_as_conv_transpose_attrs() {
10662 ds.field("attrs", &x)
10663 } else {
10664 ds.field(
10665 "attrs",
10666 &"InvalidFlatbuffer: Union discriminant does not match value.",
10667 )
10668 }
10669 }
10670 OperatorAttrs::FlattenAttrs => {
10671 if let Some(x) = self.attrs_as_flatten_attrs() {
10672 ds.field("attrs", &x)
10673 } else {
10674 ds.field(
10675 "attrs",
10676 &"InvalidFlatbuffer: Union discriminant does not match value.",
10677 )
10678 }
10679 }
10680 OperatorAttrs::GatherAttrs => {
10681 if let Some(x) = self.attrs_as_gather_attrs() {
10682 ds.field("attrs", &x)
10683 } else {
10684 ds.field(
10685 "attrs",
10686 &"InvalidFlatbuffer: Union discriminant does not match value.",
10687 )
10688 }
10689 }
10690 OperatorAttrs::GemmAttrs => {
10691 if let Some(x) = self.attrs_as_gemm_attrs() {
10692 ds.field("attrs", &x)
10693 } else {
10694 ds.field(
10695 "attrs",
10696 &"InvalidFlatbuffer: Union discriminant does not match value.",
10697 )
10698 }
10699 }
10700 OperatorAttrs::GRUAttrs => {
10701 if let Some(x) = self.attrs_as_gruattrs() {
10702 ds.field("attrs", &x)
10703 } else {
10704 ds.field(
10705 "attrs",
10706 &"InvalidFlatbuffer: Union discriminant does not match value.",
10707 )
10708 }
10709 }
10710 OperatorAttrs::LeakyReluAttrs => {
10711 if let Some(x) = self.attrs_as_leaky_relu_attrs() {
10712 ds.field("attrs", &x)
10713 } else {
10714 ds.field(
10715 "attrs",
10716 &"InvalidFlatbuffer: Union discriminant does not match value.",
10717 )
10718 }
10719 }
10720 OperatorAttrs::LSTMAttrs => {
10721 if let Some(x) = self.attrs_as_lstmattrs() {
10722 ds.field("attrs", &x)
10723 } else {
10724 ds.field(
10725 "attrs",
10726 &"InvalidFlatbuffer: Union discriminant does not match value.",
10727 )
10728 }
10729 }
10730 OperatorAttrs::MaxPoolAttrs => {
10731 if let Some(x) = self.attrs_as_max_pool_attrs() {
10732 ds.field("attrs", &x)
10733 } else {
10734 ds.field(
10735 "attrs",
10736 &"InvalidFlatbuffer: Union discriminant does not match value.",
10737 )
10738 }
10739 }
10740 OperatorAttrs::ReduceMeanAttrs => {
10741 if let Some(x) = self.attrs_as_reduce_mean_attrs() {
10742 ds.field("attrs", &x)
10743 } else {
10744 ds.field(
10745 "attrs",
10746 &"InvalidFlatbuffer: Union discriminant does not match value.",
10747 )
10748 }
10749 }
10750 OperatorAttrs::ReshapeAttrs => {
10751 if let Some(x) = self.attrs_as_reshape_attrs() {
10752 ds.field("attrs", &x)
10753 } else {
10754 ds.field(
10755 "attrs",
10756 &"InvalidFlatbuffer: Union discriminant does not match value.",
10757 )
10758 }
10759 }
10760 OperatorAttrs::ResizeAttrs => {
10761 if let Some(x) = self.attrs_as_resize_attrs() {
10762 ds.field("attrs", &x)
10763 } else {
10764 ds.field(
10765 "attrs",
10766 &"InvalidFlatbuffer: Union discriminant does not match value.",
10767 )
10768 }
10769 }
10770 OperatorAttrs::SplitAttrs => {
10771 if let Some(x) = self.attrs_as_split_attrs() {
10772 ds.field("attrs", &x)
10773 } else {
10774 ds.field(
10775 "attrs",
10776 &"InvalidFlatbuffer: Union discriminant does not match value.",
10777 )
10778 }
10779 }
10780 OperatorAttrs::SoftmaxAttrs => {
10781 if let Some(x) = self.attrs_as_softmax_attrs() {
10782 ds.field("attrs", &x)
10783 } else {
10784 ds.field(
10785 "attrs",
10786 &"InvalidFlatbuffer: Union discriminant does not match value.",
10787 )
10788 }
10789 }
10790 OperatorAttrs::TransposeAttrs => {
10791 if let Some(x) = self.attrs_as_transpose_attrs() {
10792 ds.field("attrs", &x)
10793 } else {
10794 ds.field(
10795 "attrs",
10796 &"InvalidFlatbuffer: Union discriminant does not match value.",
10797 )
10798 }
10799 }
10800 OperatorAttrs::ModAttrs => {
10801 if let Some(x) = self.attrs_as_mod_attrs() {
10802 ds.field("attrs", &x)
10803 } else {
10804 ds.field(
10805 "attrs",
10806 &"InvalidFlatbuffer: Union discriminant does not match value.",
10807 )
10808 }
10809 }
10810 OperatorAttrs::ScatterElementsAttrs => {
10811 if let Some(x) = self.attrs_as_scatter_elements_attrs() {
10812 ds.field("attrs", &x)
10813 } else {
10814 ds.field(
10815 "attrs",
10816 &"InvalidFlatbuffer: Union discriminant does not match value.",
10817 )
10818 }
10819 }
10820 OperatorAttrs::OneHotAttrs => {
10821 if let Some(x) = self.attrs_as_one_hot_attrs() {
10822 ds.field("attrs", &x)
10823 } else {
10824 ds.field(
10825 "attrs",
10826 &"InvalidFlatbuffer: Union discriminant does not match value.",
10827 )
10828 }
10829 }
10830 OperatorAttrs::TopKAttrs => {
10831 if let Some(x) = self.attrs_as_top_kattrs() {
10832 ds.field("attrs", &x)
10833 } else {
10834 ds.field(
10835 "attrs",
10836 &"InvalidFlatbuffer: Union discriminant does not match value.",
10837 )
10838 }
10839 }
10840 OperatorAttrs::HardSigmoidAttrs => {
10841 if let Some(x) = self.attrs_as_hard_sigmoid_attrs() {
10842 ds.field("attrs", &x)
10843 } else {
10844 ds.field(
10845 "attrs",
10846 &"InvalidFlatbuffer: Union discriminant does not match value.",
10847 )
10848 }
10849 }
10850 OperatorAttrs::TriluAttrs => {
10851 if let Some(x) = self.attrs_as_trilu_attrs() {
10852 ds.field("attrs", &x)
10853 } else {
10854 ds.field(
10855 "attrs",
10856 &"InvalidFlatbuffer: Union discriminant does not match value.",
10857 )
10858 }
10859 }
10860 OperatorAttrs::ScatterNDAttrs => {
10861 if let Some(x) = self.attrs_as_scatter_ndattrs() {
10862 ds.field("attrs", &x)
10863 } else {
10864 ds.field(
10865 "attrs",
10866 &"InvalidFlatbuffer: Union discriminant does not match value.",
10867 )
10868 }
10869 }
10870 OperatorAttrs::NonMaxSuppressionAttrs => {
10871 if let Some(x) = self.attrs_as_non_max_suppression_attrs() {
10872 ds.field("attrs", &x)
10873 } else {
10874 ds.field(
10875 "attrs",
10876 &"InvalidFlatbuffer: Union discriminant does not match value.",
10877 )
10878 }
10879 }
10880 OperatorAttrs::LayerNormalizationAttrs => {
10881 if let Some(x) = self.attrs_as_layer_normalization_attrs() {
10882 ds.field("attrs", &x)
10883 } else {
10884 ds.field(
10885 "attrs",
10886 &"InvalidFlatbuffer: Union discriminant does not match value.",
10887 )
10888 }
10889 }
10890 OperatorAttrs::RandomUniformAttrs => {
10891 if let Some(x) = self.attrs_as_random_uniform_attrs() {
10892 ds.field("attrs", &x)
10893 } else {
10894 ds.field(
10895 "attrs",
10896 &"InvalidFlatbuffer: Union discriminant does not match value.",
10897 )
10898 }
10899 }
10900 OperatorAttrs::EluAttrs => {
10901 if let Some(x) = self.attrs_as_elu_attrs() {
10902 ds.field("attrs", &x)
10903 } else {
10904 ds.field(
10905 "attrs",
10906 &"InvalidFlatbuffer: Union discriminant does not match value.",
10907 )
10908 }
10909 }
10910 OperatorAttrs::RandomUniformLikeAttrs => {
10911 if let Some(x) = self.attrs_as_random_uniform_like_attrs() {
10912 ds.field("attrs", &x)
10913 } else {
10914 ds.field(
10915 "attrs",
10916 &"InvalidFlatbuffer: Union discriminant does not match value.",
10917 )
10918 }
10919 }
10920 OperatorAttrs::RandomNormalAttrs => {
10921 if let Some(x) = self.attrs_as_random_normal_attrs() {
10922 ds.field("attrs", &x)
10923 } else {
10924 ds.field(
10925 "attrs",
10926 &"InvalidFlatbuffer: Union discriminant does not match value.",
10927 )
10928 }
10929 }
10930 OperatorAttrs::RandomNormalLikeAttrs => {
10931 if let Some(x) = self.attrs_as_random_normal_like_attrs() {
10932 ds.field("attrs", &x)
10933 } else {
10934 ds.field(
10935 "attrs",
10936 &"InvalidFlatbuffer: Union discriminant does not match value.",
10937 )
10938 }
10939 }
10940 OperatorAttrs::GatherNDAttrs => {
10941 if let Some(x) = self.attrs_as_gather_ndattrs() {
10942 ds.field("attrs", &x)
10943 } else {
10944 ds.field(
10945 "attrs",
10946 &"InvalidFlatbuffer: Union discriminant does not match value.",
10947 )
10948 }
10949 }
10950 OperatorAttrs::GeluAttrs => {
10951 if let Some(x) = self.attrs_as_gelu_attrs() {
10952 ds.field("attrs", &x)
10953 } else {
10954 ds.field(
10955 "attrs",
10956 &"InvalidFlatbuffer: Union discriminant does not match value.",
10957 )
10958 }
10959 }
10960 OperatorAttrs::EinsumAttrs => {
10961 if let Some(x) = self.attrs_as_einsum_attrs() {
10962 ds.field("attrs", &x)
10963 } else {
10964 ds.field(
10965 "attrs",
10966 &"InvalidFlatbuffer: Union discriminant does not match value.",
10967 )
10968 }
10969 }
10970 OperatorAttrs::IfAttrs => {
10971 if let Some(x) = self.attrs_as_if_attrs() {
10972 ds.field("attrs", &x)
10973 } else {
10974 ds.field(
10975 "attrs",
10976 &"InvalidFlatbuffer: Union discriminant does not match value.",
10977 )
10978 }
10979 }
10980 OperatorAttrs::PadAttrs => {
10981 if let Some(x) = self.attrs_as_pad_attrs() {
10982 ds.field("attrs", &x)
10983 } else {
10984 ds.field(
10985 "attrs",
10986 &"InvalidFlatbuffer: Union discriminant does not match value.",
10987 )
10988 }
10989 }
10990 OperatorAttrs::DequantizeLinearAttrs => {
10991 if let Some(x) = self.attrs_as_dequantize_linear_attrs() {
10992 ds.field("attrs", &x)
10993 } else {
10994 ds.field(
10995 "attrs",
10996 &"InvalidFlatbuffer: Union discriminant does not match value.",
10997 )
10998 }
10999 }
11000 OperatorAttrs::QuantizeLinearAttrs => {
11001 if let Some(x) = self.attrs_as_quantize_linear_attrs() {
11002 ds.field("attrs", &x)
11003 } else {
11004 ds.field(
11005 "attrs",
11006 &"InvalidFlatbuffer: Union discriminant does not match value.",
11007 )
11008 }
11009 }
11010 OperatorAttrs::DepthToSpaceAttrs => {
11011 if let Some(x) = self.attrs_as_depth_to_space_attrs() {
11012 ds.field("attrs", &x)
11013 } else {
11014 ds.field(
11015 "attrs",
11016 &"InvalidFlatbuffer: Union discriminant does not match value.",
11017 )
11018 }
11019 }
11020 OperatorAttrs::CastLikeAttrs => {
11021 if let Some(x) = self.attrs_as_cast_like_attrs() {
11022 ds.field("attrs", &x)
11023 } else {
11024 ds.field(
11025 "attrs",
11026 &"InvalidFlatbuffer: Union discriminant does not match value.",
11027 )
11028 }
11029 }
11030 OperatorAttrs::ShapeAttrs => {
11031 if let Some(x) = self.attrs_as_shape_attrs() {
11032 ds.field("attrs", &x)
11033 } else {
11034 ds.field(
11035 "attrs",
11036 &"InvalidFlatbuffer: Union discriminant does not match value.",
11037 )
11038 }
11039 }
11040 OperatorAttrs::DropoutAttrs => {
11041 if let Some(x) = self.attrs_as_dropout_attrs() {
11042 ds.field("attrs", &x)
11043 } else {
11044 ds.field(
11045 "attrs",
11046 &"InvalidFlatbuffer: Union discriminant does not match value.",
11047 )
11048 }
11049 }
11050 OperatorAttrs::EyeLikeAttrs => {
11051 if let Some(x) = self.attrs_as_eye_like_attrs() {
11052 ds.field("attrs", &x)
11053 } else {
11054 ds.field(
11055 "attrs",
11056 &"InvalidFlatbuffer: Union discriminant does not match value.",
11057 )
11058 }
11059 }
11060 OperatorAttrs::IsInfAttrs => {
11061 if let Some(x) = self.attrs_as_is_inf_attrs() {
11062 ds.field("attrs", &x)
11063 } else {
11064 ds.field(
11065 "attrs",
11066 &"InvalidFlatbuffer: Union discriminant does not match value.",
11067 )
11068 }
11069 }
11070 OperatorAttrs::LoopAttrs => {
11071 if let Some(x) = self.attrs_as_loop_attrs() {
11072 ds.field("attrs", &x)
11073 } else {
11074 ds.field(
11075 "attrs",
11076 &"InvalidFlatbuffer: Union discriminant does not match value.",
11077 )
11078 }
11079 }
11080 OperatorAttrs::SequenceEmptyAttrs => {
11081 if let Some(x) = self.attrs_as_sequence_empty_attrs() {
11082 ds.field("attrs", &x)
11083 } else {
11084 ds.field(
11085 "attrs",
11086 &"InvalidFlatbuffer: Union discriminant does not match value.",
11087 )
11088 }
11089 }
11090 OperatorAttrs::ConcatFromSequenceAttrs => {
11091 if let Some(x) = self.attrs_as_concat_from_sequence_attrs() {
11092 ds.field("attrs", &x)
11093 } else {
11094 ds.field(
11095 "attrs",
11096 &"InvalidFlatbuffer: Union discriminant does not match value.",
11097 )
11098 }
11099 }
11100 OperatorAttrs::SplitToSequenceAttrs => {
11101 if let Some(x) = self.attrs_as_split_to_sequence_attrs() {
11102 ds.field("attrs", &x)
11103 } else {
11104 ds.field(
11105 "attrs",
11106 &"InvalidFlatbuffer: Union discriminant does not match value.",
11107 )
11108 }
11109 }
11110 OperatorAttrs::GridSampleAttrs => {
11111 if let Some(x) = self.attrs_as_grid_sample_attrs() {
11112 ds.field("attrs", &x)
11113 } else {
11114 ds.field(
11115 "attrs",
11116 &"InvalidFlatbuffer: Union discriminant does not match value.",
11117 )
11118 }
11119 }
11120 OperatorAttrs::STFTAttrs => {
11121 if let Some(x) = self.attrs_as_stftattrs() {
11122 ds.field("attrs", &x)
11123 } else {
11124 ds.field(
11125 "attrs",
11126 &"InvalidFlatbuffer: Union discriminant does not match value.",
11127 )
11128 }
11129 }
11130 _ => {
11131 let x: Option<()> = None;
11132 ds.field("attrs", &x)
11133 }
11134 };
11135 ds.field("inputs", &self.inputs());
11136 ds.field("outputs", &self.outputs());
11137 ds.finish()
11138 }
11139}
11140pub enum FloatDataOffset {}
11141#[derive(Copy, Clone, PartialEq)]
11142
11143pub struct FloatData<'a> {
11144 pub _tab: flatbuffers::Table<'a>,
11145}
11146
11147impl<'a> flatbuffers::Follow<'a> for FloatData<'a> {
11148 type Inner = FloatData<'a>;
11149 #[inline]
11150 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
11151 Self {
11152 _tab: flatbuffers::Table::new(buf, loc),
11153 }
11154 }
11155}
11156
11157impl<'a> FloatData<'a> {
11158 pub const VT_DATA: flatbuffers::VOffsetT = 4;
11159
11160 #[inline]
11161 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
11162 FloatData { _tab: table }
11163 }
11164 #[allow(unused_mut)]
11165 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
11166 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
11167 args: &'args FloatDataArgs<'args>,
11168 ) -> flatbuffers::WIPOffset<FloatData<'bldr>> {
11169 let mut builder = FloatDataBuilder::new(_fbb);
11170 if let Some(x) = args.data {
11171 builder.add_data(x);
11172 }
11173 builder.finish()
11174 }
11175
11176 #[inline]
11177 pub fn data(&self) -> flatbuffers::Vector<'a, f32> {
11178 unsafe {
11182 self._tab
11183 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, f32>>>(
11184 FloatData::VT_DATA,
11185 None,
11186 )
11187 .unwrap()
11188 }
11189 }
11190}
11191
11192impl flatbuffers::Verifiable for FloatData<'_> {
11193 #[inline]
11194 fn run_verifier(
11195 v: &mut flatbuffers::Verifier,
11196 pos: usize,
11197 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
11198 use self::flatbuffers::Verifiable;
11199 v.visit_table(pos)?
11200 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, f32>>>(
11201 "data",
11202 Self::VT_DATA,
11203 true,
11204 )?
11205 .finish();
11206 Ok(())
11207 }
11208}
11209pub struct FloatDataArgs<'a> {
11210 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, f32>>>,
11211}
11212impl<'a> Default for FloatDataArgs<'a> {
11213 #[inline]
11214 fn default() -> Self {
11215 FloatDataArgs {
11216 data: None, }
11218 }
11219}
11220
11221pub struct FloatDataBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
11222 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
11223 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
11224}
11225impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> FloatDataBuilder<'a, 'b, A> {
11226 #[inline]
11227 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b, f32>>) {
11228 self.fbb_
11229 .push_slot_always::<flatbuffers::WIPOffset<_>>(FloatData::VT_DATA, data);
11230 }
11231 #[inline]
11232 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> FloatDataBuilder<'a, 'b, A> {
11233 let start = _fbb.start_table();
11234 FloatDataBuilder {
11235 fbb_: _fbb,
11236 start_: start,
11237 }
11238 }
11239 #[inline]
11240 pub fn finish(self) -> flatbuffers::WIPOffset<FloatData<'a>> {
11241 let o = self.fbb_.end_table(self.start_);
11242 self.fbb_.required(o, FloatData::VT_DATA, "data");
11243 flatbuffers::WIPOffset::new(o.value())
11244 }
11245}
11246
11247impl core::fmt::Debug for FloatData<'_> {
11248 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11249 let mut ds = f.debug_struct("FloatData");
11250 ds.field("data", &self.data());
11251 ds.finish()
11252 }
11253}
11254pub enum Int8DataOffset {}
11255#[derive(Copy, Clone, PartialEq)]
11256
11257pub struct Int8Data<'a> {
11258 pub _tab: flatbuffers::Table<'a>,
11259}
11260
11261impl<'a> flatbuffers::Follow<'a> for Int8Data<'a> {
11262 type Inner = Int8Data<'a>;
11263 #[inline]
11264 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
11265 Self {
11266 _tab: flatbuffers::Table::new(buf, loc),
11267 }
11268 }
11269}
11270
11271impl<'a> Int8Data<'a> {
11272 pub const VT_DATA: flatbuffers::VOffsetT = 4;
11273
11274 #[inline]
11275 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
11276 Int8Data { _tab: table }
11277 }
11278 #[allow(unused_mut)]
11279 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
11280 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
11281 args: &'args Int8DataArgs<'args>,
11282 ) -> flatbuffers::WIPOffset<Int8Data<'bldr>> {
11283 let mut builder = Int8DataBuilder::new(_fbb);
11284 if let Some(x) = args.data {
11285 builder.add_data(x);
11286 }
11287 builder.finish()
11288 }
11289
11290 #[inline]
11291 pub fn data(&self) -> flatbuffers::Vector<'a, i8> {
11292 unsafe {
11296 self._tab
11297 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i8>>>(
11298 Int8Data::VT_DATA,
11299 None,
11300 )
11301 .unwrap()
11302 }
11303 }
11304}
11305
11306impl flatbuffers::Verifiable for Int8Data<'_> {
11307 #[inline]
11308 fn run_verifier(
11309 v: &mut flatbuffers::Verifier,
11310 pos: usize,
11311 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
11312 use self::flatbuffers::Verifiable;
11313 v.visit_table(pos)?
11314 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i8>>>(
11315 "data",
11316 Self::VT_DATA,
11317 true,
11318 )?
11319 .finish();
11320 Ok(())
11321 }
11322}
11323pub struct Int8DataArgs<'a> {
11324 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i8>>>,
11325}
11326impl<'a> Default for Int8DataArgs<'a> {
11327 #[inline]
11328 fn default() -> Self {
11329 Int8DataArgs {
11330 data: None, }
11332 }
11333}
11334
11335pub struct Int8DataBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
11336 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
11337 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
11338}
11339impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> Int8DataBuilder<'a, 'b, A> {
11340 #[inline]
11341 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b, i8>>) {
11342 self.fbb_
11343 .push_slot_always::<flatbuffers::WIPOffset<_>>(Int8Data::VT_DATA, data);
11344 }
11345 #[inline]
11346 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> Int8DataBuilder<'a, 'b, A> {
11347 let start = _fbb.start_table();
11348 Int8DataBuilder {
11349 fbb_: _fbb,
11350 start_: start,
11351 }
11352 }
11353 #[inline]
11354 pub fn finish(self) -> flatbuffers::WIPOffset<Int8Data<'a>> {
11355 let o = self.fbb_.end_table(self.start_);
11356 self.fbb_.required(o, Int8Data::VT_DATA, "data");
11357 flatbuffers::WIPOffset::new(o.value())
11358 }
11359}
11360
11361impl core::fmt::Debug for Int8Data<'_> {
11362 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11363 let mut ds = f.debug_struct("Int8Data");
11364 ds.field("data", &self.data());
11365 ds.finish()
11366 }
11367}
11368pub enum Int32DataOffset {}
11369#[derive(Copy, Clone, PartialEq)]
11370
11371pub struct Int32Data<'a> {
11372 pub _tab: flatbuffers::Table<'a>,
11373}
11374
11375impl<'a> flatbuffers::Follow<'a> for Int32Data<'a> {
11376 type Inner = Int32Data<'a>;
11377 #[inline]
11378 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
11379 Self {
11380 _tab: flatbuffers::Table::new(buf, loc),
11381 }
11382 }
11383}
11384
11385impl<'a> Int32Data<'a> {
11386 pub const VT_DATA: flatbuffers::VOffsetT = 4;
11387
11388 #[inline]
11389 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
11390 Int32Data { _tab: table }
11391 }
11392 #[allow(unused_mut)]
11393 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
11394 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
11395 args: &'args Int32DataArgs<'args>,
11396 ) -> flatbuffers::WIPOffset<Int32Data<'bldr>> {
11397 let mut builder = Int32DataBuilder::new(_fbb);
11398 if let Some(x) = args.data {
11399 builder.add_data(x);
11400 }
11401 builder.finish()
11402 }
11403
11404 #[inline]
11405 pub fn data(&self) -> flatbuffers::Vector<'a, i32> {
11406 unsafe {
11410 self._tab
11411 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(
11412 Int32Data::VT_DATA,
11413 None,
11414 )
11415 .unwrap()
11416 }
11417 }
11418}
11419
11420impl flatbuffers::Verifiable for Int32Data<'_> {
11421 #[inline]
11422 fn run_verifier(
11423 v: &mut flatbuffers::Verifier,
11424 pos: usize,
11425 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
11426 use self::flatbuffers::Verifiable;
11427 v.visit_table(pos)?
11428 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>(
11429 "data",
11430 Self::VT_DATA,
11431 true,
11432 )?
11433 .finish();
11434 Ok(())
11435 }
11436}
11437pub struct Int32DataArgs<'a> {
11438 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
11439}
11440impl<'a> Default for Int32DataArgs<'a> {
11441 #[inline]
11442 fn default() -> Self {
11443 Int32DataArgs {
11444 data: None, }
11446 }
11447}
11448
11449pub struct Int32DataBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
11450 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
11451 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
11452}
11453impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> Int32DataBuilder<'a, 'b, A> {
11454 #[inline]
11455 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b, i32>>) {
11456 self.fbb_
11457 .push_slot_always::<flatbuffers::WIPOffset<_>>(Int32Data::VT_DATA, data);
11458 }
11459 #[inline]
11460 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> Int32DataBuilder<'a, 'b, A> {
11461 let start = _fbb.start_table();
11462 Int32DataBuilder {
11463 fbb_: _fbb,
11464 start_: start,
11465 }
11466 }
11467 #[inline]
11468 pub fn finish(self) -> flatbuffers::WIPOffset<Int32Data<'a>> {
11469 let o = self.fbb_.end_table(self.start_);
11470 self.fbb_.required(o, Int32Data::VT_DATA, "data");
11471 flatbuffers::WIPOffset::new(o.value())
11472 }
11473}
11474
11475impl core::fmt::Debug for Int32Data<'_> {
11476 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11477 let mut ds = f.debug_struct("Int32Data");
11478 ds.field("data", &self.data());
11479 ds.finish()
11480 }
11481}
11482pub enum UInt8DataOffset {}
11483#[derive(Copy, Clone, PartialEq)]
11484
11485pub struct UInt8Data<'a> {
11486 pub _tab: flatbuffers::Table<'a>,
11487}
11488
11489impl<'a> flatbuffers::Follow<'a> for UInt8Data<'a> {
11490 type Inner = UInt8Data<'a>;
11491 #[inline]
11492 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
11493 Self {
11494 _tab: flatbuffers::Table::new(buf, loc),
11495 }
11496 }
11497}
11498
11499impl<'a> UInt8Data<'a> {
11500 pub const VT_DATA: flatbuffers::VOffsetT = 4;
11501
11502 #[inline]
11503 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
11504 UInt8Data { _tab: table }
11505 }
11506 #[allow(unused_mut)]
11507 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
11508 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
11509 args: &'args UInt8DataArgs<'args>,
11510 ) -> flatbuffers::WIPOffset<UInt8Data<'bldr>> {
11511 let mut builder = UInt8DataBuilder::new(_fbb);
11512 if let Some(x) = args.data {
11513 builder.add_data(x);
11514 }
11515 builder.finish()
11516 }
11517
11518 #[inline]
11519 pub fn data(&self) -> flatbuffers::Vector<'a, u8> {
11520 unsafe {
11524 self._tab
11525 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(
11526 UInt8Data::VT_DATA,
11527 None,
11528 )
11529 .unwrap()
11530 }
11531 }
11532}
11533
11534impl flatbuffers::Verifiable for UInt8Data<'_> {
11535 #[inline]
11536 fn run_verifier(
11537 v: &mut flatbuffers::Verifier,
11538 pos: usize,
11539 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
11540 use self::flatbuffers::Verifiable;
11541 v.visit_table(pos)?
11542 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>(
11543 "data",
11544 Self::VT_DATA,
11545 true,
11546 )?
11547 .finish();
11548 Ok(())
11549 }
11550}
11551pub struct UInt8DataArgs<'a> {
11552 pub data: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
11553}
11554impl<'a> Default for UInt8DataArgs<'a> {
11555 #[inline]
11556 fn default() -> Self {
11557 UInt8DataArgs {
11558 data: None, }
11560 }
11561}
11562
11563pub struct UInt8DataBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
11564 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
11565 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
11566}
11567impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> UInt8DataBuilder<'a, 'b, A> {
11568 #[inline]
11569 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u8>>) {
11570 self.fbb_
11571 .push_slot_always::<flatbuffers::WIPOffset<_>>(UInt8Data::VT_DATA, data);
11572 }
11573 #[inline]
11574 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> UInt8DataBuilder<'a, 'b, A> {
11575 let start = _fbb.start_table();
11576 UInt8DataBuilder {
11577 fbb_: _fbb,
11578 start_: start,
11579 }
11580 }
11581 #[inline]
11582 pub fn finish(self) -> flatbuffers::WIPOffset<UInt8Data<'a>> {
11583 let o = self.fbb_.end_table(self.start_);
11584 self.fbb_.required(o, UInt8Data::VT_DATA, "data");
11585 flatbuffers::WIPOffset::new(o.value())
11586 }
11587}
11588
11589impl core::fmt::Debug for UInt8Data<'_> {
11590 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11591 let mut ds = f.debug_struct("UInt8Data");
11592 ds.field("data", &self.data());
11593 ds.finish()
11594 }
11595}
11596pub enum ConstantNodeOffset {}
11597#[derive(Copy, Clone, PartialEq)]
11598
11599pub struct ConstantNode<'a> {
11600 pub _tab: flatbuffers::Table<'a>,
11601}
11602
11603impl<'a> flatbuffers::Follow<'a> for ConstantNode<'a> {
11604 type Inner = ConstantNode<'a>;
11605 #[inline]
11606 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
11607 Self {
11608 _tab: flatbuffers::Table::new(buf, loc),
11609 }
11610 }
11611}
11612
11613impl<'a> ConstantNode<'a> {
11614 pub const VT_SHAPE: flatbuffers::VOffsetT = 4;
11615 pub const VT_DATA_TYPE: flatbuffers::VOffsetT = 6;
11616 pub const VT_DATA: flatbuffers::VOffsetT = 8;
11617 pub const VT_DTYPE: flatbuffers::VOffsetT = 10;
11618 pub const VT_DATA_OFFSET: flatbuffers::VOffsetT = 12;
11619
11620 #[inline]
11621 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
11622 ConstantNode { _tab: table }
11623 }
11624 #[allow(unused_mut)]
11625 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
11626 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
11627 args: &'args ConstantNodeArgs<'args>,
11628 ) -> flatbuffers::WIPOffset<ConstantNode<'bldr>> {
11629 let mut builder = ConstantNodeBuilder::new(_fbb);
11630 if let Some(x) = args.data_offset {
11631 builder.add_data_offset(x);
11632 }
11633 if let Some(x) = args.data {
11634 builder.add_data(x);
11635 }
11636 if let Some(x) = args.shape {
11637 builder.add_shape(x);
11638 }
11639 if let Some(x) = args.dtype {
11640 builder.add_dtype(x);
11641 }
11642 builder.add_data_type(args.data_type);
11643 builder.finish()
11644 }
11645
11646 #[inline]
11647 pub fn shape(&self) -> flatbuffers::Vector<'a, u32> {
11648 unsafe {
11652 self._tab
11653 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
11654 ConstantNode::VT_SHAPE,
11655 None,
11656 )
11657 .unwrap()
11658 }
11659 }
11660 #[inline]
11661 pub fn data_type(&self) -> ConstantData {
11662 unsafe {
11666 self._tab
11667 .get::<ConstantData>(ConstantNode::VT_DATA_TYPE, Some(ConstantData::NONE))
11668 .unwrap()
11669 }
11670 }
11671 #[inline]
11672 pub fn data(&self) -> Option<flatbuffers::Table<'a>> {
11673 unsafe {
11677 self._tab
11678 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(
11679 ConstantNode::VT_DATA,
11680 None,
11681 )
11682 }
11683 }
11684 #[inline]
11685 pub fn dtype(&self) -> Option<ConstantDataType> {
11686 unsafe {
11690 self._tab
11691 .get::<ConstantDataType>(ConstantNode::VT_DTYPE, None)
11692 }
11693 }
11694 #[inline]
11695 pub fn data_offset(&self) -> Option<u64> {
11696 unsafe { self._tab.get::<u64>(ConstantNode::VT_DATA_OFFSET, None) }
11700 }
11701 #[inline]
11702 #[allow(non_snake_case)]
11703 pub fn data_as_float_data(&self) -> Option<FloatData<'a>> {
11704 if self.data_type() == ConstantData::FloatData {
11705 self.data().map(|t| {
11706 unsafe { FloatData::init_from_table(t) }
11710 })
11711 } else {
11712 None
11713 }
11714 }
11715
11716 #[inline]
11717 #[allow(non_snake_case)]
11718 pub fn data_as_int_32_data(&self) -> Option<Int32Data<'a>> {
11719 if self.data_type() == ConstantData::Int32Data {
11720 self.data().map(|t| {
11721 unsafe { Int32Data::init_from_table(t) }
11725 })
11726 } else {
11727 None
11728 }
11729 }
11730
11731 #[inline]
11732 #[allow(non_snake_case)]
11733 pub fn data_as_int_8_data(&self) -> Option<Int8Data<'a>> {
11734 if self.data_type() == ConstantData::Int8Data {
11735 self.data().map(|t| {
11736 unsafe { Int8Data::init_from_table(t) }
11740 })
11741 } else {
11742 None
11743 }
11744 }
11745
11746 #[inline]
11747 #[allow(non_snake_case)]
11748 pub fn data_as_uint_8_data(&self) -> Option<UInt8Data<'a>> {
11749 if self.data_type() == ConstantData::UInt8Data {
11750 self.data().map(|t| {
11751 unsafe { UInt8Data::init_from_table(t) }
11755 })
11756 } else {
11757 None
11758 }
11759 }
11760}
11761
11762impl flatbuffers::Verifiable for ConstantNode<'_> {
11763 #[inline]
11764 fn run_verifier(
11765 v: &mut flatbuffers::Verifier,
11766 pos: usize,
11767 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
11768 use self::flatbuffers::Verifiable;
11769 v.visit_table(pos)?
11770 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
11771 "shape",
11772 Self::VT_SHAPE,
11773 true,
11774 )?
11775 .visit_union::<ConstantData, _>(
11776 "data_type",
11777 Self::VT_DATA_TYPE,
11778 "data",
11779 Self::VT_DATA,
11780 false,
11781 |key, v, pos| match key {
11782 ConstantData::FloatData => v
11783 .verify_union_variant::<flatbuffers::ForwardsUOffset<FloatData>>(
11784 "ConstantData::FloatData",
11785 pos,
11786 ),
11787 ConstantData::Int32Data => v
11788 .verify_union_variant::<flatbuffers::ForwardsUOffset<Int32Data>>(
11789 "ConstantData::Int32Data",
11790 pos,
11791 ),
11792 ConstantData::Int8Data => v
11793 .verify_union_variant::<flatbuffers::ForwardsUOffset<Int8Data>>(
11794 "ConstantData::Int8Data",
11795 pos,
11796 ),
11797 ConstantData::UInt8Data => v
11798 .verify_union_variant::<flatbuffers::ForwardsUOffset<UInt8Data>>(
11799 "ConstantData::UInt8Data",
11800 pos,
11801 ),
11802 _ => Ok(()),
11803 },
11804 )?
11805 .visit_field::<ConstantDataType>("dtype", Self::VT_DTYPE, false)?
11806 .visit_field::<u64>("data_offset", Self::VT_DATA_OFFSET, false)?
11807 .finish();
11808 Ok(())
11809 }
11810}
11811pub struct ConstantNodeArgs<'a> {
11812 pub shape: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
11813 pub data_type: ConstantData,
11814 pub data: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
11815 pub dtype: Option<ConstantDataType>,
11816 pub data_offset: Option<u64>,
11817}
11818impl<'a> Default for ConstantNodeArgs<'a> {
11819 #[inline]
11820 fn default() -> Self {
11821 ConstantNodeArgs {
11822 shape: None, data_type: ConstantData::NONE,
11824 data: None,
11825 dtype: None,
11826 data_offset: None,
11827 }
11828 }
11829}
11830
11831pub struct ConstantNodeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
11832 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
11833 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
11834}
11835impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ConstantNodeBuilder<'a, 'b, A> {
11836 #[inline]
11837 pub fn add_shape(&mut self, shape: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
11838 self.fbb_
11839 .push_slot_always::<flatbuffers::WIPOffset<_>>(ConstantNode::VT_SHAPE, shape);
11840 }
11841 #[inline]
11842 pub fn add_data_type(&mut self, data_type: ConstantData) {
11843 self.fbb_.push_slot::<ConstantData>(
11844 ConstantNode::VT_DATA_TYPE,
11845 data_type,
11846 ConstantData::NONE,
11847 );
11848 }
11849 #[inline]
11850 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
11851 self.fbb_
11852 .push_slot_always::<flatbuffers::WIPOffset<_>>(ConstantNode::VT_DATA, data);
11853 }
11854 #[inline]
11855 pub fn add_dtype(&mut self, dtype: ConstantDataType) {
11856 self.fbb_
11857 .push_slot_always::<ConstantDataType>(ConstantNode::VT_DTYPE, dtype);
11858 }
11859 #[inline]
11860 pub fn add_data_offset(&mut self, data_offset: u64) {
11861 self.fbb_
11862 .push_slot_always::<u64>(ConstantNode::VT_DATA_OFFSET, data_offset);
11863 }
11864 #[inline]
11865 pub fn new(
11866 _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
11867 ) -> ConstantNodeBuilder<'a, 'b, A> {
11868 let start = _fbb.start_table();
11869 ConstantNodeBuilder {
11870 fbb_: _fbb,
11871 start_: start,
11872 }
11873 }
11874 #[inline]
11875 pub fn finish(self) -> flatbuffers::WIPOffset<ConstantNode<'a>> {
11876 let o = self.fbb_.end_table(self.start_);
11877 self.fbb_.required(o, ConstantNode::VT_SHAPE, "shape");
11878 flatbuffers::WIPOffset::new(o.value())
11879 }
11880}
11881
11882impl core::fmt::Debug for ConstantNode<'_> {
11883 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
11884 let mut ds = f.debug_struct("ConstantNode");
11885 ds.field("shape", &self.shape());
11886 ds.field("data_type", &self.data_type());
11887 match self.data_type() {
11888 ConstantData::FloatData => {
11889 if let Some(x) = self.data_as_float_data() {
11890 ds.field("data", &x)
11891 } else {
11892 ds.field(
11893 "data",
11894 &"InvalidFlatbuffer: Union discriminant does not match value.",
11895 )
11896 }
11897 }
11898 ConstantData::Int32Data => {
11899 if let Some(x) = self.data_as_int_32_data() {
11900 ds.field("data", &x)
11901 } else {
11902 ds.field(
11903 "data",
11904 &"InvalidFlatbuffer: Union discriminant does not match value.",
11905 )
11906 }
11907 }
11908 ConstantData::Int8Data => {
11909 if let Some(x) = self.data_as_int_8_data() {
11910 ds.field("data", &x)
11911 } else {
11912 ds.field(
11913 "data",
11914 &"InvalidFlatbuffer: Union discriminant does not match value.",
11915 )
11916 }
11917 }
11918 ConstantData::UInt8Data => {
11919 if let Some(x) = self.data_as_uint_8_data() {
11920 ds.field("data", &x)
11921 } else {
11922 ds.field(
11923 "data",
11924 &"InvalidFlatbuffer: Union discriminant does not match value.",
11925 )
11926 }
11927 }
11928 _ => {
11929 let x: Option<()> = None;
11930 ds.field("data", &x)
11931 }
11932 };
11933 ds.field("dtype", &self.dtype());
11934 ds.field("data_offset", &self.data_offset());
11935 ds.finish()
11936 }
11937}
11938pub enum DimOffset {}
11939#[derive(Copy, Clone, PartialEq)]
11940
11941pub struct Dim<'a> {
11942 pub _tab: flatbuffers::Table<'a>,
11943}
11944
11945impl<'a> flatbuffers::Follow<'a> for Dim<'a> {
11946 type Inner = Dim<'a>;
11947 #[inline]
11948 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
11949 Self {
11950 _tab: flatbuffers::Table::new(buf, loc),
11951 }
11952 }
11953}
11954
11955impl<'a> Dim<'a> {
11956 pub const VT_VALUE: flatbuffers::VOffsetT = 4;
11957 pub const VT_NAME: flatbuffers::VOffsetT = 6;
11958
11959 #[inline]
11960 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
11961 Dim { _tab: table }
11962 }
11963 #[allow(unused_mut)]
11964 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
11965 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
11966 args: &'args DimArgs<'args>,
11967 ) -> flatbuffers::WIPOffset<Dim<'bldr>> {
11968 let mut builder = DimBuilder::new(_fbb);
11969 if let Some(x) = args.name {
11970 builder.add_name(x);
11971 }
11972 builder.add_value(args.value);
11973 builder.finish()
11974 }
11975
11976 #[inline]
11977 pub fn value(&self) -> u32 {
11978 unsafe { self._tab.get::<u32>(Dim::VT_VALUE, Some(0)).unwrap() }
11982 }
11983 #[inline]
11984 pub fn name(&self) -> Option<&'a str> {
11985 unsafe {
11989 self._tab
11990 .get::<flatbuffers::ForwardsUOffset<&str>>(Dim::VT_NAME, None)
11991 }
11992 }
11993}
11994
11995impl flatbuffers::Verifiable for Dim<'_> {
11996 #[inline]
11997 fn run_verifier(
11998 v: &mut flatbuffers::Verifier,
11999 pos: usize,
12000 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
12001 use self::flatbuffers::Verifiable;
12002 v.visit_table(pos)?
12003 .visit_field::<u32>("value", Self::VT_VALUE, false)?
12004 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
12005 .finish();
12006 Ok(())
12007 }
12008}
12009pub struct DimArgs<'a> {
12010 pub value: u32,
12011 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
12012}
12013impl<'a> Default for DimArgs<'a> {
12014 #[inline]
12015 fn default() -> Self {
12016 DimArgs {
12017 value: 0,
12018 name: None,
12019 }
12020 }
12021}
12022
12023pub struct DimBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
12024 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
12025 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
12026}
12027impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> DimBuilder<'a, 'b, A> {
12028 #[inline]
12029 pub fn add_value(&mut self, value: u32) {
12030 self.fbb_.push_slot::<u32>(Dim::VT_VALUE, value, 0);
12031 }
12032 #[inline]
12033 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
12034 self.fbb_
12035 .push_slot_always::<flatbuffers::WIPOffset<_>>(Dim::VT_NAME, name);
12036 }
12037 #[inline]
12038 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> DimBuilder<'a, 'b, A> {
12039 let start = _fbb.start_table();
12040 DimBuilder {
12041 fbb_: _fbb,
12042 start_: start,
12043 }
12044 }
12045 #[inline]
12046 pub fn finish(self) -> flatbuffers::WIPOffset<Dim<'a>> {
12047 let o = self.fbb_.end_table(self.start_);
12048 flatbuffers::WIPOffset::new(o.value())
12049 }
12050}
12051
12052impl core::fmt::Debug for Dim<'_> {
12053 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12054 let mut ds = f.debug_struct("Dim");
12055 ds.field("value", &self.value());
12056 ds.field("name", &self.name());
12057 ds.finish()
12058 }
12059}
12060pub enum ValueNodeOffset {}
12061#[derive(Copy, Clone, PartialEq)]
12062
12063pub struct ValueNode<'a> {
12064 pub _tab: flatbuffers::Table<'a>,
12065}
12066
12067impl<'a> flatbuffers::Follow<'a> for ValueNode<'a> {
12068 type Inner = ValueNode<'a>;
12069 #[inline]
12070 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
12071 Self {
12072 _tab: flatbuffers::Table::new(buf, loc),
12073 }
12074 }
12075}
12076
12077impl<'a> ValueNode<'a> {
12078 pub const VT_SHAPE: flatbuffers::VOffsetT = 4;
12079 pub const VT_DTYPE: flatbuffers::VOffsetT = 6;
12080
12081 #[inline]
12082 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
12083 ValueNode { _tab: table }
12084 }
12085 #[allow(unused_mut)]
12086 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
12087 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
12088 args: &'args ValueNodeArgs<'args>,
12089 ) -> flatbuffers::WIPOffset<ValueNode<'bldr>> {
12090 let mut builder = ValueNodeBuilder::new(_fbb);
12091 if let Some(x) = args.shape {
12092 builder.add_shape(x);
12093 }
12094 if let Some(x) = args.dtype {
12095 builder.add_dtype(x);
12096 }
12097 builder.finish()
12098 }
12099
12100 #[inline]
12101 pub fn shape(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Dim<'a>>>> {
12102 unsafe {
12106 self._tab.get::<flatbuffers::ForwardsUOffset<
12107 flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Dim>>,
12108 >>(ValueNode::VT_SHAPE, None)
12109 }
12110 }
12111 #[inline]
12112 pub fn dtype(&self) -> Option<DataType> {
12113 unsafe { self._tab.get::<DataType>(ValueNode::VT_DTYPE, None) }
12117 }
12118}
12119
12120impl flatbuffers::Verifiable for ValueNode<'_> {
12121 #[inline]
12122 fn run_verifier(
12123 v: &mut flatbuffers::Verifier,
12124 pos: usize,
12125 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
12126 use self::flatbuffers::Verifiable;
12127 v.visit_table(pos)?
12128 .visit_field::<flatbuffers::ForwardsUOffset<
12129 flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Dim>>,
12130 >>("shape", Self::VT_SHAPE, false)?
12131 .visit_field::<DataType>("dtype", Self::VT_DTYPE, false)?
12132 .finish();
12133 Ok(())
12134 }
12135}
12136pub struct ValueNodeArgs<'a> {
12137 pub shape: Option<
12138 flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Dim<'a>>>>,
12139 >,
12140 pub dtype: Option<DataType>,
12141}
12142impl<'a> Default for ValueNodeArgs<'a> {
12143 #[inline]
12144 fn default() -> Self {
12145 ValueNodeArgs {
12146 shape: None,
12147 dtype: None,
12148 }
12149 }
12150}
12151
12152pub struct ValueNodeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
12153 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
12154 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
12155}
12156impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ValueNodeBuilder<'a, 'b, A> {
12157 #[inline]
12158 pub fn add_shape(
12159 &mut self,
12160 shape: flatbuffers::WIPOffset<
12161 flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<Dim<'b>>>,
12162 >,
12163 ) {
12164 self.fbb_
12165 .push_slot_always::<flatbuffers::WIPOffset<_>>(ValueNode::VT_SHAPE, shape);
12166 }
12167 #[inline]
12168 pub fn add_dtype(&mut self, dtype: DataType) {
12169 self.fbb_
12170 .push_slot_always::<DataType>(ValueNode::VT_DTYPE, dtype);
12171 }
12172 #[inline]
12173 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ValueNodeBuilder<'a, 'b, A> {
12174 let start = _fbb.start_table();
12175 ValueNodeBuilder {
12176 fbb_: _fbb,
12177 start_: start,
12178 }
12179 }
12180 #[inline]
12181 pub fn finish(self) -> flatbuffers::WIPOffset<ValueNode<'a>> {
12182 let o = self.fbb_.end_table(self.start_);
12183 flatbuffers::WIPOffset::new(o.value())
12184 }
12185}
12186
12187impl core::fmt::Debug for ValueNode<'_> {
12188 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12189 let mut ds = f.debug_struct("ValueNode");
12190 ds.field("shape", &self.shape());
12191 ds.field("dtype", &self.dtype());
12192 ds.finish()
12193 }
12194}
12195pub enum NodeOffset {}
12196#[derive(Copy, Clone, PartialEq)]
12197
12198pub struct Node<'a> {
12199 pub _tab: flatbuffers::Table<'a>,
12200}
12201
12202impl<'a> flatbuffers::Follow<'a> for Node<'a> {
12203 type Inner = Node<'a>;
12204 #[inline]
12205 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
12206 Self {
12207 _tab: flatbuffers::Table::new(buf, loc),
12208 }
12209 }
12210}
12211
12212impl<'a> Node<'a> {
12213 pub const VT_NAME: flatbuffers::VOffsetT = 4;
12214 pub const VT_DATA_TYPE: flatbuffers::VOffsetT = 6;
12215 pub const VT_DATA: flatbuffers::VOffsetT = 8;
12216
12217 #[inline]
12218 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
12219 Node { _tab: table }
12220 }
12221 #[allow(unused_mut)]
12222 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
12223 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
12224 args: &'args NodeArgs<'args>,
12225 ) -> flatbuffers::WIPOffset<Node<'bldr>> {
12226 let mut builder = NodeBuilder::new(_fbb);
12227 if let Some(x) = args.data {
12228 builder.add_data(x);
12229 }
12230 if let Some(x) = args.name {
12231 builder.add_name(x);
12232 }
12233 builder.add_data_type(args.data_type);
12234 builder.finish()
12235 }
12236
12237 #[inline]
12238 pub fn name(&self) -> Option<&'a str> {
12239 unsafe {
12243 self._tab
12244 .get::<flatbuffers::ForwardsUOffset<&str>>(Node::VT_NAME, None)
12245 }
12246 }
12247 #[inline]
12248 pub fn data_type(&self) -> NodeKind {
12249 unsafe {
12253 self._tab
12254 .get::<NodeKind>(Node::VT_DATA_TYPE, Some(NodeKind::NONE))
12255 .unwrap()
12256 }
12257 }
12258 #[inline]
12259 pub fn data(&self) -> Option<flatbuffers::Table<'a>> {
12260 unsafe {
12264 self._tab
12265 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Node::VT_DATA, None)
12266 }
12267 }
12268 #[inline]
12269 #[allow(non_snake_case)]
12270 pub fn data_as_operator_node(&self) -> Option<OperatorNode<'a>> {
12271 if self.data_type() == NodeKind::OperatorNode {
12272 self.data().map(|t| {
12273 unsafe { OperatorNode::init_from_table(t) }
12277 })
12278 } else {
12279 None
12280 }
12281 }
12282
12283 #[inline]
12284 #[allow(non_snake_case)]
12285 pub fn data_as_constant_node(&self) -> Option<ConstantNode<'a>> {
12286 if self.data_type() == NodeKind::ConstantNode {
12287 self.data().map(|t| {
12288 unsafe { ConstantNode::init_from_table(t) }
12292 })
12293 } else {
12294 None
12295 }
12296 }
12297
12298 #[inline]
12299 #[allow(non_snake_case)]
12300 pub fn data_as_value_node(&self) -> Option<ValueNode<'a>> {
12301 if self.data_type() == NodeKind::ValueNode {
12302 self.data().map(|t| {
12303 unsafe { ValueNode::init_from_table(t) }
12307 })
12308 } else {
12309 None
12310 }
12311 }
12312}
12313
12314impl flatbuffers::Verifiable for Node<'_> {
12315 #[inline]
12316 fn run_verifier(
12317 v: &mut flatbuffers::Verifier,
12318 pos: usize,
12319 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
12320 use self::flatbuffers::Verifiable;
12321 v.visit_table(pos)?
12322 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
12323 .visit_union::<NodeKind, _>(
12324 "data_type",
12325 Self::VT_DATA_TYPE,
12326 "data",
12327 Self::VT_DATA,
12328 false,
12329 |key, v, pos| match key {
12330 NodeKind::OperatorNode => v
12331 .verify_union_variant::<flatbuffers::ForwardsUOffset<OperatorNode>>(
12332 "NodeKind::OperatorNode",
12333 pos,
12334 ),
12335 NodeKind::ConstantNode => v
12336 .verify_union_variant::<flatbuffers::ForwardsUOffset<ConstantNode>>(
12337 "NodeKind::ConstantNode",
12338 pos,
12339 ),
12340 NodeKind::ValueNode => v
12341 .verify_union_variant::<flatbuffers::ForwardsUOffset<ValueNode>>(
12342 "NodeKind::ValueNode",
12343 pos,
12344 ),
12345 _ => Ok(()),
12346 },
12347 )?
12348 .finish();
12349 Ok(())
12350 }
12351}
12352pub struct NodeArgs<'a> {
12353 pub name: Option<flatbuffers::WIPOffset<&'a str>>,
12354 pub data_type: NodeKind,
12355 pub data: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
12356}
12357impl<'a> Default for NodeArgs<'a> {
12358 #[inline]
12359 fn default() -> Self {
12360 NodeArgs {
12361 name: None,
12362 data_type: NodeKind::NONE,
12363 data: None,
12364 }
12365 }
12366}
12367
12368pub struct NodeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
12369 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
12370 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
12371}
12372impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> NodeBuilder<'a, 'b, A> {
12373 #[inline]
12374 pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
12375 self.fbb_
12376 .push_slot_always::<flatbuffers::WIPOffset<_>>(Node::VT_NAME, name);
12377 }
12378 #[inline]
12379 pub fn add_data_type(&mut self, data_type: NodeKind) {
12380 self.fbb_
12381 .push_slot::<NodeKind>(Node::VT_DATA_TYPE, data_type, NodeKind::NONE);
12382 }
12383 #[inline]
12384 pub fn add_data(&mut self, data: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
12385 self.fbb_
12386 .push_slot_always::<flatbuffers::WIPOffset<_>>(Node::VT_DATA, data);
12387 }
12388 #[inline]
12389 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> NodeBuilder<'a, 'b, A> {
12390 let start = _fbb.start_table();
12391 NodeBuilder {
12392 fbb_: _fbb,
12393 start_: start,
12394 }
12395 }
12396 #[inline]
12397 pub fn finish(self) -> flatbuffers::WIPOffset<Node<'a>> {
12398 let o = self.fbb_.end_table(self.start_);
12399 flatbuffers::WIPOffset::new(o.value())
12400 }
12401}
12402
12403impl core::fmt::Debug for Node<'_> {
12404 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12405 let mut ds = f.debug_struct("Node");
12406 ds.field("name", &self.name());
12407 ds.field("data_type", &self.data_type());
12408 match self.data_type() {
12409 NodeKind::OperatorNode => {
12410 if let Some(x) = self.data_as_operator_node() {
12411 ds.field("data", &x)
12412 } else {
12413 ds.field(
12414 "data",
12415 &"InvalidFlatbuffer: Union discriminant does not match value.",
12416 )
12417 }
12418 }
12419 NodeKind::ConstantNode => {
12420 if let Some(x) = self.data_as_constant_node() {
12421 ds.field("data", &x)
12422 } else {
12423 ds.field(
12424 "data",
12425 &"InvalidFlatbuffer: Union discriminant does not match value.",
12426 )
12427 }
12428 }
12429 NodeKind::ValueNode => {
12430 if let Some(x) = self.data_as_value_node() {
12431 ds.field("data", &x)
12432 } else {
12433 ds.field(
12434 "data",
12435 &"InvalidFlatbuffer: Union discriminant does not match value.",
12436 )
12437 }
12438 }
12439 _ => {
12440 let x: Option<()> = None;
12441 ds.field("data", &x)
12442 }
12443 };
12444 ds.finish()
12445 }
12446}
12447pub enum GraphOffset {}
12448#[derive(Copy, Clone, PartialEq)]
12449
12450pub struct Graph<'a> {
12451 pub _tab: flatbuffers::Table<'a>,
12452}
12453
12454impl<'a> flatbuffers::Follow<'a> for Graph<'a> {
12455 type Inner = Graph<'a>;
12456 #[inline]
12457 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
12458 Self {
12459 _tab: flatbuffers::Table::new(buf, loc),
12460 }
12461 }
12462}
12463
12464impl<'a> Graph<'a> {
12465 pub const VT_NODES: flatbuffers::VOffsetT = 4;
12466 pub const VT_INPUTS: flatbuffers::VOffsetT = 6;
12467 pub const VT_OUTPUTS: flatbuffers::VOffsetT = 8;
12468 pub const VT_CAPTURES: flatbuffers::VOffsetT = 10;
12469
12470 #[inline]
12471 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
12472 Graph { _tab: table }
12473 }
12474 #[allow(unused_mut)]
12475 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
12476 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
12477 args: &'args GraphArgs<'args>,
12478 ) -> flatbuffers::WIPOffset<Graph<'bldr>> {
12479 let mut builder = GraphBuilder::new(_fbb);
12480 if let Some(x) = args.captures {
12481 builder.add_captures(x);
12482 }
12483 if let Some(x) = args.outputs {
12484 builder.add_outputs(x);
12485 }
12486 if let Some(x) = args.inputs {
12487 builder.add_inputs(x);
12488 }
12489 if let Some(x) = args.nodes {
12490 builder.add_nodes(x);
12491 }
12492 builder.finish()
12493 }
12494
12495 #[inline]
12496 pub fn nodes(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Node<'a>>>> {
12497 unsafe {
12501 self._tab.get::<flatbuffers::ForwardsUOffset<
12502 flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Node>>,
12503 >>(Graph::VT_NODES, None)
12504 }
12505 }
12506 #[inline]
12507 pub fn inputs(&self) -> Option<flatbuffers::Vector<'a, u32>> {
12508 unsafe {
12512 self._tab
12513 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
12514 Graph::VT_INPUTS,
12515 None,
12516 )
12517 }
12518 }
12519 #[inline]
12520 pub fn outputs(&self) -> Option<flatbuffers::Vector<'a, u32>> {
12521 unsafe {
12525 self._tab
12526 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
12527 Graph::VT_OUTPUTS,
12528 None,
12529 )
12530 }
12531 }
12532 #[inline]
12533 pub fn captures(&self) -> Option<flatbuffers::Vector<'a, u32>> {
12534 unsafe {
12538 self._tab
12539 .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u32>>>(
12540 Graph::VT_CAPTURES,
12541 None,
12542 )
12543 }
12544 }
12545}
12546
12547impl flatbuffers::Verifiable for Graph<'_> {
12548 #[inline]
12549 fn run_verifier(
12550 v: &mut flatbuffers::Verifier,
12551 pos: usize,
12552 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
12553 use self::flatbuffers::Verifiable;
12554 v.visit_table(pos)?
12555 .visit_field::<flatbuffers::ForwardsUOffset<
12556 flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Node>>,
12557 >>("nodes", Self::VT_NODES, false)?
12558 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
12559 "inputs",
12560 Self::VT_INPUTS,
12561 false,
12562 )?
12563 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
12564 "outputs",
12565 Self::VT_OUTPUTS,
12566 false,
12567 )?
12568 .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u32>>>(
12569 "captures",
12570 Self::VT_CAPTURES,
12571 false,
12572 )?
12573 .finish();
12574 Ok(())
12575 }
12576}
12577pub struct GraphArgs<'a> {
12578 pub nodes: Option<
12579 flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Node<'a>>>>,
12580 >,
12581 pub inputs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
12582 pub outputs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
12583 pub captures: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u32>>>,
12584}
12585impl<'a> Default for GraphArgs<'a> {
12586 #[inline]
12587 fn default() -> Self {
12588 GraphArgs {
12589 nodes: None,
12590 inputs: None,
12591 outputs: None,
12592 captures: None,
12593 }
12594 }
12595}
12596
12597pub struct GraphBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
12598 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
12599 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
12600}
12601impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> GraphBuilder<'a, 'b, A> {
12602 #[inline]
12603 pub fn add_nodes(
12604 &mut self,
12605 nodes: flatbuffers::WIPOffset<
12606 flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<Node<'b>>>,
12607 >,
12608 ) {
12609 self.fbb_
12610 .push_slot_always::<flatbuffers::WIPOffset<_>>(Graph::VT_NODES, nodes);
12611 }
12612 #[inline]
12613 pub fn add_inputs(&mut self, inputs: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
12614 self.fbb_
12615 .push_slot_always::<flatbuffers::WIPOffset<_>>(Graph::VT_INPUTS, inputs);
12616 }
12617 #[inline]
12618 pub fn add_outputs(&mut self, outputs: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
12619 self.fbb_
12620 .push_slot_always::<flatbuffers::WIPOffset<_>>(Graph::VT_OUTPUTS, outputs);
12621 }
12622 #[inline]
12623 pub fn add_captures(&mut self, captures: flatbuffers::WIPOffset<flatbuffers::Vector<'b, u32>>) {
12624 self.fbb_
12625 .push_slot_always::<flatbuffers::WIPOffset<_>>(Graph::VT_CAPTURES, captures);
12626 }
12627 #[inline]
12628 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> GraphBuilder<'a, 'b, A> {
12629 let start = _fbb.start_table();
12630 GraphBuilder {
12631 fbb_: _fbb,
12632 start_: start,
12633 }
12634 }
12635 #[inline]
12636 pub fn finish(self) -> flatbuffers::WIPOffset<Graph<'a>> {
12637 let o = self.fbb_.end_table(self.start_);
12638 flatbuffers::WIPOffset::new(o.value())
12639 }
12640}
12641
12642impl core::fmt::Debug for Graph<'_> {
12643 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12644 let mut ds = f.debug_struct("Graph");
12645 ds.field("nodes", &self.nodes());
12646 ds.field("inputs", &self.inputs());
12647 ds.field("outputs", &self.outputs());
12648 ds.field("captures", &self.captures());
12649 ds.finish()
12650 }
12651}
12652pub enum MetadataOffset {}
12653#[derive(Copy, Clone, PartialEq)]
12654
12655pub struct Metadata<'a> {
12656 pub _tab: flatbuffers::Table<'a>,
12657}
12658
12659impl<'a> flatbuffers::Follow<'a> for Metadata<'a> {
12660 type Inner = Metadata<'a>;
12661 #[inline]
12662 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
12663 Self {
12664 _tab: flatbuffers::Table::new(buf, loc),
12665 }
12666 }
12667}
12668
12669impl<'a> Metadata<'a> {
12670 pub const VT_ONNX_HASH: flatbuffers::VOffsetT = 4;
12671 pub const VT_DESCRIPTION: flatbuffers::VOffsetT = 6;
12672 pub const VT_LICENSE: flatbuffers::VOffsetT = 8;
12673 pub const VT_COMMIT: flatbuffers::VOffsetT = 10;
12674 pub const VT_CODE_REPOSITORY: flatbuffers::VOffsetT = 12;
12675 pub const VT_MODEL_REPOSITORY: flatbuffers::VOffsetT = 14;
12676 pub const VT_RUN_ID: flatbuffers::VOffsetT = 16;
12677 pub const VT_RUN_URL: flatbuffers::VOffsetT = 18;
12678
12679 #[inline]
12680 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
12681 Metadata { _tab: table }
12682 }
12683 #[allow(unused_mut)]
12684 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
12685 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
12686 args: &'args MetadataArgs<'args>,
12687 ) -> flatbuffers::WIPOffset<Metadata<'bldr>> {
12688 let mut builder = MetadataBuilder::new(_fbb);
12689 if let Some(x) = args.run_url {
12690 builder.add_run_url(x);
12691 }
12692 if let Some(x) = args.run_id {
12693 builder.add_run_id(x);
12694 }
12695 if let Some(x) = args.model_repository {
12696 builder.add_model_repository(x);
12697 }
12698 if let Some(x) = args.code_repository {
12699 builder.add_code_repository(x);
12700 }
12701 if let Some(x) = args.commit {
12702 builder.add_commit(x);
12703 }
12704 if let Some(x) = args.license {
12705 builder.add_license(x);
12706 }
12707 if let Some(x) = args.description {
12708 builder.add_description(x);
12709 }
12710 if let Some(x) = args.onnx_hash {
12711 builder.add_onnx_hash(x);
12712 }
12713 builder.finish()
12714 }
12715
12716 #[inline]
12717 pub fn onnx_hash(&self) -> Option<&'a str> {
12718 unsafe {
12722 self._tab
12723 .get::<flatbuffers::ForwardsUOffset<&str>>(Metadata::VT_ONNX_HASH, None)
12724 }
12725 }
12726 #[inline]
12727 pub fn description(&self) -> Option<&'a str> {
12728 unsafe {
12732 self._tab
12733 .get::<flatbuffers::ForwardsUOffset<&str>>(Metadata::VT_DESCRIPTION, None)
12734 }
12735 }
12736 #[inline]
12737 pub fn license(&self) -> Option<&'a str> {
12738 unsafe {
12742 self._tab
12743 .get::<flatbuffers::ForwardsUOffset<&str>>(Metadata::VT_LICENSE, None)
12744 }
12745 }
12746 #[inline]
12747 pub fn commit(&self) -> Option<&'a str> {
12748 unsafe {
12752 self._tab
12753 .get::<flatbuffers::ForwardsUOffset<&str>>(Metadata::VT_COMMIT, None)
12754 }
12755 }
12756 #[inline]
12757 pub fn code_repository(&self) -> Option<&'a str> {
12758 unsafe {
12762 self._tab
12763 .get::<flatbuffers::ForwardsUOffset<&str>>(Metadata::VT_CODE_REPOSITORY, None)
12764 }
12765 }
12766 #[inline]
12767 pub fn model_repository(&self) -> Option<&'a str> {
12768 unsafe {
12772 self._tab
12773 .get::<flatbuffers::ForwardsUOffset<&str>>(Metadata::VT_MODEL_REPOSITORY, None)
12774 }
12775 }
12776 #[inline]
12777 pub fn run_id(&self) -> Option<&'a str> {
12778 unsafe {
12782 self._tab
12783 .get::<flatbuffers::ForwardsUOffset<&str>>(Metadata::VT_RUN_ID, None)
12784 }
12785 }
12786 #[inline]
12787 pub fn run_url(&self) -> Option<&'a str> {
12788 unsafe {
12792 self._tab
12793 .get::<flatbuffers::ForwardsUOffset<&str>>(Metadata::VT_RUN_URL, None)
12794 }
12795 }
12796}
12797
12798impl flatbuffers::Verifiable for Metadata<'_> {
12799 #[inline]
12800 fn run_verifier(
12801 v: &mut flatbuffers::Verifier,
12802 pos: usize,
12803 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
12804 use self::flatbuffers::Verifiable;
12805 v.visit_table(pos)?
12806 .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
12807 "onnx_hash",
12808 Self::VT_ONNX_HASH,
12809 false,
12810 )?
12811 .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
12812 "description",
12813 Self::VT_DESCRIPTION,
12814 false,
12815 )?
12816 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("license", Self::VT_LICENSE, false)?
12817 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("commit", Self::VT_COMMIT, false)?
12818 .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
12819 "code_repository",
12820 Self::VT_CODE_REPOSITORY,
12821 false,
12822 )?
12823 .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
12824 "model_repository",
12825 Self::VT_MODEL_REPOSITORY,
12826 false,
12827 )?
12828 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("run_id", Self::VT_RUN_ID, false)?
12829 .visit_field::<flatbuffers::ForwardsUOffset<&str>>("run_url", Self::VT_RUN_URL, false)?
12830 .finish();
12831 Ok(())
12832 }
12833}
12834pub struct MetadataArgs<'a> {
12835 pub onnx_hash: Option<flatbuffers::WIPOffset<&'a str>>,
12836 pub description: Option<flatbuffers::WIPOffset<&'a str>>,
12837 pub license: Option<flatbuffers::WIPOffset<&'a str>>,
12838 pub commit: Option<flatbuffers::WIPOffset<&'a str>>,
12839 pub code_repository: Option<flatbuffers::WIPOffset<&'a str>>,
12840 pub model_repository: Option<flatbuffers::WIPOffset<&'a str>>,
12841 pub run_id: Option<flatbuffers::WIPOffset<&'a str>>,
12842 pub run_url: Option<flatbuffers::WIPOffset<&'a str>>,
12843}
12844impl<'a> Default for MetadataArgs<'a> {
12845 #[inline]
12846 fn default() -> Self {
12847 MetadataArgs {
12848 onnx_hash: None,
12849 description: None,
12850 license: None,
12851 commit: None,
12852 code_repository: None,
12853 model_repository: None,
12854 run_id: None,
12855 run_url: None,
12856 }
12857 }
12858}
12859
12860pub struct MetadataBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
12861 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
12862 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
12863}
12864impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> MetadataBuilder<'a, 'b, A> {
12865 #[inline]
12866 pub fn add_onnx_hash(&mut self, onnx_hash: flatbuffers::WIPOffset<&'b str>) {
12867 self.fbb_
12868 .push_slot_always::<flatbuffers::WIPOffset<_>>(Metadata::VT_ONNX_HASH, onnx_hash);
12869 }
12870 #[inline]
12871 pub fn add_description(&mut self, description: flatbuffers::WIPOffset<&'b str>) {
12872 self.fbb_
12873 .push_slot_always::<flatbuffers::WIPOffset<_>>(Metadata::VT_DESCRIPTION, description);
12874 }
12875 #[inline]
12876 pub fn add_license(&mut self, license: flatbuffers::WIPOffset<&'b str>) {
12877 self.fbb_
12878 .push_slot_always::<flatbuffers::WIPOffset<_>>(Metadata::VT_LICENSE, license);
12879 }
12880 #[inline]
12881 pub fn add_commit(&mut self, commit: flatbuffers::WIPOffset<&'b str>) {
12882 self.fbb_
12883 .push_slot_always::<flatbuffers::WIPOffset<_>>(Metadata::VT_COMMIT, commit);
12884 }
12885 #[inline]
12886 pub fn add_code_repository(&mut self, code_repository: flatbuffers::WIPOffset<&'b str>) {
12887 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
12888 Metadata::VT_CODE_REPOSITORY,
12889 code_repository,
12890 );
12891 }
12892 #[inline]
12893 pub fn add_model_repository(&mut self, model_repository: flatbuffers::WIPOffset<&'b str>) {
12894 self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
12895 Metadata::VT_MODEL_REPOSITORY,
12896 model_repository,
12897 );
12898 }
12899 #[inline]
12900 pub fn add_run_id(&mut self, run_id: flatbuffers::WIPOffset<&'b str>) {
12901 self.fbb_
12902 .push_slot_always::<flatbuffers::WIPOffset<_>>(Metadata::VT_RUN_ID, run_id);
12903 }
12904 #[inline]
12905 pub fn add_run_url(&mut self, run_url: flatbuffers::WIPOffset<&'b str>) {
12906 self.fbb_
12907 .push_slot_always::<flatbuffers::WIPOffset<_>>(Metadata::VT_RUN_URL, run_url);
12908 }
12909 #[inline]
12910 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> MetadataBuilder<'a, 'b, A> {
12911 let start = _fbb.start_table();
12912 MetadataBuilder {
12913 fbb_: _fbb,
12914 start_: start,
12915 }
12916 }
12917 #[inline]
12918 pub fn finish(self) -> flatbuffers::WIPOffset<Metadata<'a>> {
12919 let o = self.fbb_.end_table(self.start_);
12920 flatbuffers::WIPOffset::new(o.value())
12921 }
12922}
12923
12924impl core::fmt::Debug for Metadata<'_> {
12925 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
12926 let mut ds = f.debug_struct("Metadata");
12927 ds.field("onnx_hash", &self.onnx_hash());
12928 ds.field("description", &self.description());
12929 ds.field("license", &self.license());
12930 ds.field("commit", &self.commit());
12931 ds.field("code_repository", &self.code_repository());
12932 ds.field("model_repository", &self.model_repository());
12933 ds.field("run_id", &self.run_id());
12934 ds.field("run_url", &self.run_url());
12935 ds.finish()
12936 }
12937}
12938pub enum ModelOffset {}
12939#[derive(Copy, Clone, PartialEq)]
12940
12941pub struct Model<'a> {
12942 pub _tab: flatbuffers::Table<'a>,
12943}
12944
12945impl<'a> flatbuffers::Follow<'a> for Model<'a> {
12946 type Inner = Model<'a>;
12947 #[inline]
12948 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
12949 Self {
12950 _tab: flatbuffers::Table::new(buf, loc),
12951 }
12952 }
12953}
12954
12955impl<'a> Model<'a> {
12956 pub const VT_SCHEMA_VERSION: flatbuffers::VOffsetT = 4;
12957 pub const VT_GRAPH: flatbuffers::VOffsetT = 6;
12958 pub const VT_METADATA: flatbuffers::VOffsetT = 8;
12959
12960 #[inline]
12961 pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
12962 Model { _tab: table }
12963 }
12964 #[allow(unused_mut)]
12965 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
12966 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
12967 args: &'args ModelArgs<'args>,
12968 ) -> flatbuffers::WIPOffset<Model<'bldr>> {
12969 let mut builder = ModelBuilder::new(_fbb);
12970 if let Some(x) = args.metadata {
12971 builder.add_metadata(x);
12972 }
12973 if let Some(x) = args.graph {
12974 builder.add_graph(x);
12975 }
12976 builder.add_schema_version(args.schema_version);
12977 builder.finish()
12978 }
12979
12980 #[inline]
12981 pub fn schema_version(&self) -> i32 {
12982 unsafe {
12986 self._tab
12987 .get::<i32>(Model::VT_SCHEMA_VERSION, Some(0))
12988 .unwrap()
12989 }
12990 }
12991 #[inline]
12992 pub fn graph(&self) -> Graph<'a> {
12993 unsafe {
12997 self._tab
12998 .get::<flatbuffers::ForwardsUOffset<Graph>>(Model::VT_GRAPH, None)
12999 .unwrap()
13000 }
13001 }
13002 #[inline]
13003 pub fn metadata(&self) -> Option<Metadata<'a>> {
13004 unsafe {
13008 self._tab
13009 .get::<flatbuffers::ForwardsUOffset<Metadata>>(Model::VT_METADATA, None)
13010 }
13011 }
13012}
13013
13014impl flatbuffers::Verifiable for Model<'_> {
13015 #[inline]
13016 fn run_verifier(
13017 v: &mut flatbuffers::Verifier,
13018 pos: usize,
13019 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
13020 use self::flatbuffers::Verifiable;
13021 v.visit_table(pos)?
13022 .visit_field::<i32>("schema_version", Self::VT_SCHEMA_VERSION, false)?
13023 .visit_field::<flatbuffers::ForwardsUOffset<Graph>>("graph", Self::VT_GRAPH, true)?
13024 .visit_field::<flatbuffers::ForwardsUOffset<Metadata>>(
13025 "metadata",
13026 Self::VT_METADATA,
13027 false,
13028 )?
13029 .finish();
13030 Ok(())
13031 }
13032}
13033pub struct ModelArgs<'a> {
13034 pub schema_version: i32,
13035 pub graph: Option<flatbuffers::WIPOffset<Graph<'a>>>,
13036 pub metadata: Option<flatbuffers::WIPOffset<Metadata<'a>>>,
13037}
13038impl<'a> Default for ModelArgs<'a> {
13039 #[inline]
13040 fn default() -> Self {
13041 ModelArgs {
13042 schema_version: 0,
13043 graph: None, metadata: None,
13045 }
13046 }
13047}
13048
13049pub struct ModelBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
13050 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
13051 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
13052}
13053impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ModelBuilder<'a, 'b, A> {
13054 #[inline]
13055 pub fn add_schema_version(&mut self, schema_version: i32) {
13056 self.fbb_
13057 .push_slot::<i32>(Model::VT_SCHEMA_VERSION, schema_version, 0);
13058 }
13059 #[inline]
13060 pub fn add_graph(&mut self, graph: flatbuffers::WIPOffset<Graph<'b>>) {
13061 self.fbb_
13062 .push_slot_always::<flatbuffers::WIPOffset<Graph>>(Model::VT_GRAPH, graph);
13063 }
13064 #[inline]
13065 pub fn add_metadata(&mut self, metadata: flatbuffers::WIPOffset<Metadata<'b>>) {
13066 self.fbb_
13067 .push_slot_always::<flatbuffers::WIPOffset<Metadata>>(Model::VT_METADATA, metadata);
13068 }
13069 #[inline]
13070 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ModelBuilder<'a, 'b, A> {
13071 let start = _fbb.start_table();
13072 ModelBuilder {
13073 fbb_: _fbb,
13074 start_: start,
13075 }
13076 }
13077 #[inline]
13078 pub fn finish(self) -> flatbuffers::WIPOffset<Model<'a>> {
13079 let o = self.fbb_.end_table(self.start_);
13080 self.fbb_.required(o, Model::VT_GRAPH, "graph");
13081 flatbuffers::WIPOffset::new(o.value())
13082 }
13083}
13084
13085impl core::fmt::Debug for Model<'_> {
13086 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
13087 let mut ds = f.debug_struct("Model");
13088 ds.field("schema_version", &self.schema_version());
13089 ds.field("graph", &self.graph());
13090 ds.field("metadata", &self.metadata());
13091 ds.finish()
13092 }
13093}
13094#[inline]
13095pub fn root_as_model(buf: &[u8]) -> Result<Model, flatbuffers::InvalidFlatbuffer> {
13102 flatbuffers::root::<Model>(buf)
13103}
13104#[inline]
13105pub fn size_prefixed_root_as_model(buf: &[u8]) -> Result<Model, flatbuffers::InvalidFlatbuffer> {
13112 flatbuffers::size_prefixed_root::<Model>(buf)
13113}
13114#[inline]
13115pub fn root_as_model_with_opts<'b, 'o>(
13122 opts: &'o flatbuffers::VerifierOptions,
13123 buf: &'b [u8],
13124) -> Result<Model<'b>, flatbuffers::InvalidFlatbuffer> {
13125 flatbuffers::root_with_opts::<Model<'b>>(opts, buf)
13126}
13127#[inline]
13128pub fn size_prefixed_root_as_model_with_opts<'b, 'o>(
13135 opts: &'o flatbuffers::VerifierOptions,
13136 buf: &'b [u8],
13137) -> Result<Model<'b>, flatbuffers::InvalidFlatbuffer> {
13138 flatbuffers::size_prefixed_root_with_opts::<Model<'b>>(opts, buf)
13139}
13140#[inline]
13141pub unsafe fn root_as_model_unchecked(buf: &[u8]) -> Model {
13145 flatbuffers::root_unchecked::<Model>(buf)
13146}
13147#[inline]
13148pub unsafe fn size_prefixed_root_as_model_unchecked(buf: &[u8]) -> Model {
13152 flatbuffers::size_prefixed_root_unchecked::<Model>(buf)
13153}
13154pub const MODEL_IDENTIFIER: &str = "RTEN";
13155
13156#[inline]
13157pub fn model_buffer_has_identifier(buf: &[u8]) -> bool {
13158 flatbuffers::buffer_has_identifier(buf, MODEL_IDENTIFIER, false)
13159}
13160
13161#[inline]
13162pub fn model_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
13163 flatbuffers::buffer_has_identifier(buf, MODEL_IDENTIFIER, true)
13164}
13165
13166pub const MODEL_EXTENSION: &str = "rten";
13167
13168#[inline]
13169pub fn finish_model_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
13170 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
13171 root: flatbuffers::WIPOffset<Model<'a>>,
13172) {
13173 fbb.finish(root, Some(MODEL_IDENTIFIER));
13174}
13175
13176#[inline]
13177pub fn finish_size_prefixed_model_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
13178 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
13179 root: flatbuffers::WIPOffset<Model<'a>>,
13180) {
13181 fbb.finish_size_prefixed(root, Some(MODEL_IDENTIFIER));
13182}