1 /*
2 * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 // Auto-generated from ONNX op schema
26
27 package oracle.code.onnx.ir;
28
29 import jdk.incubator.code.*;
30 import jdk.incubator.code.extern.ExternalizedOp;
31
32 import java.util.*;
33 import oracle.code.onnx.Tensor;
34
35 @SuppressWarnings({"OptionalUsedAsFieldOrParameterType", "unused", "SequencedCollectionMethodCanBeUsed"})
36 public final class OnnxOps extends ExplicitOnnxOps {
37
38 private OnnxOps() {}
39
40 @OpFactoryHelper.OpDeclaration(Abs.NAME)
41 public static final class Abs extends OnnxOp {
42 public static final String NAME = "Abs";
43
44 public enum Attribute implements OnnxAttribute.None { }
45
46 public enum TypeConstraint implements OnnxTypeConstraint {
47 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
48 ;
49
50 final OnnxType.TypeVariable typeVariable;
51
52 TypeConstraint(OnnxType.TypeVariable typeVariable) {
53 assert typeVariable.name().equals(name());
54 this.typeVariable = typeVariable;
55 }
56
57 @Override
58 public OnnxType.TypeVariable typeVariable() {
59 return typeVariable;
60 }
61 }
62
63 public enum InputParameter implements OnnxParameter {
64 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
65 ;
66
67 final OnnxType type;
68 final Quantifier quantifier;
69
70 InputParameter(OnnxType type, Quantifier quantifier) {
71 this.type = type;
72 this.quantifier = quantifier;
73 }
74
75 @Override
76 public OnnxType type() {
77 return type;
78 }
79
80 @Override
81 public Quantifier quantifier() {
82 return quantifier;
83 }
84 }
85
86 public enum OutputParameter implements OnnxParameter {
87 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
88 ;
89
90 final OnnxType type;
91 final Quantifier quantifier;
92
93 OutputParameter(OnnxType type, Quantifier quantifier) {
94 this.type = type;
95 this.quantifier = quantifier;
96 }
97
98 @Override
99 public OnnxType type() {
100 return type;
101 }
102
103 @Override
104 public Quantifier quantifier() {
105 return quantifier;
106 }
107 }
108
109 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
110 NAME,
111 List.of(Attribute.values()),
112 List.of(TypeConstraint.values()),
113 List.of(InputParameter.values()),
114 List.of(OutputParameter.values())
115 );
116
117 public Abs(ExternalizedOp def) {
118 super(SCHEMA, def);
119 }
120
121 Abs(Abs that, CodeContext cc) {
122 super(that, cc);
123 }
124
125 @Override
126 public Abs transform(CodeContext cc, CodeTransformer ot) {
127 return new Abs(this, cc);
128 }
129
130 Abs(TypeElement resultType, Value X) {
131 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
132 }
133
134 @Override
135 public SequencedSet<OnnxParameter> onnxOutputs() {
136 return onnxOutputs(SCHEMA);
137 }
138
139 @Override
140 public SequencedMap<OnnxParameter, Object> onnxInputs() {
141 return onnxInputs(SCHEMA, List.of(X()));
142 }
143
144 public Value X() {
145 return operands().get(0);
146 }
147
148 }
149
150 public static Abs Abs(TypeElement resultType, Value X) {
151 return new Abs(resultType, X);
152 }
153
154 @OpFactoryHelper.OpDeclaration(Acos.NAME)
155 public static final class Acos extends OnnxOp {
156 public static final String NAME = "Acos";
157
158 public enum Attribute implements OnnxAttribute.None { }
159
160 public enum TypeConstraint implements OnnxTypeConstraint {
161 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
162 ;
163
164 final OnnxType.TypeVariable typeVariable;
165
166 TypeConstraint(OnnxType.TypeVariable typeVariable) {
167 assert typeVariable.name().equals(name());
168 this.typeVariable = typeVariable;
169 }
170
171 @Override
172 public OnnxType.TypeVariable typeVariable() {
173 return typeVariable;
174 }
175 }
176
177 public enum InputParameter implements OnnxParameter {
178 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
179 ;
180
181 final OnnxType type;
182 final Quantifier quantifier;
183
184 InputParameter(OnnxType type, Quantifier quantifier) {
185 this.type = type;
186 this.quantifier = quantifier;
187 }
188
189 @Override
190 public OnnxType type() {
191 return type;
192 }
193
194 @Override
195 public Quantifier quantifier() {
196 return quantifier;
197 }
198 }
199
200 public enum OutputParameter implements OnnxParameter {
201 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
202 ;
203
204 final OnnxType type;
205 final Quantifier quantifier;
206
207 OutputParameter(OnnxType type, Quantifier quantifier) {
208 this.type = type;
209 this.quantifier = quantifier;
210 }
211
212 @Override
213 public OnnxType type() {
214 return type;
215 }
216
217 @Override
218 public Quantifier quantifier() {
219 return quantifier;
220 }
221 }
222
223 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
224 NAME,
225 List.of(Attribute.values()),
226 List.of(TypeConstraint.values()),
227 List.of(InputParameter.values()),
228 List.of(OutputParameter.values())
229 );
230
231 public Acos(ExternalizedOp def) {
232 super(SCHEMA, def);
233 }
234
235 Acos(Acos that, CodeContext cc) {
236 super(that, cc);
237 }
238
239 @Override
240 public Acos transform(CodeContext cc, CodeTransformer ot) {
241 return new Acos(this, cc);
242 }
243
244 Acos(TypeElement resultType, Value input) {
245 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
246 }
247
248 @Override
249 public SequencedSet<OnnxParameter> onnxOutputs() {
250 return onnxOutputs(SCHEMA);
251 }
252
253 @Override
254 public SequencedMap<OnnxParameter, Object> onnxInputs() {
255 return onnxInputs(SCHEMA, List.of(input()));
256 }
257
258 public Value input() {
259 return operands().get(0);
260 }
261
262 }
263
264 public static Acos Acos(TypeElement resultType, Value input) {
265 return new Acos(resultType, input);
266 }
267
268 @OpFactoryHelper.OpDeclaration(Acosh.NAME)
269 public static final class Acosh extends OnnxOp {
270 public static final String NAME = "Acosh";
271
272 public enum Attribute implements OnnxAttribute.None { }
273
274 public enum TypeConstraint implements OnnxTypeConstraint {
275 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
276 ;
277
278 final OnnxType.TypeVariable typeVariable;
279
280 TypeConstraint(OnnxType.TypeVariable typeVariable) {
281 assert typeVariable.name().equals(name());
282 this.typeVariable = typeVariable;
283 }
284
285 @Override
286 public OnnxType.TypeVariable typeVariable() {
287 return typeVariable;
288 }
289 }
290
291 public enum InputParameter implements OnnxParameter {
292 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
293 ;
294
295 final OnnxType type;
296 final Quantifier quantifier;
297
298 InputParameter(OnnxType type, Quantifier quantifier) {
299 this.type = type;
300 this.quantifier = quantifier;
301 }
302
303 @Override
304 public OnnxType type() {
305 return type;
306 }
307
308 @Override
309 public Quantifier quantifier() {
310 return quantifier;
311 }
312 }
313
314 public enum OutputParameter implements OnnxParameter {
315 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
316 ;
317
318 final OnnxType type;
319 final Quantifier quantifier;
320
321 OutputParameter(OnnxType type, Quantifier quantifier) {
322 this.type = type;
323 this.quantifier = quantifier;
324 }
325
326 @Override
327 public OnnxType type() {
328 return type;
329 }
330
331 @Override
332 public Quantifier quantifier() {
333 return quantifier;
334 }
335 }
336
337 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
338 NAME,
339 List.of(Attribute.values()),
340 List.of(TypeConstraint.values()),
341 List.of(InputParameter.values()),
342 List.of(OutputParameter.values())
343 );
344
345 public Acosh(ExternalizedOp def) {
346 super(SCHEMA, def);
347 }
348
349 Acosh(Acosh that, CodeContext cc) {
350 super(that, cc);
351 }
352
353 @Override
354 public Acosh transform(CodeContext cc, CodeTransformer ot) {
355 return new Acosh(this, cc);
356 }
357
358 Acosh(TypeElement resultType, Value input) {
359 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
360 }
361
362 @Override
363 public SequencedSet<OnnxParameter> onnxOutputs() {
364 return onnxOutputs(SCHEMA);
365 }
366
367 @Override
368 public SequencedMap<OnnxParameter, Object> onnxInputs() {
369 return onnxInputs(SCHEMA, List.of(input()));
370 }
371
372 public Value input() {
373 return operands().get(0);
374 }
375
376 }
377
378 public static Acosh Acosh(TypeElement resultType, Value input) {
379 return new Acosh(resultType, input);
380 }
381
382 @OpFactoryHelper.OpDeclaration(Adagrad.NAME)
383 public static final class Adagrad extends OnnxOp {
384 public static final String NAME = "Adagrad";
385
386 public enum Attribute implements OnnxAttribute {
387 epsilon(Float.class, true, 1.0E-6f),
388 decay_factor(Float.class, true, 0.0f),
389 norm_coefficient(Float.class, true, 0.0f),
390 ;
391
392 final Class<?> t;
393 final boolean optional;
394 final Object defaultValue;
395
396 Attribute(Class<?> type, boolean optional, Object defaultValue) {
397 this.t = type;
398 this.optional = optional;
399 this.defaultValue = defaultValue;
400 assert optional || defaultValue == null;
401 }
402
403 public Class<?> type() {
404 return t;
405 }
406
407 public boolean isOptional() {
408 return optional;
409 }
410
411 public Object defaultValue() {
412 return defaultValue;
413 }
414 }
415
416 public enum TypeConstraint implements OnnxTypeConstraint {
417 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
418 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))),
419 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
420 ;
421
422 final OnnxType.TypeVariable typeVariable;
423
424 TypeConstraint(OnnxType.TypeVariable typeVariable) {
425 assert typeVariable.name().equals(name());
426 this.typeVariable = typeVariable;
427 }
428
429 @Override
430 public OnnxType.TypeVariable typeVariable() {
431 return typeVariable;
432 }
433 }
434
435 public enum InputParameter implements OnnxParameter {
436 R(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
437 T(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
438 inputs(TypeConstraint.T3.typeVariable(), Quantifier.VARIADIC),
439 ;
440
441 final OnnxType type;
442 final Quantifier quantifier;
443
444 InputParameter(OnnxType type, Quantifier quantifier) {
445 this.type = type;
446 this.quantifier = quantifier;
447 }
448
449 @Override
450 public OnnxType type() {
451 return type;
452 }
453
454 @Override
455 public Quantifier quantifier() {
456 return quantifier;
457 }
458 }
459
460 public enum OutputParameter implements OnnxParameter {
461 outputs(TypeConstraint.T3.typeVariable(), Quantifier.VARIADIC),
462 ;
463
464 final OnnxType type;
465 final Quantifier quantifier;
466
467 OutputParameter(OnnxType type, Quantifier quantifier) {
468 this.type = type;
469 this.quantifier = quantifier;
470 }
471
472 @Override
473 public OnnxType type() {
474 return type;
475 }
476
477 @Override
478 public Quantifier quantifier() {
479 return quantifier;
480 }
481 }
482
483 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
484 NAME,
485 List.of(Attribute.values()),
486 List.of(TypeConstraint.values()),
487 List.of(InputParameter.values()),
488 List.of(OutputParameter.values())
489 );
490
491 public Adagrad(ExternalizedOp def) {
492 super(SCHEMA, def);
493 }
494
495 Adagrad(Adagrad that, CodeContext cc) {
496 super(that, cc);
497 }
498
499 @Override
500 public Adagrad transform(CodeContext cc, CodeTransformer ot) {
501 return new Adagrad(this, cc);
502 }
503
504 Adagrad(TypeElement resultType, Value R, Value T, List<Value> inputs, java.util.Optional<Float> epsilon, java.util.Optional<Float> decay_factor, java.util.Optional<Float> norm_coefficient) {
505 super(SCHEMA, resultType, Set.of(), List.of(R, T, inputs), List.of(epsilon, decay_factor, norm_coefficient));
506 }
507
508 @Override
509 public SequencedSet<OnnxParameter> onnxOutputs() {
510 return onnxOutputs(SCHEMA);
511 }
512
513 @Override
514 public SequencedMap<OnnxParameter, Object> onnxInputs() {
515 return onnxInputs(SCHEMA, List.of(R(), T(), inputs()));
516 }
517
518 public Value R() {
519 return operands().get(0);
520 }
521
522 public Value T() {
523 return operands().get(1);
524 }
525
526 public List<Value> inputs() {
527 return operands().subList(2, operands().size());
528 }
529
530 public java.util.Optional<Float> epsilon() {
531 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes);
532 return java.util.Optional.ofNullable(epsilon);
533 }
534
535 public java.util.Optional<Float> decay_factor() {
536 Float decay_factor = Attribute.decay_factor.access(Float.class, onnxAttributes);
537 return java.util.Optional.ofNullable(decay_factor);
538 }
539
540 public java.util.Optional<Float> norm_coefficient() {
541 Float norm_coefficient = Attribute.norm_coefficient.access(Float.class, onnxAttributes);
542 return java.util.Optional.ofNullable(norm_coefficient);
543 }
544
545 }
546
547 public static Adagrad Adagrad(TypeElement resultType, Value R, Value T, List<Value> inputs, java.util.Optional<Float> epsilon, java.util.Optional<Float> decay_factor, java.util.Optional<Float> norm_coefficient) {
548 return new Adagrad(resultType, R, T, inputs, epsilon, decay_factor, norm_coefficient);
549 }
550
551 @OpFactoryHelper.OpDeclaration(Adam.NAME)
552 public static final class Adam extends OnnxOp {
553 public static final String NAME = "Adam";
554
555 public enum Attribute implements OnnxAttribute {
556 epsilon(Float.class, true, 1.0E-6f),
557 norm_coefficient_post(Float.class, true, 0.0f),
558 norm_coefficient(Float.class, true, 0.0f),
559 alpha(Float.class, true, 0.9f),
560 beta(Float.class, true, 0.999f),
561 ;
562
563 final Class<?> t;
564 final boolean optional;
565 final Object defaultValue;
566
567 Attribute(Class<?> type, boolean optional, Object defaultValue) {
568 this.t = type;
569 this.optional = optional;
570 this.defaultValue = defaultValue;
571 assert optional || defaultValue == null;
572 }
573
574 public Class<?> type() {
575 return t;
576 }
577
578 public boolean isOptional() {
579 return optional;
580 }
581
582 public Object defaultValue() {
583 return defaultValue;
584 }
585 }
586
587 public enum TypeConstraint implements OnnxTypeConstraint {
588 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
589 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))),
590 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
591 ;
592
593 final OnnxType.TypeVariable typeVariable;
594
595 TypeConstraint(OnnxType.TypeVariable typeVariable) {
596 assert typeVariable.name().equals(name());
597 this.typeVariable = typeVariable;
598 }
599
600 @Override
601 public OnnxType.TypeVariable typeVariable() {
602 return typeVariable;
603 }
604 }
605
606 public enum InputParameter implements OnnxParameter {
607 R(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
608 T(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
609 inputs(TypeConstraint.T3.typeVariable(), Quantifier.VARIADIC),
610 ;
611
612 final OnnxType type;
613 final Quantifier quantifier;
614
615 InputParameter(OnnxType type, Quantifier quantifier) {
616 this.type = type;
617 this.quantifier = quantifier;
618 }
619
620 @Override
621 public OnnxType type() {
622 return type;
623 }
624
625 @Override
626 public Quantifier quantifier() {
627 return quantifier;
628 }
629 }
630
631 public enum OutputParameter implements OnnxParameter {
632 outputs(TypeConstraint.T3.typeVariable(), Quantifier.VARIADIC),
633 ;
634
635 final OnnxType type;
636 final Quantifier quantifier;
637
638 OutputParameter(OnnxType type, Quantifier quantifier) {
639 this.type = type;
640 this.quantifier = quantifier;
641 }
642
643 @Override
644 public OnnxType type() {
645 return type;
646 }
647
648 @Override
649 public Quantifier quantifier() {
650 return quantifier;
651 }
652 }
653
654 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
655 NAME,
656 List.of(Attribute.values()),
657 List.of(TypeConstraint.values()),
658 List.of(InputParameter.values()),
659 List.of(OutputParameter.values())
660 );
661
662 public Adam(ExternalizedOp def) {
663 super(SCHEMA, def);
664 }
665
666 Adam(Adam that, CodeContext cc) {
667 super(that, cc);
668 }
669
670 @Override
671 public Adam transform(CodeContext cc, CodeTransformer ot) {
672 return new Adam(this, cc);
673 }
674
675 Adam(TypeElement resultType, Value R, Value T, List<Value> inputs, java.util.Optional<Float> epsilon, java.util.Optional<Float> norm_coefficient_post, java.util.Optional<Float> norm_coefficient, java.util.Optional<Float> alpha, java.util.Optional<Float> beta) {
676 super(SCHEMA, resultType, Set.of(), List.of(R, T, inputs), List.of(epsilon, norm_coefficient_post, norm_coefficient, alpha, beta));
677 }
678
679 @Override
680 public SequencedSet<OnnxParameter> onnxOutputs() {
681 return onnxOutputs(SCHEMA);
682 }
683
684 @Override
685 public SequencedMap<OnnxParameter, Object> onnxInputs() {
686 return onnxInputs(SCHEMA, List.of(R(), T(), inputs()));
687 }
688
689 public Value R() {
690 return operands().get(0);
691 }
692
693 public Value T() {
694 return operands().get(1);
695 }
696
697 public List<Value> inputs() {
698 return operands().subList(2, operands().size());
699 }
700
701 public java.util.Optional<Float> epsilon() {
702 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes);
703 return java.util.Optional.ofNullable(epsilon);
704 }
705
706 public java.util.Optional<Float> norm_coefficient_post() {
707 Float norm_coefficient_post = Attribute.norm_coefficient_post.access(Float.class, onnxAttributes);
708 return java.util.Optional.ofNullable(norm_coefficient_post);
709 }
710
711 public java.util.Optional<Float> norm_coefficient() {
712 Float norm_coefficient = Attribute.norm_coefficient.access(Float.class, onnxAttributes);
713 return java.util.Optional.ofNullable(norm_coefficient);
714 }
715
716 public java.util.Optional<Float> alpha() {
717 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
718 return java.util.Optional.ofNullable(alpha);
719 }
720
721 public java.util.Optional<Float> beta() {
722 Float beta = Attribute.beta.access(Float.class, onnxAttributes);
723 return java.util.Optional.ofNullable(beta);
724 }
725
726 }
727
728 public static Adam Adam(TypeElement resultType, Value R, Value T, List<Value> inputs, java.util.Optional<Float> epsilon, java.util.Optional<Float> norm_coefficient_post, java.util.Optional<Float> norm_coefficient, java.util.Optional<Float> alpha, java.util.Optional<Float> beta) {
729 return new Adam(resultType, R, T, inputs, epsilon, norm_coefficient_post, norm_coefficient, alpha, beta);
730 }
731
732 @OpFactoryHelper.OpDeclaration(Add.NAME)
733 public static final class Add extends OnnxOp {
734 public static final String NAME = "Add";
735
736 public enum Attribute implements OnnxAttribute.None { }
737
738 public enum TypeConstraint implements OnnxTypeConstraint {
739 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
740 ;
741
742 final OnnxType.TypeVariable typeVariable;
743
744 TypeConstraint(OnnxType.TypeVariable typeVariable) {
745 assert typeVariable.name().equals(name());
746 this.typeVariable = typeVariable;
747 }
748
749 @Override
750 public OnnxType.TypeVariable typeVariable() {
751 return typeVariable;
752 }
753 }
754
755 public enum InputParameter implements OnnxParameter {
756 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
757 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
758 ;
759
760 final OnnxType type;
761 final Quantifier quantifier;
762
763 InputParameter(OnnxType type, Quantifier quantifier) {
764 this.type = type;
765 this.quantifier = quantifier;
766 }
767
768 @Override
769 public OnnxType type() {
770 return type;
771 }
772
773 @Override
774 public Quantifier quantifier() {
775 return quantifier;
776 }
777 }
778
779 public enum OutputParameter implements OnnxParameter {
780 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
781 ;
782
783 final OnnxType type;
784 final Quantifier quantifier;
785
786 OutputParameter(OnnxType type, Quantifier quantifier) {
787 this.type = type;
788 this.quantifier = quantifier;
789 }
790
791 @Override
792 public OnnxType type() {
793 return type;
794 }
795
796 @Override
797 public Quantifier quantifier() {
798 return quantifier;
799 }
800 }
801
802 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
803 NAME,
804 List.of(Attribute.values()),
805 List.of(TypeConstraint.values()),
806 List.of(InputParameter.values()),
807 List.of(OutputParameter.values())
808 );
809
810 public Add(ExternalizedOp def) {
811 super(SCHEMA, def);
812 }
813
814 Add(Add that, CodeContext cc) {
815 super(that, cc);
816 }
817
818 @Override
819 public Add transform(CodeContext cc, CodeTransformer ot) {
820 return new Add(this, cc);
821 }
822
823 Add(TypeElement resultType, Value A, Value B) {
824 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
825 }
826
827 @Override
828 public SequencedSet<OnnxParameter> onnxOutputs() {
829 return onnxOutputs(SCHEMA);
830 }
831
832 @Override
833 public SequencedMap<OnnxParameter, Object> onnxInputs() {
834 return onnxInputs(SCHEMA, List.of(A(), B()));
835 }
836
837 public Value A() {
838 return operands().get(0);
839 }
840
841 public Value B() {
842 return operands().get(1);
843 }
844
845 }
846
847 public static Add Add(TypeElement resultType, Value A, Value B) {
848 return new Add(resultType, A, B);
849 }
850
851 @OpFactoryHelper.OpDeclaration(AffineGrid.NAME)
852 public static final class AffineGrid extends OnnxOp {
853 public static final String NAME = "AffineGrid";
854
855 public enum Attribute implements OnnxAttribute {
856 align_corners(Long.class, true, 0),
857 ;
858
859 final Class<?> t;
860 final boolean optional;
861 final Object defaultValue;
862
863 Attribute(Class<?> type, boolean optional, Object defaultValue) {
864 this.t = type;
865 this.optional = optional;
866 this.defaultValue = defaultValue;
867 assert optional || defaultValue == null;
868 }
869
870 public Class<?> type() {
871 return t;
872 }
873
874 public boolean isOptional() {
875 return optional;
876 }
877
878 public Object defaultValue() {
879 return defaultValue;
880 }
881 }
882
883 public enum TypeConstraint implements OnnxTypeConstraint {
884 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
885 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))),
886 ;
887
888 final OnnxType.TypeVariable typeVariable;
889
890 TypeConstraint(OnnxType.TypeVariable typeVariable) {
891 assert typeVariable.name().equals(name());
892 this.typeVariable = typeVariable;
893 }
894
895 @Override
896 public OnnxType.TypeVariable typeVariable() {
897 return typeVariable;
898 }
899 }
900
901 public enum InputParameter implements OnnxParameter {
902 theta(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
903 size(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
904 ;
905
906 final OnnxType type;
907 final Quantifier quantifier;
908
909 InputParameter(OnnxType type, Quantifier quantifier) {
910 this.type = type;
911 this.quantifier = quantifier;
912 }
913
914 @Override
915 public OnnxType type() {
916 return type;
917 }
918
919 @Override
920 public Quantifier quantifier() {
921 return quantifier;
922 }
923 }
924
925 public enum OutputParameter implements OnnxParameter {
926 grid(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
927 ;
928
929 final OnnxType type;
930 final Quantifier quantifier;
931
932 OutputParameter(OnnxType type, Quantifier quantifier) {
933 this.type = type;
934 this.quantifier = quantifier;
935 }
936
937 @Override
938 public OnnxType type() {
939 return type;
940 }
941
942 @Override
943 public Quantifier quantifier() {
944 return quantifier;
945 }
946 }
947
948 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
949 NAME,
950 List.of(Attribute.values()),
951 List.of(TypeConstraint.values()),
952 List.of(InputParameter.values()),
953 List.of(OutputParameter.values())
954 );
955
956 public AffineGrid(ExternalizedOp def) {
957 super(SCHEMA, def);
958 }
959
960 AffineGrid(AffineGrid that, CodeContext cc) {
961 super(that, cc);
962 }
963
964 @Override
965 public AffineGrid transform(CodeContext cc, CodeTransformer ot) {
966 return new AffineGrid(this, cc);
967 }
968
969 AffineGrid(TypeElement resultType, Value theta, Value size, java.util.Optional<Long> align_corners) {
970 super(SCHEMA, resultType, Set.of(), List.of(theta, size), List.of(align_corners));
971 }
972
973 @Override
974 public SequencedSet<OnnxParameter> onnxOutputs() {
975 return onnxOutputs(SCHEMA);
976 }
977
978 @Override
979 public SequencedMap<OnnxParameter, Object> onnxInputs() {
980 return onnxInputs(SCHEMA, List.of(theta(), size()));
981 }
982
983 public Value theta() {
984 return operands().get(0);
985 }
986
987 public Value size() {
988 return operands().get(1);
989 }
990
991 public java.util.Optional<Long> align_corners() {
992 Long align_corners = Attribute.align_corners.access(Long.class, onnxAttributes);
993 return java.util.Optional.ofNullable(align_corners);
994 }
995
996 }
997
998 public static AffineGrid AffineGrid(TypeElement resultType, Value theta, Value size, java.util.Optional<Long> align_corners) {
999 return new AffineGrid(resultType, theta, size, align_corners);
1000 }
1001
1002 @OpFactoryHelper.OpDeclaration(And.NAME)
1003 public static final class And extends OnnxOp {
1004 public static final String NAME = "And";
1005
1006 public enum Attribute implements OnnxAttribute.None { }
1007
1008 public enum TypeConstraint implements OnnxTypeConstraint {
1009 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bool())))),
1010 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
1011 ;
1012
1013 final OnnxType.TypeVariable typeVariable;
1014
1015 TypeConstraint(OnnxType.TypeVariable typeVariable) {
1016 assert typeVariable.name().equals(name());
1017 this.typeVariable = typeVariable;
1018 }
1019
1020 @Override
1021 public OnnxType.TypeVariable typeVariable() {
1022 return typeVariable;
1023 }
1024 }
1025
1026 public enum InputParameter implements OnnxParameter {
1027 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1028 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1029 ;
1030
1031 final OnnxType type;
1032 final Quantifier quantifier;
1033
1034 InputParameter(OnnxType type, Quantifier quantifier) {
1035 this.type = type;
1036 this.quantifier = quantifier;
1037 }
1038
1039 @Override
1040 public OnnxType type() {
1041 return type;
1042 }
1043
1044 @Override
1045 public Quantifier quantifier() {
1046 return quantifier;
1047 }
1048 }
1049
1050 public enum OutputParameter implements OnnxParameter {
1051 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
1052 ;
1053
1054 final OnnxType type;
1055 final Quantifier quantifier;
1056
1057 OutputParameter(OnnxType type, Quantifier quantifier) {
1058 this.type = type;
1059 this.quantifier = quantifier;
1060 }
1061
1062 @Override
1063 public OnnxType type() {
1064 return type;
1065 }
1066
1067 @Override
1068 public Quantifier quantifier() {
1069 return quantifier;
1070 }
1071 }
1072
1073 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
1074 NAME,
1075 List.of(Attribute.values()),
1076 List.of(TypeConstraint.values()),
1077 List.of(InputParameter.values()),
1078 List.of(OutputParameter.values())
1079 );
1080
1081 public And(ExternalizedOp def) {
1082 super(SCHEMA, def);
1083 }
1084
1085 And(And that, CodeContext cc) {
1086 super(that, cc);
1087 }
1088
1089 @Override
1090 public And transform(CodeContext cc, CodeTransformer ot) {
1091 return new And(this, cc);
1092 }
1093
1094 And(TypeElement resultType, Value A, Value B) {
1095 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
1096 }
1097
1098 @Override
1099 public SequencedSet<OnnxParameter> onnxOutputs() {
1100 return onnxOutputs(SCHEMA);
1101 }
1102
1103 @Override
1104 public SequencedMap<OnnxParameter, Object> onnxInputs() {
1105 return onnxInputs(SCHEMA, List.of(A(), B()));
1106 }
1107
1108 public Value A() {
1109 return operands().get(0);
1110 }
1111
1112 public Value B() {
1113 return operands().get(1);
1114 }
1115
1116 }
1117
1118 public static And And(TypeElement resultType, Value A, Value B) {
1119 return new And(resultType, A, B);
1120 }
1121
1122 @OpFactoryHelper.OpDeclaration(ArgMax.NAME)
1123 public static final class ArgMax extends OnnxOp {
1124 public static final String NAME = "ArgMax";
1125
1126 public enum Attribute implements OnnxAttribute {
1127 keepdims(Long.class, true, 1),
1128 select_last_index(Long.class, true, 0),
1129 axis(Long.class, true, 0),
1130 ;
1131
1132 final Class<?> t;
1133 final boolean optional;
1134 final Object defaultValue;
1135
1136 Attribute(Class<?> type, boolean optional, Object defaultValue) {
1137 this.t = type;
1138 this.optional = optional;
1139 this.defaultValue = defaultValue;
1140 assert optional || defaultValue == null;
1141 }
1142
1143 public Class<?> type() {
1144 return t;
1145 }
1146
1147 public boolean isOptional() {
1148 return optional;
1149 }
1150
1151 public Object defaultValue() {
1152 return defaultValue;
1153 }
1154 }
1155
1156 public enum TypeConstraint implements OnnxTypeConstraint {
1157 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
1158 ;
1159
1160 final OnnxType.TypeVariable typeVariable;
1161
1162 TypeConstraint(OnnxType.TypeVariable typeVariable) {
1163 assert typeVariable.name().equals(name());
1164 this.typeVariable = typeVariable;
1165 }
1166
1167 @Override
1168 public OnnxType.TypeVariable typeVariable() {
1169 return typeVariable;
1170 }
1171 }
1172
1173 public enum InputParameter implements OnnxParameter {
1174 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1175 ;
1176
1177 final OnnxType type;
1178 final Quantifier quantifier;
1179
1180 InputParameter(OnnxType type, Quantifier quantifier) {
1181 this.type = type;
1182 this.quantifier = quantifier;
1183 }
1184
1185 @Override
1186 public OnnxType type() {
1187 return type;
1188 }
1189
1190 @Override
1191 public Quantifier quantifier() {
1192 return quantifier;
1193 }
1194 }
1195
1196 public enum OutputParameter implements OnnxParameter {
1197 reduced(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
1198 ;
1199
1200 final OnnxType type;
1201 final Quantifier quantifier;
1202
1203 OutputParameter(OnnxType type, Quantifier quantifier) {
1204 this.type = type;
1205 this.quantifier = quantifier;
1206 }
1207
1208 @Override
1209 public OnnxType type() {
1210 return type;
1211 }
1212
1213 @Override
1214 public Quantifier quantifier() {
1215 return quantifier;
1216 }
1217 }
1218
1219 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
1220 NAME,
1221 List.of(Attribute.values()),
1222 List.of(TypeConstraint.values()),
1223 List.of(InputParameter.values()),
1224 List.of(OutputParameter.values())
1225 );
1226
1227 public ArgMax(ExternalizedOp def) {
1228 super(SCHEMA, def);
1229 }
1230
1231 ArgMax(ArgMax that, CodeContext cc) {
1232 super(that, cc);
1233 }
1234
1235 @Override
1236 public ArgMax transform(CodeContext cc, CodeTransformer ot) {
1237 return new ArgMax(this, cc);
1238 }
1239
1240 ArgMax(TypeElement resultType, Value data, java.util.Optional<Long> keepdims, java.util.Optional<Long> select_last_index, java.util.Optional<Long> axis) {
1241 super(SCHEMA, resultType, Set.of(), List.of(data), List.of(keepdims, select_last_index, axis));
1242 }
1243
1244 @Override
1245 public SequencedSet<OnnxParameter> onnxOutputs() {
1246 return onnxOutputs(SCHEMA);
1247 }
1248
1249 @Override
1250 public SequencedMap<OnnxParameter, Object> onnxInputs() {
1251 return onnxInputs(SCHEMA, List.of(data()));
1252 }
1253
1254 public Value data() {
1255 return operands().get(0);
1256 }
1257
1258 public java.util.Optional<Long> keepdims() {
1259 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
1260 return java.util.Optional.ofNullable(keepdims);
1261 }
1262
1263 public java.util.Optional<Long> select_last_index() {
1264 Long select_last_index = Attribute.select_last_index.access(Long.class, onnxAttributes);
1265 return java.util.Optional.ofNullable(select_last_index);
1266 }
1267
1268 public java.util.Optional<Long> axis() {
1269 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
1270 return java.util.Optional.ofNullable(axis);
1271 }
1272
1273 }
1274
1275 public static ArgMax ArgMax(TypeElement resultType, Value data, java.util.Optional<Long> keepdims, java.util.Optional<Long> select_last_index, java.util.Optional<Long> axis) {
1276 return new ArgMax(resultType, data, keepdims, select_last_index, axis);
1277 }
1278
1279 @OpFactoryHelper.OpDeclaration(ArgMin.NAME)
1280 public static final class ArgMin extends OnnxOp {
1281 public static final String NAME = "ArgMin";
1282
1283 public enum Attribute implements OnnxAttribute {
1284 keepdims(Long.class, true, 1),
1285 select_last_index(Long.class, true, 0),
1286 axis(Long.class, true, 0),
1287 ;
1288
1289 final Class<?> t;
1290 final boolean optional;
1291 final Object defaultValue;
1292
1293 Attribute(Class<?> type, boolean optional, Object defaultValue) {
1294 this.t = type;
1295 this.optional = optional;
1296 this.defaultValue = defaultValue;
1297 assert optional || defaultValue == null;
1298 }
1299
1300 public Class<?> type() {
1301 return t;
1302 }
1303
1304 public boolean isOptional() {
1305 return optional;
1306 }
1307
1308 public Object defaultValue() {
1309 return defaultValue;
1310 }
1311 }
1312
1313 public enum TypeConstraint implements OnnxTypeConstraint {
1314 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
1315 ;
1316
1317 final OnnxType.TypeVariable typeVariable;
1318
1319 TypeConstraint(OnnxType.TypeVariable typeVariable) {
1320 assert typeVariable.name().equals(name());
1321 this.typeVariable = typeVariable;
1322 }
1323
1324 @Override
1325 public OnnxType.TypeVariable typeVariable() {
1326 return typeVariable;
1327 }
1328 }
1329
1330 public enum InputParameter implements OnnxParameter {
1331 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1332 ;
1333
1334 final OnnxType type;
1335 final Quantifier quantifier;
1336
1337 InputParameter(OnnxType type, Quantifier quantifier) {
1338 this.type = type;
1339 this.quantifier = quantifier;
1340 }
1341
1342 @Override
1343 public OnnxType type() {
1344 return type;
1345 }
1346
1347 @Override
1348 public Quantifier quantifier() {
1349 return quantifier;
1350 }
1351 }
1352
1353 public enum OutputParameter implements OnnxParameter {
1354 reduced(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
1355 ;
1356
1357 final OnnxType type;
1358 final Quantifier quantifier;
1359
1360 OutputParameter(OnnxType type, Quantifier quantifier) {
1361 this.type = type;
1362 this.quantifier = quantifier;
1363 }
1364
1365 @Override
1366 public OnnxType type() {
1367 return type;
1368 }
1369
1370 @Override
1371 public Quantifier quantifier() {
1372 return quantifier;
1373 }
1374 }
1375
1376 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
1377 NAME,
1378 List.of(Attribute.values()),
1379 List.of(TypeConstraint.values()),
1380 List.of(InputParameter.values()),
1381 List.of(OutputParameter.values())
1382 );
1383
1384 public ArgMin(ExternalizedOp def) {
1385 super(SCHEMA, def);
1386 }
1387
1388 ArgMin(ArgMin that, CodeContext cc) {
1389 super(that, cc);
1390 }
1391
1392 @Override
1393 public ArgMin transform(CodeContext cc, CodeTransformer ot) {
1394 return new ArgMin(this, cc);
1395 }
1396
1397 ArgMin(TypeElement resultType, Value data, java.util.Optional<Long> keepdims, java.util.Optional<Long> select_last_index, java.util.Optional<Long> axis) {
1398 super(SCHEMA, resultType, Set.of(), List.of(data), List.of(keepdims, select_last_index, axis));
1399 }
1400
1401 @Override
1402 public SequencedSet<OnnxParameter> onnxOutputs() {
1403 return onnxOutputs(SCHEMA);
1404 }
1405
1406 @Override
1407 public SequencedMap<OnnxParameter, Object> onnxInputs() {
1408 return onnxInputs(SCHEMA, List.of(data()));
1409 }
1410
1411 public Value data() {
1412 return operands().get(0);
1413 }
1414
1415 public java.util.Optional<Long> keepdims() {
1416 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
1417 return java.util.Optional.ofNullable(keepdims);
1418 }
1419
1420 public java.util.Optional<Long> select_last_index() {
1421 Long select_last_index = Attribute.select_last_index.access(Long.class, onnxAttributes);
1422 return java.util.Optional.ofNullable(select_last_index);
1423 }
1424
1425 public java.util.Optional<Long> axis() {
1426 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
1427 return java.util.Optional.ofNullable(axis);
1428 }
1429
1430 }
1431
1432 public static ArgMin ArgMin(TypeElement resultType, Value data, java.util.Optional<Long> keepdims, java.util.Optional<Long> select_last_index, java.util.Optional<Long> axis) {
1433 return new ArgMin(resultType, data, keepdims, select_last_index, axis);
1434 }
1435
1436 @OpFactoryHelper.OpDeclaration(ArrayFeatureExtractor.NAME)
1437 public static final class ArrayFeatureExtractor extends OnnxOp {
1438 public static final String NAME = "ArrayFeatureExtractor";
1439
1440 public enum Attribute implements OnnxAttribute.None { }
1441
1442 public enum TypeConstraint implements OnnxTypeConstraint {
1443 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.string())))),
1444 ;
1445
1446 final OnnxType.TypeVariable typeVariable;
1447
1448 TypeConstraint(OnnxType.TypeVariable typeVariable) {
1449 assert typeVariable.name().equals(name());
1450 this.typeVariable = typeVariable;
1451 }
1452
1453 @Override
1454 public OnnxType.TypeVariable typeVariable() {
1455 return typeVariable;
1456 }
1457 }
1458
1459 public enum InputParameter implements OnnxParameter {
1460 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1461 Y(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
1462 ;
1463
1464 final OnnxType type;
1465 final Quantifier quantifier;
1466
1467 InputParameter(OnnxType type, Quantifier quantifier) {
1468 this.type = type;
1469 this.quantifier = quantifier;
1470 }
1471
1472 @Override
1473 public OnnxType type() {
1474 return type;
1475 }
1476
1477 @Override
1478 public Quantifier quantifier() {
1479 return quantifier;
1480 }
1481 }
1482
1483 public enum OutputParameter implements OnnxParameter {
1484 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1485 ;
1486
1487 final OnnxType type;
1488 final Quantifier quantifier;
1489
1490 OutputParameter(OnnxType type, Quantifier quantifier) {
1491 this.type = type;
1492 this.quantifier = quantifier;
1493 }
1494
1495 @Override
1496 public OnnxType type() {
1497 return type;
1498 }
1499
1500 @Override
1501 public Quantifier quantifier() {
1502 return quantifier;
1503 }
1504 }
1505
1506 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
1507 NAME,
1508 List.of(Attribute.values()),
1509 List.of(TypeConstraint.values()),
1510 List.of(InputParameter.values()),
1511 List.of(OutputParameter.values())
1512 );
1513
1514 public ArrayFeatureExtractor(ExternalizedOp def) {
1515 super(SCHEMA, def);
1516 }
1517
1518 ArrayFeatureExtractor(ArrayFeatureExtractor that, CodeContext cc) {
1519 super(that, cc);
1520 }
1521
1522 @Override
1523 public ArrayFeatureExtractor transform(CodeContext cc, CodeTransformer ot) {
1524 return new ArrayFeatureExtractor(this, cc);
1525 }
1526
1527 ArrayFeatureExtractor(TypeElement resultType, Value X, Value Y) {
1528 super(SCHEMA, resultType, Set.of(), List.of(X, Y), List.of());
1529 }
1530
1531 @Override
1532 public SequencedSet<OnnxParameter> onnxOutputs() {
1533 return onnxOutputs(SCHEMA);
1534 }
1535
1536 @Override
1537 public SequencedMap<OnnxParameter, Object> onnxInputs() {
1538 return onnxInputs(SCHEMA, List.of(X(), Y()));
1539 }
1540
1541 public Value X() {
1542 return operands().get(0);
1543 }
1544
1545 public Value Y() {
1546 return operands().get(1);
1547 }
1548
1549 }
1550
1551 public static ArrayFeatureExtractor ArrayFeatureExtractor(TypeElement resultType, Value X, Value Y) {
1552 return new ArrayFeatureExtractor(resultType, X, Y);
1553 }
1554
1555 @OpFactoryHelper.OpDeclaration(Asin.NAME)
1556 public static final class Asin extends OnnxOp {
1557 public static final String NAME = "Asin";
1558
1559 public enum Attribute implements OnnxAttribute.None { }
1560
1561 public enum TypeConstraint implements OnnxTypeConstraint {
1562 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
1563 ;
1564
1565 final OnnxType.TypeVariable typeVariable;
1566
1567 TypeConstraint(OnnxType.TypeVariable typeVariable) {
1568 assert typeVariable.name().equals(name());
1569 this.typeVariable = typeVariable;
1570 }
1571
1572 @Override
1573 public OnnxType.TypeVariable typeVariable() {
1574 return typeVariable;
1575 }
1576 }
1577
1578 public enum InputParameter implements OnnxParameter {
1579 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1580 ;
1581
1582 final OnnxType type;
1583 final Quantifier quantifier;
1584
1585 InputParameter(OnnxType type, Quantifier quantifier) {
1586 this.type = type;
1587 this.quantifier = quantifier;
1588 }
1589
1590 @Override
1591 public OnnxType type() {
1592 return type;
1593 }
1594
1595 @Override
1596 public Quantifier quantifier() {
1597 return quantifier;
1598 }
1599 }
1600
1601 public enum OutputParameter implements OnnxParameter {
1602 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1603 ;
1604
1605 final OnnxType type;
1606 final Quantifier quantifier;
1607
1608 OutputParameter(OnnxType type, Quantifier quantifier) {
1609 this.type = type;
1610 this.quantifier = quantifier;
1611 }
1612
1613 @Override
1614 public OnnxType type() {
1615 return type;
1616 }
1617
1618 @Override
1619 public Quantifier quantifier() {
1620 return quantifier;
1621 }
1622 }
1623
1624 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
1625 NAME,
1626 List.of(Attribute.values()),
1627 List.of(TypeConstraint.values()),
1628 List.of(InputParameter.values()),
1629 List.of(OutputParameter.values())
1630 );
1631
1632 public Asin(ExternalizedOp def) {
1633 super(SCHEMA, def);
1634 }
1635
1636 Asin(Asin that, CodeContext cc) {
1637 super(that, cc);
1638 }
1639
1640 @Override
1641 public Asin transform(CodeContext cc, CodeTransformer ot) {
1642 return new Asin(this, cc);
1643 }
1644
1645 Asin(TypeElement resultType, Value input) {
1646 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
1647 }
1648
1649 @Override
1650 public SequencedSet<OnnxParameter> onnxOutputs() {
1651 return onnxOutputs(SCHEMA);
1652 }
1653
1654 @Override
1655 public SequencedMap<OnnxParameter, Object> onnxInputs() {
1656 return onnxInputs(SCHEMA, List.of(input()));
1657 }
1658
1659 public Value input() {
1660 return operands().get(0);
1661 }
1662
1663 }
1664
1665 public static Asin Asin(TypeElement resultType, Value input) {
1666 return new Asin(resultType, input);
1667 }
1668
1669 @OpFactoryHelper.OpDeclaration(Asinh.NAME)
1670 public static final class Asinh extends OnnxOp {
1671 public static final String NAME = "Asinh";
1672
1673 public enum Attribute implements OnnxAttribute.None { }
1674
1675 public enum TypeConstraint implements OnnxTypeConstraint {
1676 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
1677 ;
1678
1679 final OnnxType.TypeVariable typeVariable;
1680
1681 TypeConstraint(OnnxType.TypeVariable typeVariable) {
1682 assert typeVariable.name().equals(name());
1683 this.typeVariable = typeVariable;
1684 }
1685
1686 @Override
1687 public OnnxType.TypeVariable typeVariable() {
1688 return typeVariable;
1689 }
1690 }
1691
1692 public enum InputParameter implements OnnxParameter {
1693 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1694 ;
1695
1696 final OnnxType type;
1697 final Quantifier quantifier;
1698
1699 InputParameter(OnnxType type, Quantifier quantifier) {
1700 this.type = type;
1701 this.quantifier = quantifier;
1702 }
1703
1704 @Override
1705 public OnnxType type() {
1706 return type;
1707 }
1708
1709 @Override
1710 public Quantifier quantifier() {
1711 return quantifier;
1712 }
1713 }
1714
1715 public enum OutputParameter implements OnnxParameter {
1716 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1717 ;
1718
1719 final OnnxType type;
1720 final Quantifier quantifier;
1721
1722 OutputParameter(OnnxType type, Quantifier quantifier) {
1723 this.type = type;
1724 this.quantifier = quantifier;
1725 }
1726
1727 @Override
1728 public OnnxType type() {
1729 return type;
1730 }
1731
1732 @Override
1733 public Quantifier quantifier() {
1734 return quantifier;
1735 }
1736 }
1737
1738 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
1739 NAME,
1740 List.of(Attribute.values()),
1741 List.of(TypeConstraint.values()),
1742 List.of(InputParameter.values()),
1743 List.of(OutputParameter.values())
1744 );
1745
1746 public Asinh(ExternalizedOp def) {
1747 super(SCHEMA, def);
1748 }
1749
1750 Asinh(Asinh that, CodeContext cc) {
1751 super(that, cc);
1752 }
1753
1754 @Override
1755 public Asinh transform(CodeContext cc, CodeTransformer ot) {
1756 return new Asinh(this, cc);
1757 }
1758
1759 Asinh(TypeElement resultType, Value input) {
1760 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
1761 }
1762
1763 @Override
1764 public SequencedSet<OnnxParameter> onnxOutputs() {
1765 return onnxOutputs(SCHEMA);
1766 }
1767
1768 @Override
1769 public SequencedMap<OnnxParameter, Object> onnxInputs() {
1770 return onnxInputs(SCHEMA, List.of(input()));
1771 }
1772
1773 public Value input() {
1774 return operands().get(0);
1775 }
1776
1777 }
1778
1779 public static Asinh Asinh(TypeElement resultType, Value input) {
1780 return new Asinh(resultType, input);
1781 }
1782
1783 @OpFactoryHelper.OpDeclaration(Atan.NAME)
1784 public static final class Atan extends OnnxOp {
1785 public static final String NAME = "Atan";
1786
1787 public enum Attribute implements OnnxAttribute.None { }
1788
1789 public enum TypeConstraint implements OnnxTypeConstraint {
1790 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
1791 ;
1792
1793 final OnnxType.TypeVariable typeVariable;
1794
1795 TypeConstraint(OnnxType.TypeVariable typeVariable) {
1796 assert typeVariable.name().equals(name());
1797 this.typeVariable = typeVariable;
1798 }
1799
1800 @Override
1801 public OnnxType.TypeVariable typeVariable() {
1802 return typeVariable;
1803 }
1804 }
1805
1806 public enum InputParameter implements OnnxParameter {
1807 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1808 ;
1809
1810 final OnnxType type;
1811 final Quantifier quantifier;
1812
1813 InputParameter(OnnxType type, Quantifier quantifier) {
1814 this.type = type;
1815 this.quantifier = quantifier;
1816 }
1817
1818 @Override
1819 public OnnxType type() {
1820 return type;
1821 }
1822
1823 @Override
1824 public Quantifier quantifier() {
1825 return quantifier;
1826 }
1827 }
1828
1829 public enum OutputParameter implements OnnxParameter {
1830 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1831 ;
1832
1833 final OnnxType type;
1834 final Quantifier quantifier;
1835
1836 OutputParameter(OnnxType type, Quantifier quantifier) {
1837 this.type = type;
1838 this.quantifier = quantifier;
1839 }
1840
1841 @Override
1842 public OnnxType type() {
1843 return type;
1844 }
1845
1846 @Override
1847 public Quantifier quantifier() {
1848 return quantifier;
1849 }
1850 }
1851
1852 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
1853 NAME,
1854 List.of(Attribute.values()),
1855 List.of(TypeConstraint.values()),
1856 List.of(InputParameter.values()),
1857 List.of(OutputParameter.values())
1858 );
1859
1860 public Atan(ExternalizedOp def) {
1861 super(SCHEMA, def);
1862 }
1863
1864 Atan(Atan that, CodeContext cc) {
1865 super(that, cc);
1866 }
1867
1868 @Override
1869 public Atan transform(CodeContext cc, CodeTransformer ot) {
1870 return new Atan(this, cc);
1871 }
1872
1873 Atan(TypeElement resultType, Value input) {
1874 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
1875 }
1876
1877 @Override
1878 public SequencedSet<OnnxParameter> onnxOutputs() {
1879 return onnxOutputs(SCHEMA);
1880 }
1881
1882 @Override
1883 public SequencedMap<OnnxParameter, Object> onnxInputs() {
1884 return onnxInputs(SCHEMA, List.of(input()));
1885 }
1886
1887 public Value input() {
1888 return operands().get(0);
1889 }
1890
1891 }
1892
1893 public static Atan Atan(TypeElement resultType, Value input) {
1894 return new Atan(resultType, input);
1895 }
1896
1897 @OpFactoryHelper.OpDeclaration(Atanh.NAME)
1898 public static final class Atanh extends OnnxOp {
1899 public static final String NAME = "Atanh";
1900
1901 public enum Attribute implements OnnxAttribute.None { }
1902
1903 public enum TypeConstraint implements OnnxTypeConstraint {
1904 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
1905 ;
1906
1907 final OnnxType.TypeVariable typeVariable;
1908
1909 TypeConstraint(OnnxType.TypeVariable typeVariable) {
1910 assert typeVariable.name().equals(name());
1911 this.typeVariable = typeVariable;
1912 }
1913
1914 @Override
1915 public OnnxType.TypeVariable typeVariable() {
1916 return typeVariable;
1917 }
1918 }
1919
1920 public enum InputParameter implements OnnxParameter {
1921 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1922 ;
1923
1924 final OnnxType type;
1925 final Quantifier quantifier;
1926
1927 InputParameter(OnnxType type, Quantifier quantifier) {
1928 this.type = type;
1929 this.quantifier = quantifier;
1930 }
1931
1932 @Override
1933 public OnnxType type() {
1934 return type;
1935 }
1936
1937 @Override
1938 public Quantifier quantifier() {
1939 return quantifier;
1940 }
1941 }
1942
1943 public enum OutputParameter implements OnnxParameter {
1944 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
1945 ;
1946
1947 final OnnxType type;
1948 final Quantifier quantifier;
1949
1950 OutputParameter(OnnxType type, Quantifier quantifier) {
1951 this.type = type;
1952 this.quantifier = quantifier;
1953 }
1954
1955 @Override
1956 public OnnxType type() {
1957 return type;
1958 }
1959
1960 @Override
1961 public Quantifier quantifier() {
1962 return quantifier;
1963 }
1964 }
1965
1966 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
1967 NAME,
1968 List.of(Attribute.values()),
1969 List.of(TypeConstraint.values()),
1970 List.of(InputParameter.values()),
1971 List.of(OutputParameter.values())
1972 );
1973
1974 public Atanh(ExternalizedOp def) {
1975 super(SCHEMA, def);
1976 }
1977
1978 Atanh(Atanh that, CodeContext cc) {
1979 super(that, cc);
1980 }
1981
1982 @Override
1983 public Atanh transform(CodeContext cc, CodeTransformer ot) {
1984 return new Atanh(this, cc);
1985 }
1986
1987 Atanh(TypeElement resultType, Value input) {
1988 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
1989 }
1990
1991 @Override
1992 public SequencedSet<OnnxParameter> onnxOutputs() {
1993 return onnxOutputs(SCHEMA);
1994 }
1995
1996 @Override
1997 public SequencedMap<OnnxParameter, Object> onnxInputs() {
1998 return onnxInputs(SCHEMA, List.of(input()));
1999 }
2000
2001 public Value input() {
2002 return operands().get(0);
2003 }
2004
2005 }
2006
2007 public static Atanh Atanh(TypeElement resultType, Value input) {
2008 return new Atanh(resultType, input);
2009 }
2010
2011 @OpFactoryHelper.OpDeclaration(Attention.NAME)
2012 public static final class Attention extends OnnxOp {
2013 public static final String NAME = "Attention";
2014
2015 public enum Attribute implements OnnxAttribute {
2016 qk_matmul_output_mode(Long.class, true, 0),
2017 softcap(Float.class, true, 0.0f),
2018 softmax_precision(Long.class, true, null),
2019 scale(Float.class, true, null),
2020 is_causal(Long.class, true, 0),
2021 q_num_heads(Long.class, true, null),
2022 kv_num_heads(Long.class, true, null),
2023 ;
2024
2025 final Class<?> t;
2026 final boolean optional;
2027 final Object defaultValue;
2028
2029 Attribute(Class<?> type, boolean optional, Object defaultValue) {
2030 this.t = type;
2031 this.optional = optional;
2032 this.defaultValue = defaultValue;
2033 assert optional || defaultValue == null;
2034 }
2035
2036 public Class<?> type() {
2037 return t;
2038 }
2039
2040 public boolean isOptional() {
2041 return optional;
2042 }
2043
2044 public Object defaultValue() {
2045 return defaultValue;
2046 }
2047 }
2048
2049 public enum TypeConstraint implements OnnxTypeConstraint {
2050 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
2051 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
2052 U(new OnnxType.TypeVariable("U", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bool())))),
2053 ;
2054
2055 final OnnxType.TypeVariable typeVariable;
2056
2057 TypeConstraint(OnnxType.TypeVariable typeVariable) {
2058 assert typeVariable.name().equals(name());
2059 this.typeVariable = typeVariable;
2060 }
2061
2062 @Override
2063 public OnnxType.TypeVariable typeVariable() {
2064 return typeVariable;
2065 }
2066 }
2067
2068 public enum InputParameter implements OnnxParameter {
2069 Q(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
2070 K(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
2071 V(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
2072 attn_mask(TypeConstraint.U.typeVariable(), Quantifier.OPTIONAL),
2073 past_key(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
2074 past_value(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
2075 nonpad_kv_seqlen(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
2076 ;
2077
2078 final OnnxType type;
2079 final Quantifier quantifier;
2080
2081 InputParameter(OnnxType type, Quantifier quantifier) {
2082 this.type = type;
2083 this.quantifier = quantifier;
2084 }
2085
2086 @Override
2087 public OnnxType type() {
2088 return type;
2089 }
2090
2091 @Override
2092 public Quantifier quantifier() {
2093 return quantifier;
2094 }
2095 }
2096
2097 public enum OutputParameter implements OnnxParameter {
2098 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
2099 present_key(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
2100 present_value(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
2101 qk_matmul_output(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
2102 ;
2103
2104 final OnnxType type;
2105 final Quantifier quantifier;
2106
2107 OutputParameter(OnnxType type, Quantifier quantifier) {
2108 this.type = type;
2109 this.quantifier = quantifier;
2110 }
2111
2112 @Override
2113 public OnnxType type() {
2114 return type;
2115 }
2116
2117 @Override
2118 public Quantifier quantifier() {
2119 return quantifier;
2120 }
2121 }
2122
2123 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
2124 NAME,
2125 List.of(Attribute.values()),
2126 List.of(TypeConstraint.values()),
2127 List.of(InputParameter.values()),
2128 List.of(OutputParameter.values())
2129 );
2130
2131 public Attention(ExternalizedOp def) {
2132 super(SCHEMA, def);
2133 }
2134
2135 Attention(Attention that, CodeContext cc) {
2136 super(that, cc);
2137 }
2138
2139 @Override
2140 public Attention transform(CodeContext cc, CodeTransformer ot) {
2141 return new Attention(this, cc);
2142 }
2143
2144 Attention(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value Q, Value K, Value V, java.util.Optional<Value> attn_mask, java.util.Optional<Value> past_key, java.util.Optional<Value> past_value, java.util.Optional<Value> nonpad_kv_seqlen, java.util.Optional<Long> qk_matmul_output_mode, java.util.Optional<Float> softcap, java.util.Optional<Long> softmax_precision, java.util.Optional<Float> scale, java.util.Optional<Long> is_causal, java.util.Optional<Long> q_num_heads, java.util.Optional<Long> kv_num_heads) {
2145 super(SCHEMA, resultType, optionalOutputs, List.of(Q, K, V, attn_mask, past_key, past_value, nonpad_kv_seqlen), List.of(qk_matmul_output_mode, softcap, softmax_precision, scale, is_causal, q_num_heads, kv_num_heads));
2146 }
2147
2148 @Override
2149 public SequencedSet<OnnxParameter> onnxOutputs() {
2150 return onnxOutputs(SCHEMA);
2151 }
2152
2153 @Override
2154 public SequencedMap<OnnxParameter, Object> onnxInputs() {
2155 return onnxInputs(SCHEMA, List.of(Q(), K(), V(), attn_mask(), past_key(), past_value(), nonpad_kv_seqlen()));
2156 }
2157
2158 public Value Q() {
2159 return operands().get(0);
2160 }
2161
2162 public Value K() {
2163 return operands().get(1);
2164 }
2165
2166 public Value V() {
2167 return operands().get(2);
2168 }
2169
2170 public java.util.Optional<Value> attn_mask() {
2171 int i = optionalInputArguments.indexOf(InputParameter.attn_mask);
2172 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
2173 }
2174
2175 public java.util.Optional<Value> past_key() {
2176 int i = optionalInputArguments.indexOf(InputParameter.past_key);
2177 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
2178 }
2179
2180 public java.util.Optional<Value> past_value() {
2181 int i = optionalInputArguments.indexOf(InputParameter.past_value);
2182 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
2183 }
2184
2185 public java.util.Optional<Value> nonpad_kv_seqlen() {
2186 int i = optionalInputArguments.indexOf(InputParameter.nonpad_kv_seqlen);
2187 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
2188 }
2189
2190 public java.util.Optional<Long> qk_matmul_output_mode() {
2191 Long qk_matmul_output_mode = Attribute.qk_matmul_output_mode.access(Long.class, onnxAttributes);
2192 return java.util.Optional.ofNullable(qk_matmul_output_mode);
2193 }
2194
2195 public java.util.Optional<Float> softcap() {
2196 Float softcap = Attribute.softcap.access(Float.class, onnxAttributes);
2197 return java.util.Optional.ofNullable(softcap);
2198 }
2199
2200 public java.util.Optional<Long> softmax_precision() {
2201 Long softmax_precision = Attribute.softmax_precision.access(Long.class, onnxAttributes);
2202 return java.util.Optional.ofNullable(softmax_precision);
2203 }
2204
2205 public java.util.Optional<Float> scale() {
2206 Float scale = Attribute.scale.access(Float.class, onnxAttributes);
2207 return java.util.Optional.ofNullable(scale);
2208 }
2209
2210 public java.util.Optional<Long> is_causal() {
2211 Long is_causal = Attribute.is_causal.access(Long.class, onnxAttributes);
2212 return java.util.Optional.ofNullable(is_causal);
2213 }
2214
2215 public java.util.Optional<Long> q_num_heads() {
2216 Long q_num_heads = Attribute.q_num_heads.access(Long.class, onnxAttributes);
2217 return java.util.Optional.ofNullable(q_num_heads);
2218 }
2219
2220 public java.util.Optional<Long> kv_num_heads() {
2221 Long kv_num_heads = Attribute.kv_num_heads.access(Long.class, onnxAttributes);
2222 return java.util.Optional.ofNullable(kv_num_heads);
2223 }
2224
2225 }
2226
2227 public static Attention Attention(TypeElement resultType, Set<Attention.OutputParameter> optionalOutputs, Value Q, Value K, Value V, java.util.Optional<Value> attn_mask, java.util.Optional<Value> past_key, java.util.Optional<Value> past_value, java.util.Optional<Value> nonpad_kv_seqlen, java.util.Optional<Long> qk_matmul_output_mode, java.util.Optional<Float> softcap, java.util.Optional<Long> softmax_precision, java.util.Optional<Float> scale, java.util.Optional<Long> is_causal, java.util.Optional<Long> q_num_heads, java.util.Optional<Long> kv_num_heads) {
2228 return new Attention(resultType, optionalOutputs, Q, K, V, attn_mask, past_key, past_value, nonpad_kv_seqlen, qk_matmul_output_mode, softcap, softmax_precision, scale, is_causal, q_num_heads, kv_num_heads);
2229 }
2230
2231 @OpFactoryHelper.OpDeclaration(AveragePool.NAME)
2232 public static final class AveragePool extends OnnxOp {
2233 public static final String NAME = "AveragePool";
2234
2235 public enum Attribute implements OnnxAttribute {
2236 pads(long[].class, true, null),
2237 dilations(long[].class, true, null),
2238 auto_pad(String.class, true, "NOTSET"),
2239 count_include_pad(Long.class, true, 0),
2240 ceil_mode(Long.class, true, 0),
2241 strides(long[].class, true, null),
2242 kernel_shape(long[].class, false, null),
2243 ;
2244
2245 final Class<?> t;
2246 final boolean optional;
2247 final Object defaultValue;
2248
2249 Attribute(Class<?> type, boolean optional, Object defaultValue) {
2250 this.t = type;
2251 this.optional = optional;
2252 this.defaultValue = defaultValue;
2253 assert optional || defaultValue == null;
2254 }
2255
2256 public Class<?> type() {
2257 return t;
2258 }
2259
2260 public boolean isOptional() {
2261 return optional;
2262 }
2263
2264 public Object defaultValue() {
2265 return defaultValue;
2266 }
2267 }
2268
2269 public enum TypeConstraint implements OnnxTypeConstraint {
2270 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
2271 ;
2272
2273 final OnnxType.TypeVariable typeVariable;
2274
2275 TypeConstraint(OnnxType.TypeVariable typeVariable) {
2276 assert typeVariable.name().equals(name());
2277 this.typeVariable = typeVariable;
2278 }
2279
2280 @Override
2281 public OnnxType.TypeVariable typeVariable() {
2282 return typeVariable;
2283 }
2284 }
2285
2286 public enum InputParameter implements OnnxParameter {
2287 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2288 ;
2289
2290 final OnnxType type;
2291 final Quantifier quantifier;
2292
2293 InputParameter(OnnxType type, Quantifier quantifier) {
2294 this.type = type;
2295 this.quantifier = quantifier;
2296 }
2297
2298 @Override
2299 public OnnxType type() {
2300 return type;
2301 }
2302
2303 @Override
2304 public Quantifier quantifier() {
2305 return quantifier;
2306 }
2307 }
2308
2309 public enum OutputParameter implements OnnxParameter {
2310 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2311 ;
2312
2313 final OnnxType type;
2314 final Quantifier quantifier;
2315
2316 OutputParameter(OnnxType type, Quantifier quantifier) {
2317 this.type = type;
2318 this.quantifier = quantifier;
2319 }
2320
2321 @Override
2322 public OnnxType type() {
2323 return type;
2324 }
2325
2326 @Override
2327 public Quantifier quantifier() {
2328 return quantifier;
2329 }
2330 }
2331
2332 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
2333 NAME,
2334 List.of(Attribute.values()),
2335 List.of(TypeConstraint.values()),
2336 List.of(InputParameter.values()),
2337 List.of(OutputParameter.values())
2338 );
2339
2340 public AveragePool(ExternalizedOp def) {
2341 super(SCHEMA, def);
2342 }
2343
2344 AveragePool(AveragePool that, CodeContext cc) {
2345 super(that, cc);
2346 }
2347
2348 @Override
2349 public AveragePool transform(CodeContext cc, CodeTransformer ot) {
2350 return new AveragePool(this, cc);
2351 }
2352
2353 AveragePool(TypeElement resultType, Value X, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<Long> count_include_pad, java.util.Optional<Long> ceil_mode, java.util.Optional<long[]> strides, long[] kernel_shape) {
2354 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(pads, dilations, auto_pad, count_include_pad, ceil_mode, strides, kernel_shape));
2355 }
2356
2357 @Override
2358 public SequencedSet<OnnxParameter> onnxOutputs() {
2359 return onnxOutputs(SCHEMA);
2360 }
2361
2362 @Override
2363 public SequencedMap<OnnxParameter, Object> onnxInputs() {
2364 return onnxInputs(SCHEMA, List.of(X()));
2365 }
2366
2367 public Value X() {
2368 return operands().get(0);
2369 }
2370
2371 public java.util.Optional<long[]> pads() {
2372 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
2373 return java.util.Optional.ofNullable(pads).map(long[]::clone);
2374 }
2375
2376 public java.util.Optional<long[]> dilations() {
2377 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
2378 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
2379 }
2380
2381 public java.util.Optional<String> auto_pad() {
2382 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes);
2383 return java.util.Optional.ofNullable(auto_pad);
2384 }
2385
2386 public java.util.Optional<Long> count_include_pad() {
2387 Long count_include_pad = Attribute.count_include_pad.access(Long.class, onnxAttributes);
2388 return java.util.Optional.ofNullable(count_include_pad);
2389 }
2390
2391 public java.util.Optional<Long> ceil_mode() {
2392 Long ceil_mode = Attribute.ceil_mode.access(Long.class, onnxAttributes);
2393 return java.util.Optional.ofNullable(ceil_mode);
2394 }
2395
2396 public java.util.Optional<long[]> strides() {
2397 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
2398 return java.util.Optional.ofNullable(strides).map(long[]::clone);
2399 }
2400
2401 public long[] kernel_shape() {
2402 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
2403 return kernel_shape.clone();
2404 }
2405
2406 }
2407
2408 public static AveragePool AveragePool(TypeElement resultType, Value X, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<Long> count_include_pad, java.util.Optional<Long> ceil_mode, java.util.Optional<long[]> strides, long[] kernel_shape) {
2409 return new AveragePool(resultType, X, pads, dilations, auto_pad, count_include_pad, ceil_mode, strides, kernel_shape);
2410 }
2411
2412 @OpFactoryHelper.OpDeclaration(BatchNormalization.NAME)
2413 public static final class BatchNormalization extends OnnxOp {
2414 public static final String NAME = "BatchNormalization";
2415
2416 public enum Attribute implements OnnxAttribute {
2417 epsilon(Float.class, true, 1.0E-5f),
2418 training_mode(Long.class, true, 0),
2419 momentum(Float.class, true, 0.9f),
2420 ;
2421
2422 final Class<?> t;
2423 final boolean optional;
2424 final Object defaultValue;
2425
2426 Attribute(Class<?> type, boolean optional, Object defaultValue) {
2427 this.t = type;
2428 this.optional = optional;
2429 this.defaultValue = defaultValue;
2430 assert optional || defaultValue == null;
2431 }
2432
2433 public Class<?> type() {
2434 return t;
2435 }
2436
2437 public boolean isOptional() {
2438 return optional;
2439 }
2440
2441 public Object defaultValue() {
2442 return defaultValue;
2443 }
2444 }
2445
2446 public enum TypeConstraint implements OnnxTypeConstraint {
2447 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
2448 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
2449 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
2450 ;
2451
2452 final OnnxType.TypeVariable typeVariable;
2453
2454 TypeConstraint(OnnxType.TypeVariable typeVariable) {
2455 assert typeVariable.name().equals(name());
2456 this.typeVariable = typeVariable;
2457 }
2458
2459 @Override
2460 public OnnxType.TypeVariable typeVariable() {
2461 return typeVariable;
2462 }
2463 }
2464
2465 public enum InputParameter implements OnnxParameter {
2466 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2467 scale(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
2468 B(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
2469 input_mean(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
2470 input_var(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
2471 ;
2472
2473 final OnnxType type;
2474 final Quantifier quantifier;
2475
2476 InputParameter(OnnxType type, Quantifier quantifier) {
2477 this.type = type;
2478 this.quantifier = quantifier;
2479 }
2480
2481 @Override
2482 public OnnxType type() {
2483 return type;
2484 }
2485
2486 @Override
2487 public Quantifier quantifier() {
2488 return quantifier;
2489 }
2490 }
2491
2492 public enum OutputParameter implements OnnxParameter {
2493 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2494 running_mean(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
2495 running_var(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
2496 ;
2497
2498 final OnnxType type;
2499 final Quantifier quantifier;
2500
2501 OutputParameter(OnnxType type, Quantifier quantifier) {
2502 this.type = type;
2503 this.quantifier = quantifier;
2504 }
2505
2506 @Override
2507 public OnnxType type() {
2508 return type;
2509 }
2510
2511 @Override
2512 public Quantifier quantifier() {
2513 return quantifier;
2514 }
2515 }
2516
2517 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
2518 NAME,
2519 List.of(Attribute.values()),
2520 List.of(TypeConstraint.values()),
2521 List.of(InputParameter.values()),
2522 List.of(OutputParameter.values())
2523 );
2524
2525 public BatchNormalization(ExternalizedOp def) {
2526 super(SCHEMA, def);
2527 }
2528
2529 BatchNormalization(BatchNormalization that, CodeContext cc) {
2530 super(that, cc);
2531 }
2532
2533 @Override
2534 public BatchNormalization transform(CodeContext cc, CodeTransformer ot) {
2535 return new BatchNormalization(this, cc);
2536 }
2537
2538 BatchNormalization(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value X, Value scale, Value B, Value input_mean, Value input_var, java.util.Optional<Float> epsilon, java.util.Optional<Long> training_mode, java.util.Optional<Float> momentum) {
2539 super(SCHEMA, resultType, optionalOutputs, List.of(X, scale, B, input_mean, input_var), List.of(epsilon, training_mode, momentum));
2540 }
2541
2542 @Override
2543 public SequencedSet<OnnxParameter> onnxOutputs() {
2544 return onnxOutputs(SCHEMA);
2545 }
2546
2547 @Override
2548 public SequencedMap<OnnxParameter, Object> onnxInputs() {
2549 return onnxInputs(SCHEMA, List.of(X(), scale(), B(), input_mean(), input_var()));
2550 }
2551
2552 public Value X() {
2553 return operands().get(0);
2554 }
2555
2556 public Value scale() {
2557 return operands().get(1);
2558 }
2559
2560 public Value B() {
2561 return operands().get(2);
2562 }
2563
2564 public Value input_mean() {
2565 return operands().get(3);
2566 }
2567
2568 public Value input_var() {
2569 return operands().get(4);
2570 }
2571
2572 public java.util.Optional<Float> epsilon() {
2573 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes);
2574 return java.util.Optional.ofNullable(epsilon);
2575 }
2576
2577 public java.util.Optional<Long> training_mode() {
2578 Long training_mode = Attribute.training_mode.access(Long.class, onnxAttributes);
2579 return java.util.Optional.ofNullable(training_mode);
2580 }
2581
2582 public java.util.Optional<Float> momentum() {
2583 Float momentum = Attribute.momentum.access(Float.class, onnxAttributes);
2584 return java.util.Optional.ofNullable(momentum);
2585 }
2586
2587 }
2588
2589 public static BatchNormalization BatchNormalization(TypeElement resultType, Set<BatchNormalization.OutputParameter> optionalOutputs, Value X, Value scale, Value B, Value input_mean, Value input_var, java.util.Optional<Float> epsilon, java.util.Optional<Long> training_mode, java.util.Optional<Float> momentum) {
2590 return new BatchNormalization(resultType, optionalOutputs, X, scale, B, input_mean, input_var, epsilon, training_mode, momentum);
2591 }
2592
2593 @OpFactoryHelper.OpDeclaration(Bernoulli.NAME)
2594 public static final class Bernoulli extends OnnxOp {
2595 public static final String NAME = "Bernoulli";
2596
2597 public enum Attribute implements OnnxAttribute {
2598 seed(Float.class, true, null),
2599 dtype(Long.class, true, null),
2600 ;
2601
2602 final Class<?> t;
2603 final boolean optional;
2604 final Object defaultValue;
2605
2606 Attribute(Class<?> type, boolean optional, Object defaultValue) {
2607 this.t = type;
2608 this.optional = optional;
2609 this.defaultValue = defaultValue;
2610 assert optional || defaultValue == null;
2611 }
2612
2613 public Class<?> type() {
2614 return t;
2615 }
2616
2617 public boolean isOptional() {
2618 return optional;
2619 }
2620
2621 public Object defaultValue() {
2622 return defaultValue;
2623 }
2624 }
2625
2626 public enum TypeConstraint implements OnnxTypeConstraint {
2627 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
2628 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bool())))),
2629 ;
2630
2631 final OnnxType.TypeVariable typeVariable;
2632
2633 TypeConstraint(OnnxType.TypeVariable typeVariable) {
2634 assert typeVariable.name().equals(name());
2635 this.typeVariable = typeVariable;
2636 }
2637
2638 @Override
2639 public OnnxType.TypeVariable typeVariable() {
2640 return typeVariable;
2641 }
2642 }
2643
2644 public enum InputParameter implements OnnxParameter {
2645 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
2646 ;
2647
2648 final OnnxType type;
2649 final Quantifier quantifier;
2650
2651 InputParameter(OnnxType type, Quantifier quantifier) {
2652 this.type = type;
2653 this.quantifier = quantifier;
2654 }
2655
2656 @Override
2657 public OnnxType type() {
2658 return type;
2659 }
2660
2661 @Override
2662 public Quantifier quantifier() {
2663 return quantifier;
2664 }
2665 }
2666
2667 public enum OutputParameter implements OnnxParameter {
2668 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
2669 ;
2670
2671 final OnnxType type;
2672 final Quantifier quantifier;
2673
2674 OutputParameter(OnnxType type, Quantifier quantifier) {
2675 this.type = type;
2676 this.quantifier = quantifier;
2677 }
2678
2679 @Override
2680 public OnnxType type() {
2681 return type;
2682 }
2683
2684 @Override
2685 public Quantifier quantifier() {
2686 return quantifier;
2687 }
2688 }
2689
2690 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
2691 NAME,
2692 List.of(Attribute.values()),
2693 List.of(TypeConstraint.values()),
2694 List.of(InputParameter.values()),
2695 List.of(OutputParameter.values())
2696 );
2697
2698 public Bernoulli(ExternalizedOp def) {
2699 super(SCHEMA, def);
2700 }
2701
2702 Bernoulli(Bernoulli that, CodeContext cc) {
2703 super(that, cc);
2704 }
2705
2706 @Override
2707 public Bernoulli transform(CodeContext cc, CodeTransformer ot) {
2708 return new Bernoulli(this, cc);
2709 }
2710
2711 Bernoulli(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Long> dtype) {
2712 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(seed, dtype));
2713 }
2714
2715 @Override
2716 public SequencedSet<OnnxParameter> onnxOutputs() {
2717 return onnxOutputs(SCHEMA);
2718 }
2719
2720 @Override
2721 public SequencedMap<OnnxParameter, Object> onnxInputs() {
2722 return onnxInputs(SCHEMA, List.of(input()));
2723 }
2724
2725 public Value input() {
2726 return operands().get(0);
2727 }
2728
2729 public java.util.Optional<Float> seed() {
2730 Float seed = Attribute.seed.access(Float.class, onnxAttributes);
2731 return java.util.Optional.ofNullable(seed);
2732 }
2733
2734 public java.util.Optional<Long> dtype() {
2735 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes);
2736 return java.util.Optional.ofNullable(dtype);
2737 }
2738
2739 }
2740
2741 public static Bernoulli Bernoulli(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Long> dtype) {
2742 return new Bernoulli(resultType, input, seed, dtype);
2743 }
2744
2745 @OpFactoryHelper.OpDeclaration(Binarizer.NAME)
2746 public static final class Binarizer extends OnnxOp {
2747 public static final String NAME = "Binarizer";
2748
2749 public enum Attribute implements OnnxAttribute {
2750 threshold(Float.class, true, 0.0f),
2751 ;
2752
2753 final Class<?> t;
2754 final boolean optional;
2755 final Object defaultValue;
2756
2757 Attribute(Class<?> type, boolean optional, Object defaultValue) {
2758 this.t = type;
2759 this.optional = optional;
2760 this.defaultValue = defaultValue;
2761 assert optional || defaultValue == null;
2762 }
2763
2764 public Class<?> type() {
2765 return t;
2766 }
2767
2768 public boolean isOptional() {
2769 return optional;
2770 }
2771
2772 public Object defaultValue() {
2773 return defaultValue;
2774 }
2775 }
2776
2777 public enum TypeConstraint implements OnnxTypeConstraint {
2778 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
2779 ;
2780
2781 final OnnxType.TypeVariable typeVariable;
2782
2783 TypeConstraint(OnnxType.TypeVariable typeVariable) {
2784 assert typeVariable.name().equals(name());
2785 this.typeVariable = typeVariable;
2786 }
2787
2788 @Override
2789 public OnnxType.TypeVariable typeVariable() {
2790 return typeVariable;
2791 }
2792 }
2793
2794 public enum InputParameter implements OnnxParameter {
2795 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2796 ;
2797
2798 final OnnxType type;
2799 final Quantifier quantifier;
2800
2801 InputParameter(OnnxType type, Quantifier quantifier) {
2802 this.type = type;
2803 this.quantifier = quantifier;
2804 }
2805
2806 @Override
2807 public OnnxType type() {
2808 return type;
2809 }
2810
2811 @Override
2812 public Quantifier quantifier() {
2813 return quantifier;
2814 }
2815 }
2816
2817 public enum OutputParameter implements OnnxParameter {
2818 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2819 ;
2820
2821 final OnnxType type;
2822 final Quantifier quantifier;
2823
2824 OutputParameter(OnnxType type, Quantifier quantifier) {
2825 this.type = type;
2826 this.quantifier = quantifier;
2827 }
2828
2829 @Override
2830 public OnnxType type() {
2831 return type;
2832 }
2833
2834 @Override
2835 public Quantifier quantifier() {
2836 return quantifier;
2837 }
2838 }
2839
2840 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
2841 NAME,
2842 List.of(Attribute.values()),
2843 List.of(TypeConstraint.values()),
2844 List.of(InputParameter.values()),
2845 List.of(OutputParameter.values())
2846 );
2847
2848 public Binarizer(ExternalizedOp def) {
2849 super(SCHEMA, def);
2850 }
2851
2852 Binarizer(Binarizer that, CodeContext cc) {
2853 super(that, cc);
2854 }
2855
2856 @Override
2857 public Binarizer transform(CodeContext cc, CodeTransformer ot) {
2858 return new Binarizer(this, cc);
2859 }
2860
2861 Binarizer(TypeElement resultType, Value X, java.util.Optional<Float> threshold) {
2862 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(threshold));
2863 }
2864
2865 @Override
2866 public SequencedSet<OnnxParameter> onnxOutputs() {
2867 return onnxOutputs(SCHEMA);
2868 }
2869
2870 @Override
2871 public SequencedMap<OnnxParameter, Object> onnxInputs() {
2872 return onnxInputs(SCHEMA, List.of(X()));
2873 }
2874
2875 public Value X() {
2876 return operands().get(0);
2877 }
2878
2879 public java.util.Optional<Float> threshold() {
2880 Float threshold = Attribute.threshold.access(Float.class, onnxAttributes);
2881 return java.util.Optional.ofNullable(threshold);
2882 }
2883
2884 }
2885
2886 public static Binarizer Binarizer(TypeElement resultType, Value X, java.util.Optional<Float> threshold) {
2887 return new Binarizer(resultType, X, threshold);
2888 }
2889
2890 @OpFactoryHelper.OpDeclaration(BitShift.NAME)
2891 public static final class BitShift extends OnnxOp {
2892 public static final String NAME = "BitShift";
2893
2894 public enum Attribute implements OnnxAttribute {
2895 direction(String.class, false, null),
2896 ;
2897
2898 final Class<?> t;
2899 final boolean optional;
2900 final Object defaultValue;
2901
2902 Attribute(Class<?> type, boolean optional, Object defaultValue) {
2903 this.t = type;
2904 this.optional = optional;
2905 this.defaultValue = defaultValue;
2906 assert optional || defaultValue == null;
2907 }
2908
2909 public Class<?> type() {
2910 return t;
2911 }
2912
2913 public boolean isOptional() {
2914 return optional;
2915 }
2916
2917 public Object defaultValue() {
2918 return defaultValue;
2919 }
2920 }
2921
2922 public enum TypeConstraint implements OnnxTypeConstraint {
2923 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64())))),
2924 ;
2925
2926 final OnnxType.TypeVariable typeVariable;
2927
2928 TypeConstraint(OnnxType.TypeVariable typeVariable) {
2929 assert typeVariable.name().equals(name());
2930 this.typeVariable = typeVariable;
2931 }
2932
2933 @Override
2934 public OnnxType.TypeVariable typeVariable() {
2935 return typeVariable;
2936 }
2937 }
2938
2939 public enum InputParameter implements OnnxParameter {
2940 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2941 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2942 ;
2943
2944 final OnnxType type;
2945 final Quantifier quantifier;
2946
2947 InputParameter(OnnxType type, Quantifier quantifier) {
2948 this.type = type;
2949 this.quantifier = quantifier;
2950 }
2951
2952 @Override
2953 public OnnxType type() {
2954 return type;
2955 }
2956
2957 @Override
2958 public Quantifier quantifier() {
2959 return quantifier;
2960 }
2961 }
2962
2963 public enum OutputParameter implements OnnxParameter {
2964 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
2965 ;
2966
2967 final OnnxType type;
2968 final Quantifier quantifier;
2969
2970 OutputParameter(OnnxType type, Quantifier quantifier) {
2971 this.type = type;
2972 this.quantifier = quantifier;
2973 }
2974
2975 @Override
2976 public OnnxType type() {
2977 return type;
2978 }
2979
2980 @Override
2981 public Quantifier quantifier() {
2982 return quantifier;
2983 }
2984 }
2985
2986 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
2987 NAME,
2988 List.of(Attribute.values()),
2989 List.of(TypeConstraint.values()),
2990 List.of(InputParameter.values()),
2991 List.of(OutputParameter.values())
2992 );
2993
2994 public BitShift(ExternalizedOp def) {
2995 super(SCHEMA, def);
2996 }
2997
2998 BitShift(BitShift that, CodeContext cc) {
2999 super(that, cc);
3000 }
3001
3002 @Override
3003 public BitShift transform(CodeContext cc, CodeTransformer ot) {
3004 return new BitShift(this, cc);
3005 }
3006
3007 BitShift(TypeElement resultType, Value X, Value Y, String direction) {
3008 super(SCHEMA, resultType, Set.of(), List.of(X, Y), List.of(direction));
3009 }
3010
3011 @Override
3012 public SequencedSet<OnnxParameter> onnxOutputs() {
3013 return onnxOutputs(SCHEMA);
3014 }
3015
3016 @Override
3017 public SequencedMap<OnnxParameter, Object> onnxInputs() {
3018 return onnxInputs(SCHEMA, List.of(X(), Y()));
3019 }
3020
3021 public Value X() {
3022 return operands().get(0);
3023 }
3024
3025 public Value Y() {
3026 return operands().get(1);
3027 }
3028
3029 public String direction() {
3030 String direction = Attribute.direction.access(String.class, onnxAttributes);
3031 return direction;
3032 }
3033
3034 }
3035
3036 public static BitShift BitShift(TypeElement resultType, Value X, Value Y, String direction) {
3037 return new BitShift(resultType, X, Y, direction);
3038 }
3039
3040 @OpFactoryHelper.OpDeclaration(BitwiseAnd.NAME)
3041 public static final class BitwiseAnd extends OnnxOp {
3042 public static final String NAME = "BitwiseAnd";
3043
3044 public enum Attribute implements OnnxAttribute.None { }
3045
3046 public enum TypeConstraint implements OnnxTypeConstraint {
3047 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
3048 ;
3049
3050 final OnnxType.TypeVariable typeVariable;
3051
3052 TypeConstraint(OnnxType.TypeVariable typeVariable) {
3053 assert typeVariable.name().equals(name());
3054 this.typeVariable = typeVariable;
3055 }
3056
3057 @Override
3058 public OnnxType.TypeVariable typeVariable() {
3059 return typeVariable;
3060 }
3061 }
3062
3063 public enum InputParameter implements OnnxParameter {
3064 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3065 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3066 ;
3067
3068 final OnnxType type;
3069 final Quantifier quantifier;
3070
3071 InputParameter(OnnxType type, Quantifier quantifier) {
3072 this.type = type;
3073 this.quantifier = quantifier;
3074 }
3075
3076 @Override
3077 public OnnxType type() {
3078 return type;
3079 }
3080
3081 @Override
3082 public Quantifier quantifier() {
3083 return quantifier;
3084 }
3085 }
3086
3087 public enum OutputParameter implements OnnxParameter {
3088 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3089 ;
3090
3091 final OnnxType type;
3092 final Quantifier quantifier;
3093
3094 OutputParameter(OnnxType type, Quantifier quantifier) {
3095 this.type = type;
3096 this.quantifier = quantifier;
3097 }
3098
3099 @Override
3100 public OnnxType type() {
3101 return type;
3102 }
3103
3104 @Override
3105 public Quantifier quantifier() {
3106 return quantifier;
3107 }
3108 }
3109
3110 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
3111 NAME,
3112 List.of(Attribute.values()),
3113 List.of(TypeConstraint.values()),
3114 List.of(InputParameter.values()),
3115 List.of(OutputParameter.values())
3116 );
3117
3118 public BitwiseAnd(ExternalizedOp def) {
3119 super(SCHEMA, def);
3120 }
3121
3122 BitwiseAnd(BitwiseAnd that, CodeContext cc) {
3123 super(that, cc);
3124 }
3125
3126 @Override
3127 public BitwiseAnd transform(CodeContext cc, CodeTransformer ot) {
3128 return new BitwiseAnd(this, cc);
3129 }
3130
3131 BitwiseAnd(TypeElement resultType, Value A, Value B) {
3132 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
3133 }
3134
3135 @Override
3136 public SequencedSet<OnnxParameter> onnxOutputs() {
3137 return onnxOutputs(SCHEMA);
3138 }
3139
3140 @Override
3141 public SequencedMap<OnnxParameter, Object> onnxInputs() {
3142 return onnxInputs(SCHEMA, List.of(A(), B()));
3143 }
3144
3145 public Value A() {
3146 return operands().get(0);
3147 }
3148
3149 public Value B() {
3150 return operands().get(1);
3151 }
3152
3153 }
3154
3155 public static BitwiseAnd BitwiseAnd(TypeElement resultType, Value A, Value B) {
3156 return new BitwiseAnd(resultType, A, B);
3157 }
3158
3159 @OpFactoryHelper.OpDeclaration(BitwiseNot.NAME)
3160 public static final class BitwiseNot extends OnnxOp {
3161 public static final String NAME = "BitwiseNot";
3162
3163 public enum Attribute implements OnnxAttribute.None { }
3164
3165 public enum TypeConstraint implements OnnxTypeConstraint {
3166 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
3167 ;
3168
3169 final OnnxType.TypeVariable typeVariable;
3170
3171 TypeConstraint(OnnxType.TypeVariable typeVariable) {
3172 assert typeVariable.name().equals(name());
3173 this.typeVariable = typeVariable;
3174 }
3175
3176 @Override
3177 public OnnxType.TypeVariable typeVariable() {
3178 return typeVariable;
3179 }
3180 }
3181
3182 public enum InputParameter implements OnnxParameter {
3183 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3184 ;
3185
3186 final OnnxType type;
3187 final Quantifier quantifier;
3188
3189 InputParameter(OnnxType type, Quantifier quantifier) {
3190 this.type = type;
3191 this.quantifier = quantifier;
3192 }
3193
3194 @Override
3195 public OnnxType type() {
3196 return type;
3197 }
3198
3199 @Override
3200 public Quantifier quantifier() {
3201 return quantifier;
3202 }
3203 }
3204
3205 public enum OutputParameter implements OnnxParameter {
3206 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3207 ;
3208
3209 final OnnxType type;
3210 final Quantifier quantifier;
3211
3212 OutputParameter(OnnxType type, Quantifier quantifier) {
3213 this.type = type;
3214 this.quantifier = quantifier;
3215 }
3216
3217 @Override
3218 public OnnxType type() {
3219 return type;
3220 }
3221
3222 @Override
3223 public Quantifier quantifier() {
3224 return quantifier;
3225 }
3226 }
3227
3228 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
3229 NAME,
3230 List.of(Attribute.values()),
3231 List.of(TypeConstraint.values()),
3232 List.of(InputParameter.values()),
3233 List.of(OutputParameter.values())
3234 );
3235
3236 public BitwiseNot(ExternalizedOp def) {
3237 super(SCHEMA, def);
3238 }
3239
3240 BitwiseNot(BitwiseNot that, CodeContext cc) {
3241 super(that, cc);
3242 }
3243
3244 @Override
3245 public BitwiseNot transform(CodeContext cc, CodeTransformer ot) {
3246 return new BitwiseNot(this, cc);
3247 }
3248
3249 BitwiseNot(TypeElement resultType, Value X) {
3250 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
3251 }
3252
3253 @Override
3254 public SequencedSet<OnnxParameter> onnxOutputs() {
3255 return onnxOutputs(SCHEMA);
3256 }
3257
3258 @Override
3259 public SequencedMap<OnnxParameter, Object> onnxInputs() {
3260 return onnxInputs(SCHEMA, List.of(X()));
3261 }
3262
3263 public Value X() {
3264 return operands().get(0);
3265 }
3266
3267 }
3268
3269 public static BitwiseNot BitwiseNot(TypeElement resultType, Value X) {
3270 return new BitwiseNot(resultType, X);
3271 }
3272
3273 @OpFactoryHelper.OpDeclaration(BitwiseOr.NAME)
3274 public static final class BitwiseOr extends OnnxOp {
3275 public static final String NAME = "BitwiseOr";
3276
3277 public enum Attribute implements OnnxAttribute.None { }
3278
3279 public enum TypeConstraint implements OnnxTypeConstraint {
3280 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
3281 ;
3282
3283 final OnnxType.TypeVariable typeVariable;
3284
3285 TypeConstraint(OnnxType.TypeVariable typeVariable) {
3286 assert typeVariable.name().equals(name());
3287 this.typeVariable = typeVariable;
3288 }
3289
3290 @Override
3291 public OnnxType.TypeVariable typeVariable() {
3292 return typeVariable;
3293 }
3294 }
3295
3296 public enum InputParameter implements OnnxParameter {
3297 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3298 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3299 ;
3300
3301 final OnnxType type;
3302 final Quantifier quantifier;
3303
3304 InputParameter(OnnxType type, Quantifier quantifier) {
3305 this.type = type;
3306 this.quantifier = quantifier;
3307 }
3308
3309 @Override
3310 public OnnxType type() {
3311 return type;
3312 }
3313
3314 @Override
3315 public Quantifier quantifier() {
3316 return quantifier;
3317 }
3318 }
3319
3320 public enum OutputParameter implements OnnxParameter {
3321 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3322 ;
3323
3324 final OnnxType type;
3325 final Quantifier quantifier;
3326
3327 OutputParameter(OnnxType type, Quantifier quantifier) {
3328 this.type = type;
3329 this.quantifier = quantifier;
3330 }
3331
3332 @Override
3333 public OnnxType type() {
3334 return type;
3335 }
3336
3337 @Override
3338 public Quantifier quantifier() {
3339 return quantifier;
3340 }
3341 }
3342
3343 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
3344 NAME,
3345 List.of(Attribute.values()),
3346 List.of(TypeConstraint.values()),
3347 List.of(InputParameter.values()),
3348 List.of(OutputParameter.values())
3349 );
3350
3351 public BitwiseOr(ExternalizedOp def) {
3352 super(SCHEMA, def);
3353 }
3354
3355 BitwiseOr(BitwiseOr that, CodeContext cc) {
3356 super(that, cc);
3357 }
3358
3359 @Override
3360 public BitwiseOr transform(CodeContext cc, CodeTransformer ot) {
3361 return new BitwiseOr(this, cc);
3362 }
3363
3364 BitwiseOr(TypeElement resultType, Value A, Value B) {
3365 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
3366 }
3367
3368 @Override
3369 public SequencedSet<OnnxParameter> onnxOutputs() {
3370 return onnxOutputs(SCHEMA);
3371 }
3372
3373 @Override
3374 public SequencedMap<OnnxParameter, Object> onnxInputs() {
3375 return onnxInputs(SCHEMA, List.of(A(), B()));
3376 }
3377
3378 public Value A() {
3379 return operands().get(0);
3380 }
3381
3382 public Value B() {
3383 return operands().get(1);
3384 }
3385
3386 }
3387
3388 public static BitwiseOr BitwiseOr(TypeElement resultType, Value A, Value B) {
3389 return new BitwiseOr(resultType, A, B);
3390 }
3391
3392 @OpFactoryHelper.OpDeclaration(BitwiseXor.NAME)
3393 public static final class BitwiseXor extends OnnxOp {
3394 public static final String NAME = "BitwiseXor";
3395
3396 public enum Attribute implements OnnxAttribute.None { }
3397
3398 public enum TypeConstraint implements OnnxTypeConstraint {
3399 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
3400 ;
3401
3402 final OnnxType.TypeVariable typeVariable;
3403
3404 TypeConstraint(OnnxType.TypeVariable typeVariable) {
3405 assert typeVariable.name().equals(name());
3406 this.typeVariable = typeVariable;
3407 }
3408
3409 @Override
3410 public OnnxType.TypeVariable typeVariable() {
3411 return typeVariable;
3412 }
3413 }
3414
3415 public enum InputParameter implements OnnxParameter {
3416 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3417 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3418 ;
3419
3420 final OnnxType type;
3421 final Quantifier quantifier;
3422
3423 InputParameter(OnnxType type, Quantifier quantifier) {
3424 this.type = type;
3425 this.quantifier = quantifier;
3426 }
3427
3428 @Override
3429 public OnnxType type() {
3430 return type;
3431 }
3432
3433 @Override
3434 public Quantifier quantifier() {
3435 return quantifier;
3436 }
3437 }
3438
3439 public enum OutputParameter implements OnnxParameter {
3440 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
3441 ;
3442
3443 final OnnxType type;
3444 final Quantifier quantifier;
3445
3446 OutputParameter(OnnxType type, Quantifier quantifier) {
3447 this.type = type;
3448 this.quantifier = quantifier;
3449 }
3450
3451 @Override
3452 public OnnxType type() {
3453 return type;
3454 }
3455
3456 @Override
3457 public Quantifier quantifier() {
3458 return quantifier;
3459 }
3460 }
3461
3462 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
3463 NAME,
3464 List.of(Attribute.values()),
3465 List.of(TypeConstraint.values()),
3466 List.of(InputParameter.values()),
3467 List.of(OutputParameter.values())
3468 );
3469
3470 public BitwiseXor(ExternalizedOp def) {
3471 super(SCHEMA, def);
3472 }
3473
3474 BitwiseXor(BitwiseXor that, CodeContext cc) {
3475 super(that, cc);
3476 }
3477
3478 @Override
3479 public BitwiseXor transform(CodeContext cc, CodeTransformer ot) {
3480 return new BitwiseXor(this, cc);
3481 }
3482
3483 BitwiseXor(TypeElement resultType, Value A, Value B) {
3484 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
3485 }
3486
3487 @Override
3488 public SequencedSet<OnnxParameter> onnxOutputs() {
3489 return onnxOutputs(SCHEMA);
3490 }
3491
3492 @Override
3493 public SequencedMap<OnnxParameter, Object> onnxInputs() {
3494 return onnxInputs(SCHEMA, List.of(A(), B()));
3495 }
3496
3497 public Value A() {
3498 return operands().get(0);
3499 }
3500
3501 public Value B() {
3502 return operands().get(1);
3503 }
3504
3505 }
3506
3507 public static BitwiseXor BitwiseXor(TypeElement resultType, Value A, Value B) {
3508 return new BitwiseXor(resultType, A, B);
3509 }
3510
3511 @OpFactoryHelper.OpDeclaration(BlackmanWindow.NAME)
3512 public static final class BlackmanWindow extends OnnxOp {
3513 public static final String NAME = "BlackmanWindow";
3514
3515 public enum Attribute implements OnnxAttribute {
3516 periodic(Long.class, true, 1),
3517 output_datatype(Long.class, true, 1),
3518 ;
3519
3520 final Class<?> t;
3521 final boolean optional;
3522 final Object defaultValue;
3523
3524 Attribute(Class<?> type, boolean optional, Object defaultValue) {
3525 this.t = type;
3526 this.optional = optional;
3527 this.defaultValue = defaultValue;
3528 assert optional || defaultValue == null;
3529 }
3530
3531 public Class<?> type() {
3532 return t;
3533 }
3534
3535 public boolean isOptional() {
3536 return optional;
3537 }
3538
3539 public Object defaultValue() {
3540 return defaultValue;
3541 }
3542 }
3543
3544 public enum TypeConstraint implements OnnxTypeConstraint {
3545 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
3546 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
3547 ;
3548
3549 final OnnxType.TypeVariable typeVariable;
3550
3551 TypeConstraint(OnnxType.TypeVariable typeVariable) {
3552 assert typeVariable.name().equals(name());
3553 this.typeVariable = typeVariable;
3554 }
3555
3556 @Override
3557 public OnnxType.TypeVariable typeVariable() {
3558 return typeVariable;
3559 }
3560 }
3561
3562 public enum InputParameter implements OnnxParameter {
3563 size(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
3564 ;
3565
3566 final OnnxType type;
3567 final Quantifier quantifier;
3568
3569 InputParameter(OnnxType type, Quantifier quantifier) {
3570 this.type = type;
3571 this.quantifier = quantifier;
3572 }
3573
3574 @Override
3575 public OnnxType type() {
3576 return type;
3577 }
3578
3579 @Override
3580 public Quantifier quantifier() {
3581 return quantifier;
3582 }
3583 }
3584
3585 public enum OutputParameter implements OnnxParameter {
3586 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
3587 ;
3588
3589 final OnnxType type;
3590 final Quantifier quantifier;
3591
3592 OutputParameter(OnnxType type, Quantifier quantifier) {
3593 this.type = type;
3594 this.quantifier = quantifier;
3595 }
3596
3597 @Override
3598 public OnnxType type() {
3599 return type;
3600 }
3601
3602 @Override
3603 public Quantifier quantifier() {
3604 return quantifier;
3605 }
3606 }
3607
3608 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
3609 NAME,
3610 List.of(Attribute.values()),
3611 List.of(TypeConstraint.values()),
3612 List.of(InputParameter.values()),
3613 List.of(OutputParameter.values())
3614 );
3615
3616 public BlackmanWindow(ExternalizedOp def) {
3617 super(SCHEMA, def);
3618 }
3619
3620 BlackmanWindow(BlackmanWindow that, CodeContext cc) {
3621 super(that, cc);
3622 }
3623
3624 @Override
3625 public BlackmanWindow transform(CodeContext cc, CodeTransformer ot) {
3626 return new BlackmanWindow(this, cc);
3627 }
3628
3629 BlackmanWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) {
3630 super(SCHEMA, resultType, Set.of(), List.of(size), List.of(periodic, output_datatype));
3631 }
3632
3633 @Override
3634 public SequencedSet<OnnxParameter> onnxOutputs() {
3635 return onnxOutputs(SCHEMA);
3636 }
3637
3638 @Override
3639 public SequencedMap<OnnxParameter, Object> onnxInputs() {
3640 return onnxInputs(SCHEMA, List.of(size()));
3641 }
3642
3643 public Value size() {
3644 return operands().get(0);
3645 }
3646
3647 public java.util.Optional<Long> periodic() {
3648 Long periodic = Attribute.periodic.access(Long.class, onnxAttributes);
3649 return java.util.Optional.ofNullable(periodic);
3650 }
3651
3652 public java.util.Optional<Long> output_datatype() {
3653 Long output_datatype = Attribute.output_datatype.access(Long.class, onnxAttributes);
3654 return java.util.Optional.ofNullable(output_datatype);
3655 }
3656
3657 }
3658
3659 public static BlackmanWindow BlackmanWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) {
3660 return new BlackmanWindow(resultType, size, periodic, output_datatype);
3661 }
3662
3663 @OpFactoryHelper.OpDeclaration(Cast.NAME)
3664 public static final class Cast extends OnnxOp {
3665 public static final String NAME = "Cast";
3666
3667 public enum Attribute implements OnnxAttribute {
3668 saturate(Long.class, true, 1),
3669 to(Long.class, false, null),
3670 round_mode(String.class, true, "up"),
3671 ;
3672
3673 final Class<?> t;
3674 final boolean optional;
3675 final Object defaultValue;
3676
3677 Attribute(Class<?> type, boolean optional, Object defaultValue) {
3678 this.t = type;
3679 this.optional = optional;
3680 this.defaultValue = defaultValue;
3681 assert optional || defaultValue == null;
3682 }
3683
3684 public Class<?> type() {
3685 return t;
3686 }
3687
3688 public boolean isOptional() {
3689 return optional;
3690 }
3691
3692 public Object defaultValue() {
3693 return defaultValue;
3694 }
3695 }
3696
3697 public enum TypeConstraint implements OnnxTypeConstraint {
3698 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
3699 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
3700 ;
3701
3702 final OnnxType.TypeVariable typeVariable;
3703
3704 TypeConstraint(OnnxType.TypeVariable typeVariable) {
3705 assert typeVariable.name().equals(name());
3706 this.typeVariable = typeVariable;
3707 }
3708
3709 @Override
3710 public OnnxType.TypeVariable typeVariable() {
3711 return typeVariable;
3712 }
3713 }
3714
3715 public enum InputParameter implements OnnxParameter {
3716 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
3717 ;
3718
3719 final OnnxType type;
3720 final Quantifier quantifier;
3721
3722 InputParameter(OnnxType type, Quantifier quantifier) {
3723 this.type = type;
3724 this.quantifier = quantifier;
3725 }
3726
3727 @Override
3728 public OnnxType type() {
3729 return type;
3730 }
3731
3732 @Override
3733 public Quantifier quantifier() {
3734 return quantifier;
3735 }
3736 }
3737
3738 public enum OutputParameter implements OnnxParameter {
3739 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
3740 ;
3741
3742 final OnnxType type;
3743 final Quantifier quantifier;
3744
3745 OutputParameter(OnnxType type, Quantifier quantifier) {
3746 this.type = type;
3747 this.quantifier = quantifier;
3748 }
3749
3750 @Override
3751 public OnnxType type() {
3752 return type;
3753 }
3754
3755 @Override
3756 public Quantifier quantifier() {
3757 return quantifier;
3758 }
3759 }
3760
3761 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
3762 NAME,
3763 List.of(Attribute.values()),
3764 List.of(TypeConstraint.values()),
3765 List.of(InputParameter.values()),
3766 List.of(OutputParameter.values())
3767 );
3768
3769 public Cast(ExternalizedOp def) {
3770 super(SCHEMA, def);
3771 }
3772
3773 Cast(Cast that, CodeContext cc) {
3774 super(that, cc);
3775 }
3776
3777 @Override
3778 public Cast transform(CodeContext cc, CodeTransformer ot) {
3779 return new Cast(this, cc);
3780 }
3781
3782 Cast(TypeElement resultType, Value input, java.util.Optional<Long> saturate, long to, java.util.Optional<String> round_mode) {
3783 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(saturate, to, round_mode));
3784 }
3785
3786 @Override
3787 public SequencedSet<OnnxParameter> onnxOutputs() {
3788 return onnxOutputs(SCHEMA);
3789 }
3790
3791 @Override
3792 public SequencedMap<OnnxParameter, Object> onnxInputs() {
3793 return onnxInputs(SCHEMA, List.of(input()));
3794 }
3795
3796 public Value input() {
3797 return operands().get(0);
3798 }
3799
3800 public java.util.Optional<Long> saturate() {
3801 Long saturate = Attribute.saturate.access(Long.class, onnxAttributes);
3802 return java.util.Optional.ofNullable(saturate);
3803 }
3804
3805 public long to() {
3806 long to = Attribute.to.access(Long.class, onnxAttributes);
3807 return to;
3808 }
3809
3810 public java.util.Optional<String> round_mode() {
3811 String round_mode = Attribute.round_mode.access(String.class, onnxAttributes);
3812 return java.util.Optional.ofNullable(round_mode);
3813 }
3814
3815 }
3816
3817 public static Cast Cast(TypeElement resultType, Value input, java.util.Optional<Long> saturate, long to, java.util.Optional<String> round_mode) {
3818 return new Cast(resultType, input, saturate, to, round_mode);
3819 }
3820
3821 @OpFactoryHelper.OpDeclaration(CastLike.NAME)
3822 public static final class CastLike extends OnnxOp {
3823 public static final String NAME = "CastLike";
3824
3825 public enum Attribute implements OnnxAttribute {
3826 saturate(Long.class, true, 1),
3827 round_mode(String.class, true, "up"),
3828 ;
3829
3830 final Class<?> t;
3831 final boolean optional;
3832 final Object defaultValue;
3833
3834 Attribute(Class<?> type, boolean optional, Object defaultValue) {
3835 this.t = type;
3836 this.optional = optional;
3837 this.defaultValue = defaultValue;
3838 assert optional || defaultValue == null;
3839 }
3840
3841 public Class<?> type() {
3842 return t;
3843 }
3844
3845 public boolean isOptional() {
3846 return optional;
3847 }
3848
3849 public Object defaultValue() {
3850 return defaultValue;
3851 }
3852 }
3853
3854 public enum TypeConstraint implements OnnxTypeConstraint {
3855 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
3856 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
3857 ;
3858
3859 final OnnxType.TypeVariable typeVariable;
3860
3861 TypeConstraint(OnnxType.TypeVariable typeVariable) {
3862 assert typeVariable.name().equals(name());
3863 this.typeVariable = typeVariable;
3864 }
3865
3866 @Override
3867 public OnnxType.TypeVariable typeVariable() {
3868 return typeVariable;
3869 }
3870 }
3871
3872 public enum InputParameter implements OnnxParameter {
3873 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
3874 target_type(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
3875 ;
3876
3877 final OnnxType type;
3878 final Quantifier quantifier;
3879
3880 InputParameter(OnnxType type, Quantifier quantifier) {
3881 this.type = type;
3882 this.quantifier = quantifier;
3883 }
3884
3885 @Override
3886 public OnnxType type() {
3887 return type;
3888 }
3889
3890 @Override
3891 public Quantifier quantifier() {
3892 return quantifier;
3893 }
3894 }
3895
3896 public enum OutputParameter implements OnnxParameter {
3897 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
3898 ;
3899
3900 final OnnxType type;
3901 final Quantifier quantifier;
3902
3903 OutputParameter(OnnxType type, Quantifier quantifier) {
3904 this.type = type;
3905 this.quantifier = quantifier;
3906 }
3907
3908 @Override
3909 public OnnxType type() {
3910 return type;
3911 }
3912
3913 @Override
3914 public Quantifier quantifier() {
3915 return quantifier;
3916 }
3917 }
3918
3919 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
3920 NAME,
3921 List.of(Attribute.values()),
3922 List.of(TypeConstraint.values()),
3923 List.of(InputParameter.values()),
3924 List.of(OutputParameter.values())
3925 );
3926
3927 public CastLike(ExternalizedOp def) {
3928 super(SCHEMA, def);
3929 }
3930
3931 CastLike(CastLike that, CodeContext cc) {
3932 super(that, cc);
3933 }
3934
3935 @Override
3936 public CastLike transform(CodeContext cc, CodeTransformer ot) {
3937 return new CastLike(this, cc);
3938 }
3939
3940 CastLike(TypeElement resultType, Value input, Value target_type, java.util.Optional<Long> saturate, java.util.Optional<String> round_mode) {
3941 super(SCHEMA, resultType, Set.of(), List.of(input, target_type), List.of(saturate, round_mode));
3942 }
3943
3944 @Override
3945 public SequencedSet<OnnxParameter> onnxOutputs() {
3946 return onnxOutputs(SCHEMA);
3947 }
3948
3949 @Override
3950 public SequencedMap<OnnxParameter, Object> onnxInputs() {
3951 return onnxInputs(SCHEMA, List.of(input(), target_type()));
3952 }
3953
3954 public Value input() {
3955 return operands().get(0);
3956 }
3957
3958 public Value target_type() {
3959 return operands().get(1);
3960 }
3961
3962 public java.util.Optional<Long> saturate() {
3963 Long saturate = Attribute.saturate.access(Long.class, onnxAttributes);
3964 return java.util.Optional.ofNullable(saturate);
3965 }
3966
3967 public java.util.Optional<String> round_mode() {
3968 String round_mode = Attribute.round_mode.access(String.class, onnxAttributes);
3969 return java.util.Optional.ofNullable(round_mode);
3970 }
3971
3972 }
3973
3974 public static CastLike CastLike(TypeElement resultType, Value input, Value target_type, java.util.Optional<Long> saturate, java.util.Optional<String> round_mode) {
3975 return new CastLike(resultType, input, target_type, saturate, round_mode);
3976 }
3977
3978 @OpFactoryHelper.OpDeclaration(CastMap.NAME)
3979 public static final class CastMap extends OnnxOp {
3980 public static final String NAME = "CastMap";
3981
3982 public enum Attribute implements OnnxAttribute {
3983 map_form(String.class, true, "DENSE"),
3984 cast_to(String.class, true, "TO_FLOAT"),
3985 max_map(Long.class, true, 1),
3986 ;
3987
3988 final Class<?> t;
3989 final boolean optional;
3990 final Object defaultValue;
3991
3992 Attribute(Class<?> type, boolean optional, Object defaultValue) {
3993 this.t = type;
3994 this.optional = optional;
3995 this.defaultValue = defaultValue;
3996 assert optional || defaultValue == null;
3997 }
3998
3999 public Class<?> type() {
4000 return t;
4001 }
4002
4003 public boolean isOptional() {
4004 return optional;
4005 }
4006
4007 public Object defaultValue() {
4008 return defaultValue;
4009 }
4010 }
4011
4012 public enum TypeConstraint implements OnnxTypeConstraint {
4013 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.map(OnnxType.int64(), OnnxType.string()), OnnxType.map(OnnxType.int64(), OnnxType.float32())))),
4014 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.int64())))),
4015 ;
4016
4017 final OnnxType.TypeVariable typeVariable;
4018
4019 TypeConstraint(OnnxType.TypeVariable typeVariable) {
4020 assert typeVariable.name().equals(name());
4021 this.typeVariable = typeVariable;
4022 }
4023
4024 @Override
4025 public OnnxType.TypeVariable typeVariable() {
4026 return typeVariable;
4027 }
4028 }
4029
4030 public enum InputParameter implements OnnxParameter {
4031 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
4032 ;
4033
4034 final OnnxType type;
4035 final Quantifier quantifier;
4036
4037 InputParameter(OnnxType type, Quantifier quantifier) {
4038 this.type = type;
4039 this.quantifier = quantifier;
4040 }
4041
4042 @Override
4043 public OnnxType type() {
4044 return type;
4045 }
4046
4047 @Override
4048 public Quantifier quantifier() {
4049 return quantifier;
4050 }
4051 }
4052
4053 public enum OutputParameter implements OnnxParameter {
4054 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
4055 ;
4056
4057 final OnnxType type;
4058 final Quantifier quantifier;
4059
4060 OutputParameter(OnnxType type, Quantifier quantifier) {
4061 this.type = type;
4062 this.quantifier = quantifier;
4063 }
4064
4065 @Override
4066 public OnnxType type() {
4067 return type;
4068 }
4069
4070 @Override
4071 public Quantifier quantifier() {
4072 return quantifier;
4073 }
4074 }
4075
4076 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
4077 NAME,
4078 List.of(Attribute.values()),
4079 List.of(TypeConstraint.values()),
4080 List.of(InputParameter.values()),
4081 List.of(OutputParameter.values())
4082 );
4083
4084 public CastMap(ExternalizedOp def) {
4085 super(SCHEMA, def);
4086 }
4087
4088 CastMap(CastMap that, CodeContext cc) {
4089 super(that, cc);
4090 }
4091
4092 @Override
4093 public CastMap transform(CodeContext cc, CodeTransformer ot) {
4094 return new CastMap(this, cc);
4095 }
4096
4097 CastMap(TypeElement resultType, Value X, java.util.Optional<String> map_form, java.util.Optional<String> cast_to, java.util.Optional<Long> max_map) {
4098 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(map_form, cast_to, max_map));
4099 }
4100
4101 @Override
4102 public SequencedSet<OnnxParameter> onnxOutputs() {
4103 return onnxOutputs(SCHEMA);
4104 }
4105
4106 @Override
4107 public SequencedMap<OnnxParameter, Object> onnxInputs() {
4108 return onnxInputs(SCHEMA, List.of(X()));
4109 }
4110
4111 public Value X() {
4112 return operands().get(0);
4113 }
4114
4115 public java.util.Optional<String> map_form() {
4116 String map_form = Attribute.map_form.access(String.class, onnxAttributes);
4117 return java.util.Optional.ofNullable(map_form);
4118 }
4119
4120 public java.util.Optional<String> cast_to() {
4121 String cast_to = Attribute.cast_to.access(String.class, onnxAttributes);
4122 return java.util.Optional.ofNullable(cast_to);
4123 }
4124
4125 public java.util.Optional<Long> max_map() {
4126 Long max_map = Attribute.max_map.access(Long.class, onnxAttributes);
4127 return java.util.Optional.ofNullable(max_map);
4128 }
4129
4130 }
4131
4132 public static CastMap CastMap(TypeElement resultType, Value X, java.util.Optional<String> map_form, java.util.Optional<String> cast_to, java.util.Optional<Long> max_map) {
4133 return new CastMap(resultType, X, map_form, cast_to, max_map);
4134 }
4135
4136 @OpFactoryHelper.OpDeclaration(CategoryMapper.NAME)
4137 public static final class CategoryMapper extends OnnxOp {
4138 public static final String NAME = "CategoryMapper";
4139
4140 public enum Attribute implements OnnxAttribute {
4141 cats_int64s(long[].class, true, null),
4142 cats_strings(String[].class, true, null),
4143 default_int64(Long.class, true, -1),
4144 default_string(String.class, true, "_Unused"),
4145 ;
4146
4147 final Class<?> t;
4148 final boolean optional;
4149 final Object defaultValue;
4150
4151 Attribute(Class<?> type, boolean optional, Object defaultValue) {
4152 this.t = type;
4153 this.optional = optional;
4154 this.defaultValue = defaultValue;
4155 assert optional || defaultValue == null;
4156 }
4157
4158 public Class<?> type() {
4159 return t;
4160 }
4161
4162 public boolean isOptional() {
4163 return optional;
4164 }
4165
4166 public Object defaultValue() {
4167 return defaultValue;
4168 }
4169 }
4170
4171 public enum TypeConstraint implements OnnxTypeConstraint {
4172 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))),
4173 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))),
4174 ;
4175
4176 final OnnxType.TypeVariable typeVariable;
4177
4178 TypeConstraint(OnnxType.TypeVariable typeVariable) {
4179 assert typeVariable.name().equals(name());
4180 this.typeVariable = typeVariable;
4181 }
4182
4183 @Override
4184 public OnnxType.TypeVariable typeVariable() {
4185 return typeVariable;
4186 }
4187 }
4188
4189 public enum InputParameter implements OnnxParameter {
4190 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
4191 ;
4192
4193 final OnnxType type;
4194 final Quantifier quantifier;
4195
4196 InputParameter(OnnxType type, Quantifier quantifier) {
4197 this.type = type;
4198 this.quantifier = quantifier;
4199 }
4200
4201 @Override
4202 public OnnxType type() {
4203 return type;
4204 }
4205
4206 @Override
4207 public Quantifier quantifier() {
4208 return quantifier;
4209 }
4210 }
4211
4212 public enum OutputParameter implements OnnxParameter {
4213 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
4214 ;
4215
4216 final OnnxType type;
4217 final Quantifier quantifier;
4218
4219 OutputParameter(OnnxType type, Quantifier quantifier) {
4220 this.type = type;
4221 this.quantifier = quantifier;
4222 }
4223
4224 @Override
4225 public OnnxType type() {
4226 return type;
4227 }
4228
4229 @Override
4230 public Quantifier quantifier() {
4231 return quantifier;
4232 }
4233 }
4234
4235 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
4236 NAME,
4237 List.of(Attribute.values()),
4238 List.of(TypeConstraint.values()),
4239 List.of(InputParameter.values()),
4240 List.of(OutputParameter.values())
4241 );
4242
4243 public CategoryMapper(ExternalizedOp def) {
4244 super(SCHEMA, def);
4245 }
4246
4247 CategoryMapper(CategoryMapper that, CodeContext cc) {
4248 super(that, cc);
4249 }
4250
4251 @Override
4252 public CategoryMapper transform(CodeContext cc, CodeTransformer ot) {
4253 return new CategoryMapper(this, cc);
4254 }
4255
4256 CategoryMapper(TypeElement resultType, Value X, java.util.Optional<long[]> cats_int64s, java.util.Optional<String[]> cats_strings, java.util.Optional<Long> default_int64, java.util.Optional<String> default_string) {
4257 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(cats_int64s, cats_strings, default_int64, default_string));
4258 }
4259
4260 @Override
4261 public SequencedSet<OnnxParameter> onnxOutputs() {
4262 return onnxOutputs(SCHEMA);
4263 }
4264
4265 @Override
4266 public SequencedMap<OnnxParameter, Object> onnxInputs() {
4267 return onnxInputs(SCHEMA, List.of(X()));
4268 }
4269
4270 public Value X() {
4271 return operands().get(0);
4272 }
4273
4274 public java.util.Optional<long[]> cats_int64s() {
4275 long[] cats_int64s = Attribute.cats_int64s.access(long[].class, onnxAttributes);
4276 return java.util.Optional.ofNullable(cats_int64s).map(long[]::clone);
4277 }
4278
4279 public java.util.Optional<String[]> cats_strings() {
4280 String[] cats_strings = Attribute.cats_strings.access(String[].class, onnxAttributes);
4281 return java.util.Optional.ofNullable(cats_strings).map(String[]::clone);
4282 }
4283
4284 public java.util.Optional<Long> default_int64() {
4285 Long default_int64 = Attribute.default_int64.access(Long.class, onnxAttributes);
4286 return java.util.Optional.ofNullable(default_int64);
4287 }
4288
4289 public java.util.Optional<String> default_string() {
4290 String default_string = Attribute.default_string.access(String.class, onnxAttributes);
4291 return java.util.Optional.ofNullable(default_string);
4292 }
4293
4294 }
4295
4296 public static CategoryMapper CategoryMapper(TypeElement resultType, Value X, java.util.Optional<long[]> cats_int64s, java.util.Optional<String[]> cats_strings, java.util.Optional<Long> default_int64, java.util.Optional<String> default_string) {
4297 return new CategoryMapper(resultType, X, cats_int64s, cats_strings, default_int64, default_string);
4298 }
4299
4300 @OpFactoryHelper.OpDeclaration(Ceil.NAME)
4301 public static final class Ceil extends OnnxOp {
4302 public static final String NAME = "Ceil";
4303
4304 public enum Attribute implements OnnxAttribute.None { }
4305
4306 public enum TypeConstraint implements OnnxTypeConstraint {
4307 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
4308 ;
4309
4310 final OnnxType.TypeVariable typeVariable;
4311
4312 TypeConstraint(OnnxType.TypeVariable typeVariable) {
4313 assert typeVariable.name().equals(name());
4314 this.typeVariable = typeVariable;
4315 }
4316
4317 @Override
4318 public OnnxType.TypeVariable typeVariable() {
4319 return typeVariable;
4320 }
4321 }
4322
4323 public enum InputParameter implements OnnxParameter {
4324 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4325 ;
4326
4327 final OnnxType type;
4328 final Quantifier quantifier;
4329
4330 InputParameter(OnnxType type, Quantifier quantifier) {
4331 this.type = type;
4332 this.quantifier = quantifier;
4333 }
4334
4335 @Override
4336 public OnnxType type() {
4337 return type;
4338 }
4339
4340 @Override
4341 public Quantifier quantifier() {
4342 return quantifier;
4343 }
4344 }
4345
4346 public enum OutputParameter implements OnnxParameter {
4347 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4348 ;
4349
4350 final OnnxType type;
4351 final Quantifier quantifier;
4352
4353 OutputParameter(OnnxType type, Quantifier quantifier) {
4354 this.type = type;
4355 this.quantifier = quantifier;
4356 }
4357
4358 @Override
4359 public OnnxType type() {
4360 return type;
4361 }
4362
4363 @Override
4364 public Quantifier quantifier() {
4365 return quantifier;
4366 }
4367 }
4368
4369 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
4370 NAME,
4371 List.of(Attribute.values()),
4372 List.of(TypeConstraint.values()),
4373 List.of(InputParameter.values()),
4374 List.of(OutputParameter.values())
4375 );
4376
4377 public Ceil(ExternalizedOp def) {
4378 super(SCHEMA, def);
4379 }
4380
4381 Ceil(Ceil that, CodeContext cc) {
4382 super(that, cc);
4383 }
4384
4385 @Override
4386 public Ceil transform(CodeContext cc, CodeTransformer ot) {
4387 return new Ceil(this, cc);
4388 }
4389
4390 Ceil(TypeElement resultType, Value X) {
4391 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
4392 }
4393
4394 @Override
4395 public SequencedSet<OnnxParameter> onnxOutputs() {
4396 return onnxOutputs(SCHEMA);
4397 }
4398
4399 @Override
4400 public SequencedMap<OnnxParameter, Object> onnxInputs() {
4401 return onnxInputs(SCHEMA, List.of(X()));
4402 }
4403
4404 public Value X() {
4405 return operands().get(0);
4406 }
4407
4408 }
4409
4410 public static Ceil Ceil(TypeElement resultType, Value X) {
4411 return new Ceil(resultType, X);
4412 }
4413
4414 @OpFactoryHelper.OpDeclaration(Celu.NAME)
4415 public static final class Celu extends OnnxOp {
4416 public static final String NAME = "Celu";
4417
4418 public enum Attribute implements OnnxAttribute {
4419 alpha(Float.class, true, 1.0f),
4420 ;
4421
4422 final Class<?> t;
4423 final boolean optional;
4424 final Object defaultValue;
4425
4426 Attribute(Class<?> type, boolean optional, Object defaultValue) {
4427 this.t = type;
4428 this.optional = optional;
4429 this.defaultValue = defaultValue;
4430 assert optional || defaultValue == null;
4431 }
4432
4433 public Class<?> type() {
4434 return t;
4435 }
4436
4437 public boolean isOptional() {
4438 return optional;
4439 }
4440
4441 public Object defaultValue() {
4442 return defaultValue;
4443 }
4444 }
4445
4446 public enum TypeConstraint implements OnnxTypeConstraint {
4447 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32())))),
4448 ;
4449
4450 final OnnxType.TypeVariable typeVariable;
4451
4452 TypeConstraint(OnnxType.TypeVariable typeVariable) {
4453 assert typeVariable.name().equals(name());
4454 this.typeVariable = typeVariable;
4455 }
4456
4457 @Override
4458 public OnnxType.TypeVariable typeVariable() {
4459 return typeVariable;
4460 }
4461 }
4462
4463 public enum InputParameter implements OnnxParameter {
4464 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4465 ;
4466
4467 final OnnxType type;
4468 final Quantifier quantifier;
4469
4470 InputParameter(OnnxType type, Quantifier quantifier) {
4471 this.type = type;
4472 this.quantifier = quantifier;
4473 }
4474
4475 @Override
4476 public OnnxType type() {
4477 return type;
4478 }
4479
4480 @Override
4481 public Quantifier quantifier() {
4482 return quantifier;
4483 }
4484 }
4485
4486 public enum OutputParameter implements OnnxParameter {
4487 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4488 ;
4489
4490 final OnnxType type;
4491 final Quantifier quantifier;
4492
4493 OutputParameter(OnnxType type, Quantifier quantifier) {
4494 this.type = type;
4495 this.quantifier = quantifier;
4496 }
4497
4498 @Override
4499 public OnnxType type() {
4500 return type;
4501 }
4502
4503 @Override
4504 public Quantifier quantifier() {
4505 return quantifier;
4506 }
4507 }
4508
4509 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
4510 NAME,
4511 List.of(Attribute.values()),
4512 List.of(TypeConstraint.values()),
4513 List.of(InputParameter.values()),
4514 List.of(OutputParameter.values())
4515 );
4516
4517 public Celu(ExternalizedOp def) {
4518 super(SCHEMA, def);
4519 }
4520
4521 Celu(Celu that, CodeContext cc) {
4522 super(that, cc);
4523 }
4524
4525 @Override
4526 public Celu transform(CodeContext cc, CodeTransformer ot) {
4527 return new Celu(this, cc);
4528 }
4529
4530 Celu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
4531 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha));
4532 }
4533
4534 @Override
4535 public SequencedSet<OnnxParameter> onnxOutputs() {
4536 return onnxOutputs(SCHEMA);
4537 }
4538
4539 @Override
4540 public SequencedMap<OnnxParameter, Object> onnxInputs() {
4541 return onnxInputs(SCHEMA, List.of(X()));
4542 }
4543
4544 public Value X() {
4545 return operands().get(0);
4546 }
4547
4548 public java.util.Optional<Float> alpha() {
4549 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
4550 return java.util.Optional.ofNullable(alpha);
4551 }
4552
4553 }
4554
4555 public static Celu Celu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
4556 return new Celu(resultType, X, alpha);
4557 }
4558
4559 @OpFactoryHelper.OpDeclaration(CenterCropPad.NAME)
4560 public static final class CenterCropPad extends OnnxOp {
4561 public static final String NAME = "CenterCropPad";
4562
4563 public enum Attribute implements OnnxAttribute {
4564 axes(long[].class, true, null),
4565 ;
4566
4567 final Class<?> t;
4568 final boolean optional;
4569 final Object defaultValue;
4570
4571 Attribute(Class<?> type, boolean optional, Object defaultValue) {
4572 this.t = type;
4573 this.optional = optional;
4574 this.defaultValue = defaultValue;
4575 assert optional || defaultValue == null;
4576 }
4577
4578 public Class<?> type() {
4579 return t;
4580 }
4581
4582 public boolean isOptional() {
4583 return optional;
4584 }
4585
4586 public Object defaultValue() {
4587 return defaultValue;
4588 }
4589 }
4590
4591 public enum TypeConstraint implements OnnxTypeConstraint {
4592 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
4593 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
4594 ;
4595
4596 final OnnxType.TypeVariable typeVariable;
4597
4598 TypeConstraint(OnnxType.TypeVariable typeVariable) {
4599 assert typeVariable.name().equals(name());
4600 this.typeVariable = typeVariable;
4601 }
4602
4603 @Override
4604 public OnnxType.TypeVariable typeVariable() {
4605 return typeVariable;
4606 }
4607 }
4608
4609 public enum InputParameter implements OnnxParameter {
4610 input_data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4611 shape(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
4612 ;
4613
4614 final OnnxType type;
4615 final Quantifier quantifier;
4616
4617 InputParameter(OnnxType type, Quantifier quantifier) {
4618 this.type = type;
4619 this.quantifier = quantifier;
4620 }
4621
4622 @Override
4623 public OnnxType type() {
4624 return type;
4625 }
4626
4627 @Override
4628 public Quantifier quantifier() {
4629 return quantifier;
4630 }
4631 }
4632
4633 public enum OutputParameter implements OnnxParameter {
4634 output_data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4635 ;
4636
4637 final OnnxType type;
4638 final Quantifier quantifier;
4639
4640 OutputParameter(OnnxType type, Quantifier quantifier) {
4641 this.type = type;
4642 this.quantifier = quantifier;
4643 }
4644
4645 @Override
4646 public OnnxType type() {
4647 return type;
4648 }
4649
4650 @Override
4651 public Quantifier quantifier() {
4652 return quantifier;
4653 }
4654 }
4655
4656 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
4657 NAME,
4658 List.of(Attribute.values()),
4659 List.of(TypeConstraint.values()),
4660 List.of(InputParameter.values()),
4661 List.of(OutputParameter.values())
4662 );
4663
4664 public CenterCropPad(ExternalizedOp def) {
4665 super(SCHEMA, def);
4666 }
4667
4668 CenterCropPad(CenterCropPad that, CodeContext cc) {
4669 super(that, cc);
4670 }
4671
4672 @Override
4673 public CenterCropPad transform(CodeContext cc, CodeTransformer ot) {
4674 return new CenterCropPad(this, cc);
4675 }
4676
4677 CenterCropPad(TypeElement resultType, Value input_data, Value shape, java.util.Optional<long[]> axes) {
4678 super(SCHEMA, resultType, Set.of(), List.of(input_data, shape), List.of(axes));
4679 }
4680
4681 @Override
4682 public SequencedSet<OnnxParameter> onnxOutputs() {
4683 return onnxOutputs(SCHEMA);
4684 }
4685
4686 @Override
4687 public SequencedMap<OnnxParameter, Object> onnxInputs() {
4688 return onnxInputs(SCHEMA, List.of(input_data(), shape()));
4689 }
4690
4691 public Value input_data() {
4692 return operands().get(0);
4693 }
4694
4695 public Value shape() {
4696 return operands().get(1);
4697 }
4698
4699 public java.util.Optional<long[]> axes() {
4700 long[] axes = Attribute.axes.access(long[].class, onnxAttributes);
4701 return java.util.Optional.ofNullable(axes).map(long[]::clone);
4702 }
4703
4704 }
4705
4706 public static CenterCropPad CenterCropPad(TypeElement resultType, Value input_data, Value shape, java.util.Optional<long[]> axes) {
4707 return new CenterCropPad(resultType, input_data, shape, axes);
4708 }
4709
4710 @OpFactoryHelper.OpDeclaration(Clip.NAME)
4711 public static final class Clip extends OnnxOp {
4712 public static final String NAME = "Clip";
4713
4714 public enum Attribute implements OnnxAttribute.None { }
4715
4716 public enum TypeConstraint implements OnnxTypeConstraint {
4717 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
4718 ;
4719
4720 final OnnxType.TypeVariable typeVariable;
4721
4722 TypeConstraint(OnnxType.TypeVariable typeVariable) {
4723 assert typeVariable.name().equals(name());
4724 this.typeVariable = typeVariable;
4725 }
4726
4727 @Override
4728 public OnnxType.TypeVariable typeVariable() {
4729 return typeVariable;
4730 }
4731 }
4732
4733 public enum InputParameter implements OnnxParameter {
4734 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4735 min(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
4736 max(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
4737 ;
4738
4739 final OnnxType type;
4740 final Quantifier quantifier;
4741
4742 InputParameter(OnnxType type, Quantifier quantifier) {
4743 this.type = type;
4744 this.quantifier = quantifier;
4745 }
4746
4747 @Override
4748 public OnnxType type() {
4749 return type;
4750 }
4751
4752 @Override
4753 public Quantifier quantifier() {
4754 return quantifier;
4755 }
4756 }
4757
4758 public enum OutputParameter implements OnnxParameter {
4759 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4760 ;
4761
4762 final OnnxType type;
4763 final Quantifier quantifier;
4764
4765 OutputParameter(OnnxType type, Quantifier quantifier) {
4766 this.type = type;
4767 this.quantifier = quantifier;
4768 }
4769
4770 @Override
4771 public OnnxType type() {
4772 return type;
4773 }
4774
4775 @Override
4776 public Quantifier quantifier() {
4777 return quantifier;
4778 }
4779 }
4780
4781 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
4782 NAME,
4783 List.of(Attribute.values()),
4784 List.of(TypeConstraint.values()),
4785 List.of(InputParameter.values()),
4786 List.of(OutputParameter.values())
4787 );
4788
4789 public Clip(ExternalizedOp def) {
4790 super(SCHEMA, def);
4791 }
4792
4793 Clip(Clip that, CodeContext cc) {
4794 super(that, cc);
4795 }
4796
4797 @Override
4798 public Clip transform(CodeContext cc, CodeTransformer ot) {
4799 return new Clip(this, cc);
4800 }
4801
4802 Clip(TypeElement resultType, Value input, java.util.Optional<Value> min, java.util.Optional<Value> max) {
4803 super(SCHEMA, resultType, Set.of(), List.of(input, min, max), List.of());
4804 }
4805
4806 @Override
4807 public SequencedSet<OnnxParameter> onnxOutputs() {
4808 return onnxOutputs(SCHEMA);
4809 }
4810
4811 @Override
4812 public SequencedMap<OnnxParameter, Object> onnxInputs() {
4813 return onnxInputs(SCHEMA, List.of(input(), min(), max()));
4814 }
4815
4816 public Value input() {
4817 return operands().get(0);
4818 }
4819
4820 public java.util.Optional<Value> min() {
4821 int i = optionalInputArguments.indexOf(InputParameter.min);
4822 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
4823 }
4824
4825 public java.util.Optional<Value> max() {
4826 int i = optionalInputArguments.indexOf(InputParameter.max);
4827 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
4828 }
4829
4830 }
4831
4832 public static Clip Clip(TypeElement resultType, Value input, java.util.Optional<Value> min, java.util.Optional<Value> max) {
4833 return new Clip(resultType, input, min, max);
4834 }
4835
4836 @OpFactoryHelper.OpDeclaration(Col2Im.NAME)
4837 public static final class Col2Im extends OnnxOp {
4838 public static final String NAME = "Col2Im";
4839
4840 public enum Attribute implements OnnxAttribute {
4841 pads(long[].class, true, null),
4842 dilations(long[].class, true, null),
4843 strides(long[].class, true, null),
4844 ;
4845
4846 final Class<?> t;
4847 final boolean optional;
4848 final Object defaultValue;
4849
4850 Attribute(Class<?> type, boolean optional, Object defaultValue) {
4851 this.t = type;
4852 this.optional = optional;
4853 this.defaultValue = defaultValue;
4854 assert optional || defaultValue == null;
4855 }
4856
4857 public Class<?> type() {
4858 return t;
4859 }
4860
4861 public boolean isOptional() {
4862 return optional;
4863 }
4864
4865 public Object defaultValue() {
4866 return defaultValue;
4867 }
4868 }
4869
4870 public enum TypeConstraint implements OnnxTypeConstraint {
4871 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
4872 ;
4873
4874 final OnnxType.TypeVariable typeVariable;
4875
4876 TypeConstraint(OnnxType.TypeVariable typeVariable) {
4877 assert typeVariable.name().equals(name());
4878 this.typeVariable = typeVariable;
4879 }
4880
4881 @Override
4882 public OnnxType.TypeVariable typeVariable() {
4883 return typeVariable;
4884 }
4885 }
4886
4887 public enum InputParameter implements OnnxParameter {
4888 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4889 image_shape(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
4890 block_shape(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
4891 ;
4892
4893 final OnnxType type;
4894 final Quantifier quantifier;
4895
4896 InputParameter(OnnxType type, Quantifier quantifier) {
4897 this.type = type;
4898 this.quantifier = quantifier;
4899 }
4900
4901 @Override
4902 public OnnxType type() {
4903 return type;
4904 }
4905
4906 @Override
4907 public Quantifier quantifier() {
4908 return quantifier;
4909 }
4910 }
4911
4912 public enum OutputParameter implements OnnxParameter {
4913 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
4914 ;
4915
4916 final OnnxType type;
4917 final Quantifier quantifier;
4918
4919 OutputParameter(OnnxType type, Quantifier quantifier) {
4920 this.type = type;
4921 this.quantifier = quantifier;
4922 }
4923
4924 @Override
4925 public OnnxType type() {
4926 return type;
4927 }
4928
4929 @Override
4930 public Quantifier quantifier() {
4931 return quantifier;
4932 }
4933 }
4934
4935 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
4936 NAME,
4937 List.of(Attribute.values()),
4938 List.of(TypeConstraint.values()),
4939 List.of(InputParameter.values()),
4940 List.of(OutputParameter.values())
4941 );
4942
4943 public Col2Im(ExternalizedOp def) {
4944 super(SCHEMA, def);
4945 }
4946
4947 Col2Im(Col2Im that, CodeContext cc) {
4948 super(that, cc);
4949 }
4950
4951 @Override
4952 public Col2Im transform(CodeContext cc, CodeTransformer ot) {
4953 return new Col2Im(this, cc);
4954 }
4955
4956 Col2Im(TypeElement resultType, Value input, Value image_shape, Value block_shape, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<long[]> strides) {
4957 super(SCHEMA, resultType, Set.of(), List.of(input, image_shape, block_shape), List.of(pads, dilations, strides));
4958 }
4959
4960 @Override
4961 public SequencedSet<OnnxParameter> onnxOutputs() {
4962 return onnxOutputs(SCHEMA);
4963 }
4964
4965 @Override
4966 public SequencedMap<OnnxParameter, Object> onnxInputs() {
4967 return onnxInputs(SCHEMA, List.of(input(), image_shape(), block_shape()));
4968 }
4969
4970 public Value input() {
4971 return operands().get(0);
4972 }
4973
4974 public Value image_shape() {
4975 return operands().get(1);
4976 }
4977
4978 public Value block_shape() {
4979 return operands().get(2);
4980 }
4981
4982 public java.util.Optional<long[]> pads() {
4983 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
4984 return java.util.Optional.ofNullable(pads).map(long[]::clone);
4985 }
4986
4987 public java.util.Optional<long[]> dilations() {
4988 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
4989 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
4990 }
4991
4992 public java.util.Optional<long[]> strides() {
4993 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
4994 return java.util.Optional.ofNullable(strides).map(long[]::clone);
4995 }
4996
4997 }
4998
4999 public static Col2Im Col2Im(TypeElement resultType, Value input, Value image_shape, Value block_shape, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<long[]> strides) {
5000 return new Col2Im(resultType, input, image_shape, block_shape, pads, dilations, strides);
5001 }
5002
5003 @OpFactoryHelper.OpDeclaration(Compress.NAME)
5004 public static final class Compress extends OnnxOp {
5005 public static final String NAME = "Compress";
5006
5007 public enum Attribute implements OnnxAttribute {
5008 axis(Long.class, true, null),
5009 ;
5010
5011 final Class<?> t;
5012 final boolean optional;
5013 final Object defaultValue;
5014
5015 Attribute(Class<?> type, boolean optional, Object defaultValue) {
5016 this.t = type;
5017 this.optional = optional;
5018 this.defaultValue = defaultValue;
5019 assert optional || defaultValue == null;
5020 }
5021
5022 public Class<?> type() {
5023 return t;
5024 }
5025
5026 public boolean isOptional() {
5027 return optional;
5028 }
5029
5030 public Object defaultValue() {
5031 return defaultValue;
5032 }
5033 }
5034
5035 public enum TypeConstraint implements OnnxTypeConstraint {
5036 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
5037 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
5038 ;
5039
5040 final OnnxType.TypeVariable typeVariable;
5041
5042 TypeConstraint(OnnxType.TypeVariable typeVariable) {
5043 assert typeVariable.name().equals(name());
5044 this.typeVariable = typeVariable;
5045 }
5046
5047 @Override
5048 public OnnxType.TypeVariable typeVariable() {
5049 return typeVariable;
5050 }
5051 }
5052
5053 public enum InputParameter implements OnnxParameter {
5054 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
5055 condition(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
5056 ;
5057
5058 final OnnxType type;
5059 final Quantifier quantifier;
5060
5061 InputParameter(OnnxType type, Quantifier quantifier) {
5062 this.type = type;
5063 this.quantifier = quantifier;
5064 }
5065
5066 @Override
5067 public OnnxType type() {
5068 return type;
5069 }
5070
5071 @Override
5072 public Quantifier quantifier() {
5073 return quantifier;
5074 }
5075 }
5076
5077 public enum OutputParameter implements OnnxParameter {
5078 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
5079 ;
5080
5081 final OnnxType type;
5082 final Quantifier quantifier;
5083
5084 OutputParameter(OnnxType type, Quantifier quantifier) {
5085 this.type = type;
5086 this.quantifier = quantifier;
5087 }
5088
5089 @Override
5090 public OnnxType type() {
5091 return type;
5092 }
5093
5094 @Override
5095 public Quantifier quantifier() {
5096 return quantifier;
5097 }
5098 }
5099
5100 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
5101 NAME,
5102 List.of(Attribute.values()),
5103 List.of(TypeConstraint.values()),
5104 List.of(InputParameter.values()),
5105 List.of(OutputParameter.values())
5106 );
5107
5108 public Compress(ExternalizedOp def) {
5109 super(SCHEMA, def);
5110 }
5111
5112 Compress(Compress that, CodeContext cc) {
5113 super(that, cc);
5114 }
5115
5116 @Override
5117 public Compress transform(CodeContext cc, CodeTransformer ot) {
5118 return new Compress(this, cc);
5119 }
5120
5121 Compress(TypeElement resultType, Value input, Value condition, java.util.Optional<Long> axis) {
5122 super(SCHEMA, resultType, Set.of(), List.of(input, condition), List.of(axis));
5123 }
5124
5125 @Override
5126 public SequencedSet<OnnxParameter> onnxOutputs() {
5127 return onnxOutputs(SCHEMA);
5128 }
5129
5130 @Override
5131 public SequencedMap<OnnxParameter, Object> onnxInputs() {
5132 return onnxInputs(SCHEMA, List.of(input(), condition()));
5133 }
5134
5135 public Value input() {
5136 return operands().get(0);
5137 }
5138
5139 public Value condition() {
5140 return operands().get(1);
5141 }
5142
5143 public java.util.Optional<Long> axis() {
5144 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
5145 return java.util.Optional.ofNullable(axis);
5146 }
5147
5148 }
5149
5150 public static Compress Compress(TypeElement resultType, Value input, Value condition, java.util.Optional<Long> axis) {
5151 return new Compress(resultType, input, condition, axis);
5152 }
5153
5154 @OpFactoryHelper.OpDeclaration(Concat.NAME)
5155 public static final class Concat extends OnnxOp {
5156 public static final String NAME = "Concat";
5157
5158 public enum Attribute implements OnnxAttribute {
5159 axis(Long.class, false, null),
5160 ;
5161
5162 final Class<?> t;
5163 final boolean optional;
5164 final Object defaultValue;
5165
5166 Attribute(Class<?> type, boolean optional, Object defaultValue) {
5167 this.t = type;
5168 this.optional = optional;
5169 this.defaultValue = defaultValue;
5170 assert optional || defaultValue == null;
5171 }
5172
5173 public Class<?> type() {
5174 return t;
5175 }
5176
5177 public boolean isOptional() {
5178 return optional;
5179 }
5180
5181 public Object defaultValue() {
5182 return defaultValue;
5183 }
5184 }
5185
5186 public enum TypeConstraint implements OnnxTypeConstraint {
5187 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
5188 ;
5189
5190 final OnnxType.TypeVariable typeVariable;
5191
5192 TypeConstraint(OnnxType.TypeVariable typeVariable) {
5193 assert typeVariable.name().equals(name());
5194 this.typeVariable = typeVariable;
5195 }
5196
5197 @Override
5198 public OnnxType.TypeVariable typeVariable() {
5199 return typeVariable;
5200 }
5201 }
5202
5203 public enum InputParameter implements OnnxParameter {
5204 inputs(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC),
5205 ;
5206
5207 final OnnxType type;
5208 final Quantifier quantifier;
5209
5210 InputParameter(OnnxType type, Quantifier quantifier) {
5211 this.type = type;
5212 this.quantifier = quantifier;
5213 }
5214
5215 @Override
5216 public OnnxType type() {
5217 return type;
5218 }
5219
5220 @Override
5221 public Quantifier quantifier() {
5222 return quantifier;
5223 }
5224 }
5225
5226 public enum OutputParameter implements OnnxParameter {
5227 concat_result(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
5228 ;
5229
5230 final OnnxType type;
5231 final Quantifier quantifier;
5232
5233 OutputParameter(OnnxType type, Quantifier quantifier) {
5234 this.type = type;
5235 this.quantifier = quantifier;
5236 }
5237
5238 @Override
5239 public OnnxType type() {
5240 return type;
5241 }
5242
5243 @Override
5244 public Quantifier quantifier() {
5245 return quantifier;
5246 }
5247 }
5248
5249 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
5250 NAME,
5251 List.of(Attribute.values()),
5252 List.of(TypeConstraint.values()),
5253 List.of(InputParameter.values()),
5254 List.of(OutputParameter.values())
5255 );
5256
5257 public Concat(ExternalizedOp def) {
5258 super(SCHEMA, def);
5259 }
5260
5261 Concat(Concat that, CodeContext cc) {
5262 super(that, cc);
5263 }
5264
5265 @Override
5266 public Concat transform(CodeContext cc, CodeTransformer ot) {
5267 return new Concat(this, cc);
5268 }
5269
5270 Concat(TypeElement resultType, List<Value> inputs, long axis) {
5271 super(SCHEMA, resultType, Set.of(), List.of(inputs), List.of(axis));
5272 }
5273
5274 @Override
5275 public SequencedSet<OnnxParameter> onnxOutputs() {
5276 return onnxOutputs(SCHEMA);
5277 }
5278
5279 @Override
5280 public SequencedMap<OnnxParameter, Object> onnxInputs() {
5281 return onnxInputs(SCHEMA, List.of(inputs()));
5282 }
5283
5284 public List<Value> inputs() {
5285 return operands();
5286 }
5287
5288 public long axis() {
5289 long axis = Attribute.axis.access(Long.class, onnxAttributes);
5290 return axis;
5291 }
5292
5293 }
5294
5295 public static Concat Concat(TypeElement resultType, List<Value> inputs, long axis) {
5296 return new Concat(resultType, inputs, axis);
5297 }
5298
5299 @OpFactoryHelper.OpDeclaration(ConcatFromSequence.NAME)
5300 public static final class ConcatFromSequence extends OnnxOp {
5301 public static final String NAME = "ConcatFromSequence";
5302
5303 public enum Attribute implements OnnxAttribute {
5304 axis(Long.class, false, null),
5305 new_axis(Long.class, true, 0),
5306 ;
5307
5308 final Class<?> t;
5309 final boolean optional;
5310 final Object defaultValue;
5311
5312 Attribute(Class<?> type, boolean optional, Object defaultValue) {
5313 this.t = type;
5314 this.optional = optional;
5315 this.defaultValue = defaultValue;
5316 assert optional || defaultValue == null;
5317 }
5318
5319 public Class<?> type() {
5320 return t;
5321 }
5322
5323 public boolean isOptional() {
5324 return optional;
5325 }
5326
5327 public Object defaultValue() {
5328 return defaultValue;
5329 }
5330 }
5331
5332 public enum TypeConstraint implements OnnxTypeConstraint {
5333 S(new OnnxType.TypeVariable("S", List.of(OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
5334 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
5335 ;
5336
5337 final OnnxType.TypeVariable typeVariable;
5338
5339 TypeConstraint(OnnxType.TypeVariable typeVariable) {
5340 assert typeVariable.name().equals(name());
5341 this.typeVariable = typeVariable;
5342 }
5343
5344 @Override
5345 public OnnxType.TypeVariable typeVariable() {
5346 return typeVariable;
5347 }
5348 }
5349
5350 public enum InputParameter implements OnnxParameter {
5351 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
5352 ;
5353
5354 final OnnxType type;
5355 final Quantifier quantifier;
5356
5357 InputParameter(OnnxType type, Quantifier quantifier) {
5358 this.type = type;
5359 this.quantifier = quantifier;
5360 }
5361
5362 @Override
5363 public OnnxType type() {
5364 return type;
5365 }
5366
5367 @Override
5368 public Quantifier quantifier() {
5369 return quantifier;
5370 }
5371 }
5372
5373 public enum OutputParameter implements OnnxParameter {
5374 concat_result(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
5375 ;
5376
5377 final OnnxType type;
5378 final Quantifier quantifier;
5379
5380 OutputParameter(OnnxType type, Quantifier quantifier) {
5381 this.type = type;
5382 this.quantifier = quantifier;
5383 }
5384
5385 @Override
5386 public OnnxType type() {
5387 return type;
5388 }
5389
5390 @Override
5391 public Quantifier quantifier() {
5392 return quantifier;
5393 }
5394 }
5395
5396 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
5397 NAME,
5398 List.of(Attribute.values()),
5399 List.of(TypeConstraint.values()),
5400 List.of(InputParameter.values()),
5401 List.of(OutputParameter.values())
5402 );
5403
5404 public ConcatFromSequence(ExternalizedOp def) {
5405 super(SCHEMA, def);
5406 }
5407
5408 ConcatFromSequence(ConcatFromSequence that, CodeContext cc) {
5409 super(that, cc);
5410 }
5411
5412 @Override
5413 public ConcatFromSequence transform(CodeContext cc, CodeTransformer ot) {
5414 return new ConcatFromSequence(this, cc);
5415 }
5416
5417 ConcatFromSequence(TypeElement resultType, Value input_sequence, long axis, java.util.Optional<Long> new_axis) {
5418 super(SCHEMA, resultType, Set.of(), List.of(input_sequence), List.of(axis, new_axis));
5419 }
5420
5421 @Override
5422 public SequencedSet<OnnxParameter> onnxOutputs() {
5423 return onnxOutputs(SCHEMA);
5424 }
5425
5426 @Override
5427 public SequencedMap<OnnxParameter, Object> onnxInputs() {
5428 return onnxInputs(SCHEMA, List.of(input_sequence()));
5429 }
5430
5431 public Value input_sequence() {
5432 return operands().get(0);
5433 }
5434
5435 public long axis() {
5436 long axis = Attribute.axis.access(Long.class, onnxAttributes);
5437 return axis;
5438 }
5439
5440 public java.util.Optional<Long> new_axis() {
5441 Long new_axis = Attribute.new_axis.access(Long.class, onnxAttributes);
5442 return java.util.Optional.ofNullable(new_axis);
5443 }
5444
5445 }
5446
5447 public static ConcatFromSequence ConcatFromSequence(TypeElement resultType, Value input_sequence, long axis, java.util.Optional<Long> new_axis) {
5448 return new ConcatFromSequence(resultType, input_sequence, axis, new_axis);
5449 }
5450
5451 @OpFactoryHelper.OpDeclaration(Constant.NAME)
5452 public static final class Constant extends OnnxOp {
5453 public static final String NAME = "Constant";
5454
5455 public enum Attribute implements OnnxAttribute {
5456 value_int(Long.class, true, null),
5457 value_floats(float[].class, true, null),
5458 value_strings(String[].class, true, null),
5459 value_float(Float.class, true, null),
5460 value_string(String.class, true, null),
5461 value_ints(long[].class, true, null),
5462 sparse_value(byte[].class, true, null),
5463 value(Tensor.class, true, null),
5464 ;
5465
5466 final Class<?> t;
5467 final boolean optional;
5468 final Object defaultValue;
5469
5470 Attribute(Class<?> type, boolean optional, Object defaultValue) {
5471 this.t = type;
5472 this.optional = optional;
5473 this.defaultValue = defaultValue;
5474 assert optional || defaultValue == null;
5475 }
5476
5477 public Class<?> type() {
5478 return t;
5479 }
5480
5481 public boolean isOptional() {
5482 return optional;
5483 }
5484
5485 public Object defaultValue() {
5486 return defaultValue;
5487 }
5488 }
5489
5490 public enum TypeConstraint implements OnnxTypeConstraint {
5491 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
5492 ;
5493
5494 final OnnxType.TypeVariable typeVariable;
5495
5496 TypeConstraint(OnnxType.TypeVariable typeVariable) {
5497 assert typeVariable.name().equals(name());
5498 this.typeVariable = typeVariable;
5499 }
5500
5501 @Override
5502 public OnnxType.TypeVariable typeVariable() {
5503 return typeVariable;
5504 }
5505 }
5506
5507 public enum InputParameter implements OnnxParameter.None { }
5508
5509 public enum OutputParameter implements OnnxParameter {
5510 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
5511 ;
5512
5513 final OnnxType type;
5514 final Quantifier quantifier;
5515
5516 OutputParameter(OnnxType type, Quantifier quantifier) {
5517 this.type = type;
5518 this.quantifier = quantifier;
5519 }
5520
5521 @Override
5522 public OnnxType type() {
5523 return type;
5524 }
5525
5526 @Override
5527 public Quantifier quantifier() {
5528 return quantifier;
5529 }
5530 }
5531
5532 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
5533 NAME,
5534 List.of(Attribute.values()),
5535 List.of(TypeConstraint.values()),
5536 List.of(InputParameter.values()),
5537 List.of(OutputParameter.values())
5538 );
5539
5540 public Constant(ExternalizedOp def) {
5541 super(SCHEMA, def);
5542 }
5543
5544 Constant(Constant that, CodeContext cc) {
5545 super(that, cc);
5546 }
5547
5548 @Override
5549 public Constant transform(CodeContext cc, CodeTransformer ot) {
5550 return new Constant(this, cc);
5551 }
5552
5553 Constant(TypeElement resultType, java.util.Optional<Long> value_int, java.util.Optional<float[]> value_floats, java.util.Optional<String[]> value_strings, java.util.Optional<Float> value_float, java.util.Optional<String> value_string, java.util.Optional<long[]> value_ints, java.util.Optional<byte[]> sparse_value, java.util.Optional<Tensor> value) {
5554 super(SCHEMA, resultType, Set.of(), List.of(), List.of(value_int, value_floats, value_strings, value_float, value_string, value_ints, sparse_value, value));
5555 }
5556
5557 @Override
5558 public SequencedSet<OnnxParameter> onnxOutputs() {
5559 return onnxOutputs(SCHEMA);
5560 }
5561
5562 @Override
5563 public SequencedMap<OnnxParameter, Object> onnxInputs() {
5564 return onnxInputs(SCHEMA, List.of());
5565 }
5566
5567 public java.util.Optional<Long> value_int() {
5568 Long value_int = Attribute.value_int.access(Long.class, onnxAttributes);
5569 return java.util.Optional.ofNullable(value_int);
5570 }
5571
5572 public java.util.Optional<float[]> value_floats() {
5573 float[] value_floats = Attribute.value_floats.access(float[].class, onnxAttributes);
5574 return java.util.Optional.ofNullable(value_floats).map(float[]::clone);
5575 }
5576
5577 public java.util.Optional<String[]> value_strings() {
5578 String[] value_strings = Attribute.value_strings.access(String[].class, onnxAttributes);
5579 return java.util.Optional.ofNullable(value_strings).map(String[]::clone);
5580 }
5581
5582 public java.util.Optional<Float> value_float() {
5583 Float value_float = Attribute.value_float.access(Float.class, onnxAttributes);
5584 return java.util.Optional.ofNullable(value_float);
5585 }
5586
5587 public java.util.Optional<String> value_string() {
5588 String value_string = Attribute.value_string.access(String.class, onnxAttributes);
5589 return java.util.Optional.ofNullable(value_string);
5590 }
5591
5592 public java.util.Optional<long[]> value_ints() {
5593 long[] value_ints = Attribute.value_ints.access(long[].class, onnxAttributes);
5594 return java.util.Optional.ofNullable(value_ints).map(long[]::clone);
5595 }
5596
5597 public java.util.Optional<byte[]> sparse_value() {
5598 byte[] sparse_value = Attribute.sparse_value.access(byte[].class, onnxAttributes);
5599 return java.util.Optional.ofNullable(sparse_value).map(byte[]::clone);
5600 }
5601
5602 public java.util.Optional<Tensor> value() {
5603 Tensor value = Attribute.value.access(Tensor.class, onnxAttributes);
5604 return java.util.Optional.ofNullable(value);
5605 }
5606
5607 }
5608
5609 public static Constant Constant(TypeElement resultType, java.util.Optional<Long> value_int, java.util.Optional<float[]> value_floats, java.util.Optional<String[]> value_strings, java.util.Optional<Float> value_float, java.util.Optional<String> value_string, java.util.Optional<long[]> value_ints, java.util.Optional<byte[]> sparse_value, java.util.Optional<Tensor> value) {
5610 return new Constant(resultType, value_int, value_floats, value_strings, value_float, value_string, value_ints, sparse_value, value);
5611 }
5612
5613 @OpFactoryHelper.OpDeclaration(ConstantOfShape.NAME)
5614 public static final class ConstantOfShape extends OnnxOp {
5615 public static final String NAME = "ConstantOfShape";
5616
5617 public enum Attribute implements OnnxAttribute {
5618 value(Tensor.class, true, null),
5619 ;
5620
5621 final Class<?> t;
5622 final boolean optional;
5623 final Object defaultValue;
5624
5625 Attribute(Class<?> type, boolean optional, Object defaultValue) {
5626 this.t = type;
5627 this.optional = optional;
5628 this.defaultValue = defaultValue;
5629 assert optional || defaultValue == null;
5630 }
5631
5632 public Class<?> type() {
5633 return t;
5634 }
5635
5636 public boolean isOptional() {
5637 return optional;
5638 }
5639
5640 public Object defaultValue() {
5641 return defaultValue;
5642 }
5643 }
5644
5645 public enum TypeConstraint implements OnnxTypeConstraint {
5646 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int64())))),
5647 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
5648 ;
5649
5650 final OnnxType.TypeVariable typeVariable;
5651
5652 TypeConstraint(OnnxType.TypeVariable typeVariable) {
5653 assert typeVariable.name().equals(name());
5654 this.typeVariable = typeVariable;
5655 }
5656
5657 @Override
5658 public OnnxType.TypeVariable typeVariable() {
5659 return typeVariable;
5660 }
5661 }
5662
5663 public enum InputParameter implements OnnxParameter {
5664 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
5665 ;
5666
5667 final OnnxType type;
5668 final Quantifier quantifier;
5669
5670 InputParameter(OnnxType type, Quantifier quantifier) {
5671 this.type = type;
5672 this.quantifier = quantifier;
5673 }
5674
5675 @Override
5676 public OnnxType type() {
5677 return type;
5678 }
5679
5680 @Override
5681 public Quantifier quantifier() {
5682 return quantifier;
5683 }
5684 }
5685
5686 public enum OutputParameter implements OnnxParameter {
5687 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
5688 ;
5689
5690 final OnnxType type;
5691 final Quantifier quantifier;
5692
5693 OutputParameter(OnnxType type, Quantifier quantifier) {
5694 this.type = type;
5695 this.quantifier = quantifier;
5696 }
5697
5698 @Override
5699 public OnnxType type() {
5700 return type;
5701 }
5702
5703 @Override
5704 public Quantifier quantifier() {
5705 return quantifier;
5706 }
5707 }
5708
5709 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
5710 NAME,
5711 List.of(Attribute.values()),
5712 List.of(TypeConstraint.values()),
5713 List.of(InputParameter.values()),
5714 List.of(OutputParameter.values())
5715 );
5716
5717 public ConstantOfShape(ExternalizedOp def) {
5718 super(SCHEMA, def);
5719 }
5720
5721 ConstantOfShape(ConstantOfShape that, CodeContext cc) {
5722 super(that, cc);
5723 }
5724
5725 @Override
5726 public ConstantOfShape transform(CodeContext cc, CodeTransformer ot) {
5727 return new ConstantOfShape(this, cc);
5728 }
5729
5730 ConstantOfShape(TypeElement resultType, Value input, java.util.Optional<Tensor> value) {
5731 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(value));
5732 }
5733
5734 @Override
5735 public SequencedSet<OnnxParameter> onnxOutputs() {
5736 return onnxOutputs(SCHEMA);
5737 }
5738
5739 @Override
5740 public SequencedMap<OnnxParameter, Object> onnxInputs() {
5741 return onnxInputs(SCHEMA, List.of(input()));
5742 }
5743
5744 public Value input() {
5745 return operands().get(0);
5746 }
5747
5748 public java.util.Optional<Tensor> value() {
5749 Tensor value = Attribute.value.access(Tensor.class, onnxAttributes);
5750 return java.util.Optional.ofNullable(value);
5751 }
5752
5753 }
5754
5755 public static ConstantOfShape ConstantOfShape(TypeElement resultType, Value input, java.util.Optional<Tensor> value) {
5756 return new ConstantOfShape(resultType, input, value);
5757 }
5758
5759 @OpFactoryHelper.OpDeclaration(Conv.NAME)
5760 public static final class Conv extends OnnxOp {
5761 public static final String NAME = "Conv";
5762
5763 public enum Attribute implements OnnxAttribute {
5764 pads(long[].class, true, null),
5765 dilations(long[].class, true, null),
5766 auto_pad(String.class, true, "NOTSET"),
5767 strides(long[].class, true, null),
5768 group(Long.class, true, 1),
5769 kernel_shape(long[].class, true, null),
5770 ;
5771
5772 final Class<?> t;
5773 final boolean optional;
5774 final Object defaultValue;
5775
5776 Attribute(Class<?> type, boolean optional, Object defaultValue) {
5777 this.t = type;
5778 this.optional = optional;
5779 this.defaultValue = defaultValue;
5780 assert optional || defaultValue == null;
5781 }
5782
5783 public Class<?> type() {
5784 return t;
5785 }
5786
5787 public boolean isOptional() {
5788 return optional;
5789 }
5790
5791 public Object defaultValue() {
5792 return defaultValue;
5793 }
5794 }
5795
5796 public enum TypeConstraint implements OnnxTypeConstraint {
5797 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
5798 ;
5799
5800 final OnnxType.TypeVariable typeVariable;
5801
5802 TypeConstraint(OnnxType.TypeVariable typeVariable) {
5803 assert typeVariable.name().equals(name());
5804 this.typeVariable = typeVariable;
5805 }
5806
5807 @Override
5808 public OnnxType.TypeVariable typeVariable() {
5809 return typeVariable;
5810 }
5811 }
5812
5813 public enum InputParameter implements OnnxParameter {
5814 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
5815 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
5816 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
5817 ;
5818
5819 final OnnxType type;
5820 final Quantifier quantifier;
5821
5822 InputParameter(OnnxType type, Quantifier quantifier) {
5823 this.type = type;
5824 this.quantifier = quantifier;
5825 }
5826
5827 @Override
5828 public OnnxType type() {
5829 return type;
5830 }
5831
5832 @Override
5833 public Quantifier quantifier() {
5834 return quantifier;
5835 }
5836 }
5837
5838 public enum OutputParameter implements OnnxParameter {
5839 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
5840 ;
5841
5842 final OnnxType type;
5843 final Quantifier quantifier;
5844
5845 OutputParameter(OnnxType type, Quantifier quantifier) {
5846 this.type = type;
5847 this.quantifier = quantifier;
5848 }
5849
5850 @Override
5851 public OnnxType type() {
5852 return type;
5853 }
5854
5855 @Override
5856 public Quantifier quantifier() {
5857 return quantifier;
5858 }
5859 }
5860
5861 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
5862 NAME,
5863 List.of(Attribute.values()),
5864 List.of(TypeConstraint.values()),
5865 List.of(InputParameter.values()),
5866 List.of(OutputParameter.values())
5867 );
5868
5869 public Conv(ExternalizedOp def) {
5870 super(SCHEMA, def);
5871 }
5872
5873 Conv(Conv that, CodeContext cc) {
5874 super(that, cc);
5875 }
5876
5877 @Override
5878 public Conv transform(CodeContext cc, CodeTransformer ot) {
5879 return new Conv(this, cc);
5880 }
5881
5882 Conv(TypeElement resultType, Value X, Value W, java.util.Optional<Value> B, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<long[]> strides, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape) {
5883 super(SCHEMA, resultType, Set.of(), List.of(X, W, B), List.of(pads, dilations, auto_pad, strides, group, kernel_shape));
5884 }
5885
5886 @Override
5887 public SequencedSet<OnnxParameter> onnxOutputs() {
5888 return onnxOutputs(SCHEMA);
5889 }
5890
5891 @Override
5892 public SequencedMap<OnnxParameter, Object> onnxInputs() {
5893 return onnxInputs(SCHEMA, List.of(X(), W(), B()));
5894 }
5895
5896 public Value X() {
5897 return operands().get(0);
5898 }
5899
5900 public Value W() {
5901 return operands().get(1);
5902 }
5903
5904 public java.util.Optional<Value> B() {
5905 int i = optionalInputArguments.indexOf(InputParameter.B);
5906 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
5907 }
5908
5909 public java.util.Optional<long[]> pads() {
5910 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
5911 return java.util.Optional.ofNullable(pads).map(long[]::clone);
5912 }
5913
5914 public java.util.Optional<long[]> dilations() {
5915 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
5916 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
5917 }
5918
5919 public java.util.Optional<String> auto_pad() {
5920 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes);
5921 return java.util.Optional.ofNullable(auto_pad);
5922 }
5923
5924 public java.util.Optional<long[]> strides() {
5925 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
5926 return java.util.Optional.ofNullable(strides).map(long[]::clone);
5927 }
5928
5929 public java.util.Optional<Long> group() {
5930 Long group = Attribute.group.access(Long.class, onnxAttributes);
5931 return java.util.Optional.ofNullable(group);
5932 }
5933
5934 public java.util.Optional<long[]> kernel_shape() {
5935 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
5936 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone);
5937 }
5938
5939 }
5940
5941 public static Conv Conv(TypeElement resultType, Value X, Value W, java.util.Optional<Value> B, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<long[]> strides, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape) {
5942 return new Conv(resultType, X, W, B, pads, dilations, auto_pad, strides, group, kernel_shape);
5943 }
5944
5945 @OpFactoryHelper.OpDeclaration(ConvInteger.NAME)
5946 public static final class ConvInteger extends OnnxOp {
5947 public static final String NAME = "ConvInteger";
5948
5949 public enum Attribute implements OnnxAttribute {
5950 pads(long[].class, true, null),
5951 dilations(long[].class, true, null),
5952 auto_pad(String.class, true, "NOTSET"),
5953 strides(long[].class, true, null),
5954 group(Long.class, true, 1),
5955 kernel_shape(long[].class, true, null),
5956 ;
5957
5958 final Class<?> t;
5959 final boolean optional;
5960 final Object defaultValue;
5961
5962 Attribute(Class<?> type, boolean optional, Object defaultValue) {
5963 this.t = type;
5964 this.optional = optional;
5965 this.defaultValue = defaultValue;
5966 assert optional || defaultValue == null;
5967 }
5968
5969 public Class<?> type() {
5970 return t;
5971 }
5972
5973 public boolean isOptional() {
5974 return optional;
5975 }
5976
5977 public Object defaultValue() {
5978 return defaultValue;
5979 }
5980 }
5981
5982 public enum TypeConstraint implements OnnxTypeConstraint {
5983 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))),
5984 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))),
5985 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int32())))),
5986 ;
5987
5988 final OnnxType.TypeVariable typeVariable;
5989
5990 TypeConstraint(OnnxType.TypeVariable typeVariable) {
5991 assert typeVariable.name().equals(name());
5992 this.typeVariable = typeVariable;
5993 }
5994
5995 @Override
5996 public OnnxType.TypeVariable typeVariable() {
5997 return typeVariable;
5998 }
5999 }
6000
6001 public enum InputParameter implements OnnxParameter {
6002 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
6003 w(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
6004 x_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
6005 w_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
6006 ;
6007
6008 final OnnxType type;
6009 final Quantifier quantifier;
6010
6011 InputParameter(OnnxType type, Quantifier quantifier) {
6012 this.type = type;
6013 this.quantifier = quantifier;
6014 }
6015
6016 @Override
6017 public OnnxType type() {
6018 return type;
6019 }
6020
6021 @Override
6022 public Quantifier quantifier() {
6023 return quantifier;
6024 }
6025 }
6026
6027 public enum OutputParameter implements OnnxParameter {
6028 y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
6029 ;
6030
6031 final OnnxType type;
6032 final Quantifier quantifier;
6033
6034 OutputParameter(OnnxType type, Quantifier quantifier) {
6035 this.type = type;
6036 this.quantifier = quantifier;
6037 }
6038
6039 @Override
6040 public OnnxType type() {
6041 return type;
6042 }
6043
6044 @Override
6045 public Quantifier quantifier() {
6046 return quantifier;
6047 }
6048 }
6049
6050 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
6051 NAME,
6052 List.of(Attribute.values()),
6053 List.of(TypeConstraint.values()),
6054 List.of(InputParameter.values()),
6055 List.of(OutputParameter.values())
6056 );
6057
6058 public ConvInteger(ExternalizedOp def) {
6059 super(SCHEMA, def);
6060 }
6061
6062 ConvInteger(ConvInteger that, CodeContext cc) {
6063 super(that, cc);
6064 }
6065
6066 @Override
6067 public ConvInteger transform(CodeContext cc, CodeTransformer ot) {
6068 return new ConvInteger(this, cc);
6069 }
6070
6071 ConvInteger(TypeElement resultType, Value x, Value w, java.util.Optional<Value> x_zero_point, java.util.Optional<Value> w_zero_point, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<long[]> strides, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape) {
6072 super(SCHEMA, resultType, Set.of(), List.of(x, w, x_zero_point, w_zero_point), List.of(pads, dilations, auto_pad, strides, group, kernel_shape));
6073 }
6074
6075 @Override
6076 public SequencedSet<OnnxParameter> onnxOutputs() {
6077 return onnxOutputs(SCHEMA);
6078 }
6079
6080 @Override
6081 public SequencedMap<OnnxParameter, Object> onnxInputs() {
6082 return onnxInputs(SCHEMA, List.of(x(), w(), x_zero_point(), w_zero_point()));
6083 }
6084
6085 public Value x() {
6086 return operands().get(0);
6087 }
6088
6089 public Value w() {
6090 return operands().get(1);
6091 }
6092
6093 public java.util.Optional<Value> x_zero_point() {
6094 int i = optionalInputArguments.indexOf(InputParameter.x_zero_point);
6095 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
6096 }
6097
6098 public java.util.Optional<Value> w_zero_point() {
6099 int i = optionalInputArguments.indexOf(InputParameter.w_zero_point);
6100 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
6101 }
6102
6103 public java.util.Optional<long[]> pads() {
6104 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
6105 return java.util.Optional.ofNullable(pads).map(long[]::clone);
6106 }
6107
6108 public java.util.Optional<long[]> dilations() {
6109 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
6110 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
6111 }
6112
6113 public java.util.Optional<String> auto_pad() {
6114 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes);
6115 return java.util.Optional.ofNullable(auto_pad);
6116 }
6117
6118 public java.util.Optional<long[]> strides() {
6119 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
6120 return java.util.Optional.ofNullable(strides).map(long[]::clone);
6121 }
6122
6123 public java.util.Optional<Long> group() {
6124 Long group = Attribute.group.access(Long.class, onnxAttributes);
6125 return java.util.Optional.ofNullable(group);
6126 }
6127
6128 public java.util.Optional<long[]> kernel_shape() {
6129 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
6130 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone);
6131 }
6132
6133 }
6134
6135 public static ConvInteger ConvInteger(TypeElement resultType, Value x, Value w, java.util.Optional<Value> x_zero_point, java.util.Optional<Value> w_zero_point, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<long[]> strides, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape) {
6136 return new ConvInteger(resultType, x, w, x_zero_point, w_zero_point, pads, dilations, auto_pad, strides, group, kernel_shape);
6137 }
6138
6139 @OpFactoryHelper.OpDeclaration(ConvTranspose.NAME)
6140 public static final class ConvTranspose extends OnnxOp {
6141 public static final String NAME = "ConvTranspose";
6142
6143 public enum Attribute implements OnnxAttribute {
6144 output_shape(long[].class, true, null),
6145 pads(long[].class, true, null),
6146 dilations(long[].class, true, null),
6147 auto_pad(String.class, true, "NOTSET"),
6148 strides(long[].class, true, null),
6149 group(Long.class, true, 1),
6150 kernel_shape(long[].class, true, null),
6151 output_padding(long[].class, true, null),
6152 ;
6153
6154 final Class<?> t;
6155 final boolean optional;
6156 final Object defaultValue;
6157
6158 Attribute(Class<?> type, boolean optional, Object defaultValue) {
6159 this.t = type;
6160 this.optional = optional;
6161 this.defaultValue = defaultValue;
6162 assert optional || defaultValue == null;
6163 }
6164
6165 public Class<?> type() {
6166 return t;
6167 }
6168
6169 public boolean isOptional() {
6170 return optional;
6171 }
6172
6173 public Object defaultValue() {
6174 return defaultValue;
6175 }
6176 }
6177
6178 public enum TypeConstraint implements OnnxTypeConstraint {
6179 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
6180 ;
6181
6182 final OnnxType.TypeVariable typeVariable;
6183
6184 TypeConstraint(OnnxType.TypeVariable typeVariable) {
6185 assert typeVariable.name().equals(name());
6186 this.typeVariable = typeVariable;
6187 }
6188
6189 @Override
6190 public OnnxType.TypeVariable typeVariable() {
6191 return typeVariable;
6192 }
6193 }
6194
6195 public enum InputParameter implements OnnxParameter {
6196 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6197 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6198 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
6199 ;
6200
6201 final OnnxType type;
6202 final Quantifier quantifier;
6203
6204 InputParameter(OnnxType type, Quantifier quantifier) {
6205 this.type = type;
6206 this.quantifier = quantifier;
6207 }
6208
6209 @Override
6210 public OnnxType type() {
6211 return type;
6212 }
6213
6214 @Override
6215 public Quantifier quantifier() {
6216 return quantifier;
6217 }
6218 }
6219
6220 public enum OutputParameter implements OnnxParameter {
6221 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6222 ;
6223
6224 final OnnxType type;
6225 final Quantifier quantifier;
6226
6227 OutputParameter(OnnxType type, Quantifier quantifier) {
6228 this.type = type;
6229 this.quantifier = quantifier;
6230 }
6231
6232 @Override
6233 public OnnxType type() {
6234 return type;
6235 }
6236
6237 @Override
6238 public Quantifier quantifier() {
6239 return quantifier;
6240 }
6241 }
6242
6243 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
6244 NAME,
6245 List.of(Attribute.values()),
6246 List.of(TypeConstraint.values()),
6247 List.of(InputParameter.values()),
6248 List.of(OutputParameter.values())
6249 );
6250
6251 public ConvTranspose(ExternalizedOp def) {
6252 super(SCHEMA, def);
6253 }
6254
6255 ConvTranspose(ConvTranspose that, CodeContext cc) {
6256 super(that, cc);
6257 }
6258
6259 @Override
6260 public ConvTranspose transform(CodeContext cc, CodeTransformer ot) {
6261 return new ConvTranspose(this, cc);
6262 }
6263
6264 ConvTranspose(TypeElement resultType, Value X, Value W, java.util.Optional<Value> B, java.util.Optional<long[]> output_shape, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<long[]> strides, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape, java.util.Optional<long[]> output_padding) {
6265 super(SCHEMA, resultType, Set.of(), List.of(X, W, B), List.of(output_shape, pads, dilations, auto_pad, strides, group, kernel_shape, output_padding));
6266 }
6267
6268 @Override
6269 public SequencedSet<OnnxParameter> onnxOutputs() {
6270 return onnxOutputs(SCHEMA);
6271 }
6272
6273 @Override
6274 public SequencedMap<OnnxParameter, Object> onnxInputs() {
6275 return onnxInputs(SCHEMA, List.of(X(), W(), B()));
6276 }
6277
6278 public Value X() {
6279 return operands().get(0);
6280 }
6281
6282 public Value W() {
6283 return operands().get(1);
6284 }
6285
6286 public java.util.Optional<Value> B() {
6287 int i = optionalInputArguments.indexOf(InputParameter.B);
6288 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
6289 }
6290
6291 public java.util.Optional<long[]> output_shape() {
6292 long[] output_shape = Attribute.output_shape.access(long[].class, onnxAttributes);
6293 return java.util.Optional.ofNullable(output_shape).map(long[]::clone);
6294 }
6295
6296 public java.util.Optional<long[]> pads() {
6297 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
6298 return java.util.Optional.ofNullable(pads).map(long[]::clone);
6299 }
6300
6301 public java.util.Optional<long[]> dilations() {
6302 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
6303 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
6304 }
6305
6306 public java.util.Optional<String> auto_pad() {
6307 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes);
6308 return java.util.Optional.ofNullable(auto_pad);
6309 }
6310
6311 public java.util.Optional<long[]> strides() {
6312 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
6313 return java.util.Optional.ofNullable(strides).map(long[]::clone);
6314 }
6315
6316 public java.util.Optional<Long> group() {
6317 Long group = Attribute.group.access(Long.class, onnxAttributes);
6318 return java.util.Optional.ofNullable(group);
6319 }
6320
6321 public java.util.Optional<long[]> kernel_shape() {
6322 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
6323 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone);
6324 }
6325
6326 public java.util.Optional<long[]> output_padding() {
6327 long[] output_padding = Attribute.output_padding.access(long[].class, onnxAttributes);
6328 return java.util.Optional.ofNullable(output_padding).map(long[]::clone);
6329 }
6330
6331 }
6332
6333 public static ConvTranspose ConvTranspose(TypeElement resultType, Value X, Value W, java.util.Optional<Value> B, java.util.Optional<long[]> output_shape, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<long[]> strides, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape, java.util.Optional<long[]> output_padding) {
6334 return new ConvTranspose(resultType, X, W, B, output_shape, pads, dilations, auto_pad, strides, group, kernel_shape, output_padding);
6335 }
6336
6337 @OpFactoryHelper.OpDeclaration(Cos.NAME)
6338 public static final class Cos extends OnnxOp {
6339 public static final String NAME = "Cos";
6340
6341 public enum Attribute implements OnnxAttribute.None { }
6342
6343 public enum TypeConstraint implements OnnxTypeConstraint {
6344 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
6345 ;
6346
6347 final OnnxType.TypeVariable typeVariable;
6348
6349 TypeConstraint(OnnxType.TypeVariable typeVariable) {
6350 assert typeVariable.name().equals(name());
6351 this.typeVariable = typeVariable;
6352 }
6353
6354 @Override
6355 public OnnxType.TypeVariable typeVariable() {
6356 return typeVariable;
6357 }
6358 }
6359
6360 public enum InputParameter implements OnnxParameter {
6361 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6362 ;
6363
6364 final OnnxType type;
6365 final Quantifier quantifier;
6366
6367 InputParameter(OnnxType type, Quantifier quantifier) {
6368 this.type = type;
6369 this.quantifier = quantifier;
6370 }
6371
6372 @Override
6373 public OnnxType type() {
6374 return type;
6375 }
6376
6377 @Override
6378 public Quantifier quantifier() {
6379 return quantifier;
6380 }
6381 }
6382
6383 public enum OutputParameter implements OnnxParameter {
6384 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6385 ;
6386
6387 final OnnxType type;
6388 final Quantifier quantifier;
6389
6390 OutputParameter(OnnxType type, Quantifier quantifier) {
6391 this.type = type;
6392 this.quantifier = quantifier;
6393 }
6394
6395 @Override
6396 public OnnxType type() {
6397 return type;
6398 }
6399
6400 @Override
6401 public Quantifier quantifier() {
6402 return quantifier;
6403 }
6404 }
6405
6406 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
6407 NAME,
6408 List.of(Attribute.values()),
6409 List.of(TypeConstraint.values()),
6410 List.of(InputParameter.values()),
6411 List.of(OutputParameter.values())
6412 );
6413
6414 public Cos(ExternalizedOp def) {
6415 super(SCHEMA, def);
6416 }
6417
6418 Cos(Cos that, CodeContext cc) {
6419 super(that, cc);
6420 }
6421
6422 @Override
6423 public Cos transform(CodeContext cc, CodeTransformer ot) {
6424 return new Cos(this, cc);
6425 }
6426
6427 Cos(TypeElement resultType, Value input) {
6428 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
6429 }
6430
6431 @Override
6432 public SequencedSet<OnnxParameter> onnxOutputs() {
6433 return onnxOutputs(SCHEMA);
6434 }
6435
6436 @Override
6437 public SequencedMap<OnnxParameter, Object> onnxInputs() {
6438 return onnxInputs(SCHEMA, List.of(input()));
6439 }
6440
6441 public Value input() {
6442 return operands().get(0);
6443 }
6444
6445 }
6446
6447 public static Cos Cos(TypeElement resultType, Value input) {
6448 return new Cos(resultType, input);
6449 }
6450
6451 @OpFactoryHelper.OpDeclaration(Cosh.NAME)
6452 public static final class Cosh extends OnnxOp {
6453 public static final String NAME = "Cosh";
6454
6455 public enum Attribute implements OnnxAttribute.None { }
6456
6457 public enum TypeConstraint implements OnnxTypeConstraint {
6458 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
6459 ;
6460
6461 final OnnxType.TypeVariable typeVariable;
6462
6463 TypeConstraint(OnnxType.TypeVariable typeVariable) {
6464 assert typeVariable.name().equals(name());
6465 this.typeVariable = typeVariable;
6466 }
6467
6468 @Override
6469 public OnnxType.TypeVariable typeVariable() {
6470 return typeVariable;
6471 }
6472 }
6473
6474 public enum InputParameter implements OnnxParameter {
6475 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6476 ;
6477
6478 final OnnxType type;
6479 final Quantifier quantifier;
6480
6481 InputParameter(OnnxType type, Quantifier quantifier) {
6482 this.type = type;
6483 this.quantifier = quantifier;
6484 }
6485
6486 @Override
6487 public OnnxType type() {
6488 return type;
6489 }
6490
6491 @Override
6492 public Quantifier quantifier() {
6493 return quantifier;
6494 }
6495 }
6496
6497 public enum OutputParameter implements OnnxParameter {
6498 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6499 ;
6500
6501 final OnnxType type;
6502 final Quantifier quantifier;
6503
6504 OutputParameter(OnnxType type, Quantifier quantifier) {
6505 this.type = type;
6506 this.quantifier = quantifier;
6507 }
6508
6509 @Override
6510 public OnnxType type() {
6511 return type;
6512 }
6513
6514 @Override
6515 public Quantifier quantifier() {
6516 return quantifier;
6517 }
6518 }
6519
6520 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
6521 NAME,
6522 List.of(Attribute.values()),
6523 List.of(TypeConstraint.values()),
6524 List.of(InputParameter.values()),
6525 List.of(OutputParameter.values())
6526 );
6527
6528 public Cosh(ExternalizedOp def) {
6529 super(SCHEMA, def);
6530 }
6531
6532 Cosh(Cosh that, CodeContext cc) {
6533 super(that, cc);
6534 }
6535
6536 @Override
6537 public Cosh transform(CodeContext cc, CodeTransformer ot) {
6538 return new Cosh(this, cc);
6539 }
6540
6541 Cosh(TypeElement resultType, Value input) {
6542 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
6543 }
6544
6545 @Override
6546 public SequencedSet<OnnxParameter> onnxOutputs() {
6547 return onnxOutputs(SCHEMA);
6548 }
6549
6550 @Override
6551 public SequencedMap<OnnxParameter, Object> onnxInputs() {
6552 return onnxInputs(SCHEMA, List.of(input()));
6553 }
6554
6555 public Value input() {
6556 return operands().get(0);
6557 }
6558
6559 }
6560
6561 public static Cosh Cosh(TypeElement resultType, Value input) {
6562 return new Cosh(resultType, input);
6563 }
6564
6565 @OpFactoryHelper.OpDeclaration(CumSum.NAME)
6566 public static final class CumSum extends OnnxOp {
6567 public static final String NAME = "CumSum";
6568
6569 public enum Attribute implements OnnxAttribute {
6570 exclusive(Long.class, true, 0),
6571 reverse(Long.class, true, 0),
6572 ;
6573
6574 final Class<?> t;
6575 final boolean optional;
6576 final Object defaultValue;
6577
6578 Attribute(Class<?> type, boolean optional, Object defaultValue) {
6579 this.t = type;
6580 this.optional = optional;
6581 this.defaultValue = defaultValue;
6582 assert optional || defaultValue == null;
6583 }
6584
6585 public Class<?> type() {
6586 return t;
6587 }
6588
6589 public boolean isOptional() {
6590 return optional;
6591 }
6592
6593 public Object defaultValue() {
6594 return defaultValue;
6595 }
6596 }
6597
6598 public enum TypeConstraint implements OnnxTypeConstraint {
6599 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
6600 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
6601 ;
6602
6603 final OnnxType.TypeVariable typeVariable;
6604
6605 TypeConstraint(OnnxType.TypeVariable typeVariable) {
6606 assert typeVariable.name().equals(name());
6607 this.typeVariable = typeVariable;
6608 }
6609
6610 @Override
6611 public OnnxType.TypeVariable typeVariable() {
6612 return typeVariable;
6613 }
6614 }
6615
6616 public enum InputParameter implements OnnxParameter {
6617 x(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6618 axis(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
6619 ;
6620
6621 final OnnxType type;
6622 final Quantifier quantifier;
6623
6624 InputParameter(OnnxType type, Quantifier quantifier) {
6625 this.type = type;
6626 this.quantifier = quantifier;
6627 }
6628
6629 @Override
6630 public OnnxType type() {
6631 return type;
6632 }
6633
6634 @Override
6635 public Quantifier quantifier() {
6636 return quantifier;
6637 }
6638 }
6639
6640 public enum OutputParameter implements OnnxParameter {
6641 y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6642 ;
6643
6644 final OnnxType type;
6645 final Quantifier quantifier;
6646
6647 OutputParameter(OnnxType type, Quantifier quantifier) {
6648 this.type = type;
6649 this.quantifier = quantifier;
6650 }
6651
6652 @Override
6653 public OnnxType type() {
6654 return type;
6655 }
6656
6657 @Override
6658 public Quantifier quantifier() {
6659 return quantifier;
6660 }
6661 }
6662
6663 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
6664 NAME,
6665 List.of(Attribute.values()),
6666 List.of(TypeConstraint.values()),
6667 List.of(InputParameter.values()),
6668 List.of(OutputParameter.values())
6669 );
6670
6671 public CumSum(ExternalizedOp def) {
6672 super(SCHEMA, def);
6673 }
6674
6675 CumSum(CumSum that, CodeContext cc) {
6676 super(that, cc);
6677 }
6678
6679 @Override
6680 public CumSum transform(CodeContext cc, CodeTransformer ot) {
6681 return new CumSum(this, cc);
6682 }
6683
6684 CumSum(TypeElement resultType, Value x, Value axis, java.util.Optional<Long> exclusive, java.util.Optional<Long> reverse) {
6685 super(SCHEMA, resultType, Set.of(), List.of(x, axis), List.of(exclusive, reverse));
6686 }
6687
6688 @Override
6689 public SequencedSet<OnnxParameter> onnxOutputs() {
6690 return onnxOutputs(SCHEMA);
6691 }
6692
6693 @Override
6694 public SequencedMap<OnnxParameter, Object> onnxInputs() {
6695 return onnxInputs(SCHEMA, List.of(x(), axis()));
6696 }
6697
6698 public Value x() {
6699 return operands().get(0);
6700 }
6701
6702 public Value axis() {
6703 return operands().get(1);
6704 }
6705
6706 public java.util.Optional<Long> exclusive() {
6707 Long exclusive = Attribute.exclusive.access(Long.class, onnxAttributes);
6708 return java.util.Optional.ofNullable(exclusive);
6709 }
6710
6711 public java.util.Optional<Long> reverse() {
6712 Long reverse = Attribute.reverse.access(Long.class, onnxAttributes);
6713 return java.util.Optional.ofNullable(reverse);
6714 }
6715
6716 }
6717
6718 public static CumSum CumSum(TypeElement resultType, Value x, Value axis, java.util.Optional<Long> exclusive, java.util.Optional<Long> reverse) {
6719 return new CumSum(resultType, x, axis, exclusive, reverse);
6720 }
6721
6722 @OpFactoryHelper.OpDeclaration(DFT.NAME)
6723 public static final class DFT extends OnnxOp {
6724 public static final String NAME = "DFT";
6725
6726 public enum Attribute implements OnnxAttribute {
6727 inverse(Long.class, true, 0),
6728 onesided(Long.class, true, 0),
6729 ;
6730
6731 final Class<?> t;
6732 final boolean optional;
6733 final Object defaultValue;
6734
6735 Attribute(Class<?> type, boolean optional, Object defaultValue) {
6736 this.t = type;
6737 this.optional = optional;
6738 this.defaultValue = defaultValue;
6739 assert optional || defaultValue == null;
6740 }
6741
6742 public Class<?> type() {
6743 return t;
6744 }
6745
6746 public boolean isOptional() {
6747 return optional;
6748 }
6749
6750 public Object defaultValue() {
6751 return defaultValue;
6752 }
6753 }
6754
6755 public enum TypeConstraint implements OnnxTypeConstraint {
6756 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
6757 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
6758 ;
6759
6760 final OnnxType.TypeVariable typeVariable;
6761
6762 TypeConstraint(OnnxType.TypeVariable typeVariable) {
6763 assert typeVariable.name().equals(name());
6764 this.typeVariable = typeVariable;
6765 }
6766
6767 @Override
6768 public OnnxType.TypeVariable typeVariable() {
6769 return typeVariable;
6770 }
6771 }
6772
6773 public enum InputParameter implements OnnxParameter {
6774 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
6775 dft_length(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
6776 axis(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
6777 ;
6778
6779 final OnnxType type;
6780 final Quantifier quantifier;
6781
6782 InputParameter(OnnxType type, Quantifier quantifier) {
6783 this.type = type;
6784 this.quantifier = quantifier;
6785 }
6786
6787 @Override
6788 public OnnxType type() {
6789 return type;
6790 }
6791
6792 @Override
6793 public Quantifier quantifier() {
6794 return quantifier;
6795 }
6796 }
6797
6798 public enum OutputParameter implements OnnxParameter {
6799 output(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
6800 ;
6801
6802 final OnnxType type;
6803 final Quantifier quantifier;
6804
6805 OutputParameter(OnnxType type, Quantifier quantifier) {
6806 this.type = type;
6807 this.quantifier = quantifier;
6808 }
6809
6810 @Override
6811 public OnnxType type() {
6812 return type;
6813 }
6814
6815 @Override
6816 public Quantifier quantifier() {
6817 return quantifier;
6818 }
6819 }
6820
6821 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
6822 NAME,
6823 List.of(Attribute.values()),
6824 List.of(TypeConstraint.values()),
6825 List.of(InputParameter.values()),
6826 List.of(OutputParameter.values())
6827 );
6828
6829 public DFT(ExternalizedOp def) {
6830 super(SCHEMA, def);
6831 }
6832
6833 DFT(DFT that, CodeContext cc) {
6834 super(that, cc);
6835 }
6836
6837 @Override
6838 public DFT transform(CodeContext cc, CodeTransformer ot) {
6839 return new DFT(this, cc);
6840 }
6841
6842 DFT(TypeElement resultType, Value input, java.util.Optional<Value> dft_length, java.util.Optional<Value> axis, java.util.Optional<Long> inverse, java.util.Optional<Long> onesided) {
6843 super(SCHEMA, resultType, Set.of(), List.of(input, dft_length, axis), List.of(inverse, onesided));
6844 }
6845
6846 @Override
6847 public SequencedSet<OnnxParameter> onnxOutputs() {
6848 return onnxOutputs(SCHEMA);
6849 }
6850
6851 @Override
6852 public SequencedMap<OnnxParameter, Object> onnxInputs() {
6853 return onnxInputs(SCHEMA, List.of(input(), dft_length(), axis()));
6854 }
6855
6856 public Value input() {
6857 return operands().get(0);
6858 }
6859
6860 public java.util.Optional<Value> dft_length() {
6861 int i = optionalInputArguments.indexOf(InputParameter.dft_length);
6862 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
6863 }
6864
6865 public java.util.Optional<Value> axis() {
6866 int i = optionalInputArguments.indexOf(InputParameter.axis);
6867 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
6868 }
6869
6870 public java.util.Optional<Long> inverse() {
6871 Long inverse = Attribute.inverse.access(Long.class, onnxAttributes);
6872 return java.util.Optional.ofNullable(inverse);
6873 }
6874
6875 public java.util.Optional<Long> onesided() {
6876 Long onesided = Attribute.onesided.access(Long.class, onnxAttributes);
6877 return java.util.Optional.ofNullable(onesided);
6878 }
6879
6880 }
6881
6882 public static DFT DFT(TypeElement resultType, Value input, java.util.Optional<Value> dft_length, java.util.Optional<Value> axis, java.util.Optional<Long> inverse, java.util.Optional<Long> onesided) {
6883 return new DFT(resultType, input, dft_length, axis, inverse, onesided);
6884 }
6885
6886 @OpFactoryHelper.OpDeclaration(DeformConv.NAME)
6887 public static final class DeformConv extends OnnxOp {
6888 public static final String NAME = "DeformConv";
6889
6890 public enum Attribute implements OnnxAttribute {
6891 pads(long[].class, true, null),
6892 dilations(long[].class, true, null),
6893 strides(long[].class, true, null),
6894 offset_group(Long.class, true, 1),
6895 group(Long.class, true, 1),
6896 kernel_shape(long[].class, true, null),
6897 ;
6898
6899 final Class<?> t;
6900 final boolean optional;
6901 final Object defaultValue;
6902
6903 Attribute(Class<?> type, boolean optional, Object defaultValue) {
6904 this.t = type;
6905 this.optional = optional;
6906 this.defaultValue = defaultValue;
6907 assert optional || defaultValue == null;
6908 }
6909
6910 public Class<?> type() {
6911 return t;
6912 }
6913
6914 public boolean isOptional() {
6915 return optional;
6916 }
6917
6918 public Object defaultValue() {
6919 return defaultValue;
6920 }
6921 }
6922
6923 public enum TypeConstraint implements OnnxTypeConstraint {
6924 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
6925 ;
6926
6927 final OnnxType.TypeVariable typeVariable;
6928
6929 TypeConstraint(OnnxType.TypeVariable typeVariable) {
6930 assert typeVariable.name().equals(name());
6931 this.typeVariable = typeVariable;
6932 }
6933
6934 @Override
6935 public OnnxType.TypeVariable typeVariable() {
6936 return typeVariable;
6937 }
6938 }
6939
6940 public enum InputParameter implements OnnxParameter {
6941 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6942 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6943 offset(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6944 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
6945 mask(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
6946 ;
6947
6948 final OnnxType type;
6949 final Quantifier quantifier;
6950
6951 InputParameter(OnnxType type, Quantifier quantifier) {
6952 this.type = type;
6953 this.quantifier = quantifier;
6954 }
6955
6956 @Override
6957 public OnnxType type() {
6958 return type;
6959 }
6960
6961 @Override
6962 public Quantifier quantifier() {
6963 return quantifier;
6964 }
6965 }
6966
6967 public enum OutputParameter implements OnnxParameter {
6968 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
6969 ;
6970
6971 final OnnxType type;
6972 final Quantifier quantifier;
6973
6974 OutputParameter(OnnxType type, Quantifier quantifier) {
6975 this.type = type;
6976 this.quantifier = quantifier;
6977 }
6978
6979 @Override
6980 public OnnxType type() {
6981 return type;
6982 }
6983
6984 @Override
6985 public Quantifier quantifier() {
6986 return quantifier;
6987 }
6988 }
6989
6990 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
6991 NAME,
6992 List.of(Attribute.values()),
6993 List.of(TypeConstraint.values()),
6994 List.of(InputParameter.values()),
6995 List.of(OutputParameter.values())
6996 );
6997
6998 public DeformConv(ExternalizedOp def) {
6999 super(SCHEMA, def);
7000 }
7001
7002 DeformConv(DeformConv that, CodeContext cc) {
7003 super(that, cc);
7004 }
7005
7006 @Override
7007 public DeformConv transform(CodeContext cc, CodeTransformer ot) {
7008 return new DeformConv(this, cc);
7009 }
7010
7011 DeformConv(TypeElement resultType, Value X, Value W, Value offset, java.util.Optional<Value> B, java.util.Optional<Value> mask, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<long[]> strides, java.util.Optional<Long> offset_group, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape) {
7012 super(SCHEMA, resultType, Set.of(), List.of(X, W, offset, B, mask), List.of(pads, dilations, strides, offset_group, group, kernel_shape));
7013 }
7014
7015 @Override
7016 public SequencedSet<OnnxParameter> onnxOutputs() {
7017 return onnxOutputs(SCHEMA);
7018 }
7019
7020 @Override
7021 public SequencedMap<OnnxParameter, Object> onnxInputs() {
7022 return onnxInputs(SCHEMA, List.of(X(), W(), offset(), B(), mask()));
7023 }
7024
7025 public Value X() {
7026 return operands().get(0);
7027 }
7028
7029 public Value W() {
7030 return operands().get(1);
7031 }
7032
7033 public Value offset() {
7034 return operands().get(2);
7035 }
7036
7037 public java.util.Optional<Value> B() {
7038 int i = optionalInputArguments.indexOf(InputParameter.B);
7039 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
7040 }
7041
7042 public java.util.Optional<Value> mask() {
7043 int i = optionalInputArguments.indexOf(InputParameter.mask);
7044 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
7045 }
7046
7047 public java.util.Optional<long[]> pads() {
7048 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
7049 return java.util.Optional.ofNullable(pads).map(long[]::clone);
7050 }
7051
7052 public java.util.Optional<long[]> dilations() {
7053 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
7054 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
7055 }
7056
7057 public java.util.Optional<long[]> strides() {
7058 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
7059 return java.util.Optional.ofNullable(strides).map(long[]::clone);
7060 }
7061
7062 public java.util.Optional<Long> offset_group() {
7063 Long offset_group = Attribute.offset_group.access(Long.class, onnxAttributes);
7064 return java.util.Optional.ofNullable(offset_group);
7065 }
7066
7067 public java.util.Optional<Long> group() {
7068 Long group = Attribute.group.access(Long.class, onnxAttributes);
7069 return java.util.Optional.ofNullable(group);
7070 }
7071
7072 public java.util.Optional<long[]> kernel_shape() {
7073 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
7074 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone);
7075 }
7076
7077 }
7078
7079 public static DeformConv DeformConv(TypeElement resultType, Value X, Value W, Value offset, java.util.Optional<Value> B, java.util.Optional<Value> mask, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<long[]> strides, java.util.Optional<Long> offset_group, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape) {
7080 return new DeformConv(resultType, X, W, offset, B, mask, pads, dilations, strides, offset_group, group, kernel_shape);
7081 }
7082
7083 @OpFactoryHelper.OpDeclaration(DepthToSpace.NAME)
7084 public static final class DepthToSpace extends OnnxOp {
7085 public static final String NAME = "DepthToSpace";
7086
7087 public enum Attribute implements OnnxAttribute {
7088 mode(String.class, true, "DCR"),
7089 blocksize(Long.class, false, null),
7090 ;
7091
7092 final Class<?> t;
7093 final boolean optional;
7094 final Object defaultValue;
7095
7096 Attribute(Class<?> type, boolean optional, Object defaultValue) {
7097 this.t = type;
7098 this.optional = optional;
7099 this.defaultValue = defaultValue;
7100 assert optional || defaultValue == null;
7101 }
7102
7103 public Class<?> type() {
7104 return t;
7105 }
7106
7107 public boolean isOptional() {
7108 return optional;
7109 }
7110
7111 public Object defaultValue() {
7112 return defaultValue;
7113 }
7114 }
7115
7116 public enum TypeConstraint implements OnnxTypeConstraint {
7117 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
7118 ;
7119
7120 final OnnxType.TypeVariable typeVariable;
7121
7122 TypeConstraint(OnnxType.TypeVariable typeVariable) {
7123 assert typeVariable.name().equals(name());
7124 this.typeVariable = typeVariable;
7125 }
7126
7127 @Override
7128 public OnnxType.TypeVariable typeVariable() {
7129 return typeVariable;
7130 }
7131 }
7132
7133 public enum InputParameter implements OnnxParameter {
7134 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7135 ;
7136
7137 final OnnxType type;
7138 final Quantifier quantifier;
7139
7140 InputParameter(OnnxType type, Quantifier quantifier) {
7141 this.type = type;
7142 this.quantifier = quantifier;
7143 }
7144
7145 @Override
7146 public OnnxType type() {
7147 return type;
7148 }
7149
7150 @Override
7151 public Quantifier quantifier() {
7152 return quantifier;
7153 }
7154 }
7155
7156 public enum OutputParameter implements OnnxParameter {
7157 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7158 ;
7159
7160 final OnnxType type;
7161 final Quantifier quantifier;
7162
7163 OutputParameter(OnnxType type, Quantifier quantifier) {
7164 this.type = type;
7165 this.quantifier = quantifier;
7166 }
7167
7168 @Override
7169 public OnnxType type() {
7170 return type;
7171 }
7172
7173 @Override
7174 public Quantifier quantifier() {
7175 return quantifier;
7176 }
7177 }
7178
7179 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
7180 NAME,
7181 List.of(Attribute.values()),
7182 List.of(TypeConstraint.values()),
7183 List.of(InputParameter.values()),
7184 List.of(OutputParameter.values())
7185 );
7186
7187 public DepthToSpace(ExternalizedOp def) {
7188 super(SCHEMA, def);
7189 }
7190
7191 DepthToSpace(DepthToSpace that, CodeContext cc) {
7192 super(that, cc);
7193 }
7194
7195 @Override
7196 public DepthToSpace transform(CodeContext cc, CodeTransformer ot) {
7197 return new DepthToSpace(this, cc);
7198 }
7199
7200 DepthToSpace(TypeElement resultType, Value input, java.util.Optional<String> mode, long blocksize) {
7201 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(mode, blocksize));
7202 }
7203
7204 @Override
7205 public SequencedSet<OnnxParameter> onnxOutputs() {
7206 return onnxOutputs(SCHEMA);
7207 }
7208
7209 @Override
7210 public SequencedMap<OnnxParameter, Object> onnxInputs() {
7211 return onnxInputs(SCHEMA, List.of(input()));
7212 }
7213
7214 public Value input() {
7215 return operands().get(0);
7216 }
7217
7218 public java.util.Optional<String> mode() {
7219 String mode = Attribute.mode.access(String.class, onnxAttributes);
7220 return java.util.Optional.ofNullable(mode);
7221 }
7222
7223 public long blocksize() {
7224 long blocksize = Attribute.blocksize.access(Long.class, onnxAttributes);
7225 return blocksize;
7226 }
7227
7228 }
7229
7230 public static DepthToSpace DepthToSpace(TypeElement resultType, Value input, java.util.Optional<String> mode, long blocksize) {
7231 return new DepthToSpace(resultType, input, mode, blocksize);
7232 }
7233
7234 @OpFactoryHelper.OpDeclaration(DequantizeLinear.NAME)
7235 public static final class DequantizeLinear extends OnnxOp {
7236 public static final String NAME = "DequantizeLinear";
7237
7238 public enum Attribute implements OnnxAttribute {
7239 output_dtype(Long.class, true, 0),
7240 axis(Long.class, true, 1),
7241 block_size(Long.class, true, 0),
7242 ;
7243
7244 final Class<?> t;
7245 final boolean optional;
7246 final Object defaultValue;
7247
7248 Attribute(Class<?> type, boolean optional, Object defaultValue) {
7249 this.t = type;
7250 this.optional = optional;
7251 this.defaultValue = defaultValue;
7252 assert optional || defaultValue == null;
7253 }
7254
7255 public Class<?> type() {
7256 return t;
7257 }
7258
7259 public boolean isOptional() {
7260 return optional;
7261 }
7262
7263 public Object defaultValue() {
7264 return defaultValue;
7265 }
7266 }
7267
7268 public enum TypeConstraint implements OnnxTypeConstraint {
7269 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1())))),
7270 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float8e8m0())))),
7271 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16())))),
7272 ;
7273
7274 final OnnxType.TypeVariable typeVariable;
7275
7276 TypeConstraint(OnnxType.TypeVariable typeVariable) {
7277 assert typeVariable.name().equals(name());
7278 this.typeVariable = typeVariable;
7279 }
7280
7281 @Override
7282 public OnnxType.TypeVariable typeVariable() {
7283 return typeVariable;
7284 }
7285 }
7286
7287 public enum InputParameter implements OnnxParameter {
7288 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
7289 x_scale(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
7290 x_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
7291 ;
7292
7293 final OnnxType type;
7294 final Quantifier quantifier;
7295
7296 InputParameter(OnnxType type, Quantifier quantifier) {
7297 this.type = type;
7298 this.quantifier = quantifier;
7299 }
7300
7301 @Override
7302 public OnnxType type() {
7303 return type;
7304 }
7305
7306 @Override
7307 public Quantifier quantifier() {
7308 return quantifier;
7309 }
7310 }
7311
7312 public enum OutputParameter implements OnnxParameter {
7313 y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
7314 ;
7315
7316 final OnnxType type;
7317 final Quantifier quantifier;
7318
7319 OutputParameter(OnnxType type, Quantifier quantifier) {
7320 this.type = type;
7321 this.quantifier = quantifier;
7322 }
7323
7324 @Override
7325 public OnnxType type() {
7326 return type;
7327 }
7328
7329 @Override
7330 public Quantifier quantifier() {
7331 return quantifier;
7332 }
7333 }
7334
7335 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
7336 NAME,
7337 List.of(Attribute.values()),
7338 List.of(TypeConstraint.values()),
7339 List.of(InputParameter.values()),
7340 List.of(OutputParameter.values())
7341 );
7342
7343 public DequantizeLinear(ExternalizedOp def) {
7344 super(SCHEMA, def);
7345 }
7346
7347 DequantizeLinear(DequantizeLinear that, CodeContext cc) {
7348 super(that, cc);
7349 }
7350
7351 @Override
7352 public DequantizeLinear transform(CodeContext cc, CodeTransformer ot) {
7353 return new DequantizeLinear(this, cc);
7354 }
7355
7356 DequantizeLinear(TypeElement resultType, Value x, Value x_scale, java.util.Optional<Value> x_zero_point, java.util.Optional<Long> output_dtype, java.util.Optional<Long> axis, java.util.Optional<Long> block_size) {
7357 super(SCHEMA, resultType, Set.of(), List.of(x, x_scale, x_zero_point), List.of(output_dtype, axis, block_size));
7358 }
7359
7360 @Override
7361 public SequencedSet<OnnxParameter> onnxOutputs() {
7362 return onnxOutputs(SCHEMA);
7363 }
7364
7365 @Override
7366 public SequencedMap<OnnxParameter, Object> onnxInputs() {
7367 return onnxInputs(SCHEMA, List.of(x(), x_scale(), x_zero_point()));
7368 }
7369
7370 public Value x() {
7371 return operands().get(0);
7372 }
7373
7374 public Value x_scale() {
7375 return operands().get(1);
7376 }
7377
7378 public java.util.Optional<Value> x_zero_point() {
7379 int i = optionalInputArguments.indexOf(InputParameter.x_zero_point);
7380 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
7381 }
7382
7383 public java.util.Optional<Long> output_dtype() {
7384 Long output_dtype = Attribute.output_dtype.access(Long.class, onnxAttributes);
7385 return java.util.Optional.ofNullable(output_dtype);
7386 }
7387
7388 public java.util.Optional<Long> axis() {
7389 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
7390 return java.util.Optional.ofNullable(axis);
7391 }
7392
7393 public java.util.Optional<Long> block_size() {
7394 Long block_size = Attribute.block_size.access(Long.class, onnxAttributes);
7395 return java.util.Optional.ofNullable(block_size);
7396 }
7397
7398 }
7399
7400 public static DequantizeLinear DequantizeLinear(TypeElement resultType, Value x, Value x_scale, java.util.Optional<Value> x_zero_point, java.util.Optional<Long> output_dtype, java.util.Optional<Long> axis, java.util.Optional<Long> block_size) {
7401 return new DequantizeLinear(resultType, x, x_scale, x_zero_point, output_dtype, axis, block_size);
7402 }
7403
7404 @OpFactoryHelper.OpDeclaration(Det.NAME)
7405 public static final class Det extends OnnxOp {
7406 public static final String NAME = "Det";
7407
7408 public enum Attribute implements OnnxAttribute.None { }
7409
7410 public enum TypeConstraint implements OnnxTypeConstraint {
7411 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
7412 ;
7413
7414 final OnnxType.TypeVariable typeVariable;
7415
7416 TypeConstraint(OnnxType.TypeVariable typeVariable) {
7417 assert typeVariable.name().equals(name());
7418 this.typeVariable = typeVariable;
7419 }
7420
7421 @Override
7422 public OnnxType.TypeVariable typeVariable() {
7423 return typeVariable;
7424 }
7425 }
7426
7427 public enum InputParameter implements OnnxParameter {
7428 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7429 ;
7430
7431 final OnnxType type;
7432 final Quantifier quantifier;
7433
7434 InputParameter(OnnxType type, Quantifier quantifier) {
7435 this.type = type;
7436 this.quantifier = quantifier;
7437 }
7438
7439 @Override
7440 public OnnxType type() {
7441 return type;
7442 }
7443
7444 @Override
7445 public Quantifier quantifier() {
7446 return quantifier;
7447 }
7448 }
7449
7450 public enum OutputParameter implements OnnxParameter {
7451 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7452 ;
7453
7454 final OnnxType type;
7455 final Quantifier quantifier;
7456
7457 OutputParameter(OnnxType type, Quantifier quantifier) {
7458 this.type = type;
7459 this.quantifier = quantifier;
7460 }
7461
7462 @Override
7463 public OnnxType type() {
7464 return type;
7465 }
7466
7467 @Override
7468 public Quantifier quantifier() {
7469 return quantifier;
7470 }
7471 }
7472
7473 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
7474 NAME,
7475 List.of(Attribute.values()),
7476 List.of(TypeConstraint.values()),
7477 List.of(InputParameter.values()),
7478 List.of(OutputParameter.values())
7479 );
7480
7481 public Det(ExternalizedOp def) {
7482 super(SCHEMA, def);
7483 }
7484
7485 Det(Det that, CodeContext cc) {
7486 super(that, cc);
7487 }
7488
7489 @Override
7490 public Det transform(CodeContext cc, CodeTransformer ot) {
7491 return new Det(this, cc);
7492 }
7493
7494 Det(TypeElement resultType, Value X) {
7495 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
7496 }
7497
7498 @Override
7499 public SequencedSet<OnnxParameter> onnxOutputs() {
7500 return onnxOutputs(SCHEMA);
7501 }
7502
7503 @Override
7504 public SequencedMap<OnnxParameter, Object> onnxInputs() {
7505 return onnxInputs(SCHEMA, List.of(X()));
7506 }
7507
7508 public Value X() {
7509 return operands().get(0);
7510 }
7511
7512 }
7513
7514 public static Det Det(TypeElement resultType, Value X) {
7515 return new Det(resultType, X);
7516 }
7517
7518 @OpFactoryHelper.OpDeclaration(DictVectorizer.NAME)
7519 public static final class DictVectorizer extends OnnxOp {
7520 public static final String NAME = "DictVectorizer";
7521
7522 public enum Attribute implements OnnxAttribute {
7523 string_vocabulary(String[].class, true, null),
7524 int64_vocabulary(long[].class, true, null),
7525 ;
7526
7527 final Class<?> t;
7528 final boolean optional;
7529 final Object defaultValue;
7530
7531 Attribute(Class<?> type, boolean optional, Object defaultValue) {
7532 this.t = type;
7533 this.optional = optional;
7534 this.defaultValue = defaultValue;
7535 assert optional || defaultValue == null;
7536 }
7537
7538 public Class<?> type() {
7539 return t;
7540 }
7541
7542 public boolean isOptional() {
7543 return optional;
7544 }
7545
7546 public Object defaultValue() {
7547 return defaultValue;
7548 }
7549 }
7550
7551 public enum TypeConstraint implements OnnxTypeConstraint {
7552 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.map(OnnxType.string(), OnnxType.int64()), OnnxType.map(OnnxType.int64(), OnnxType.string()), OnnxType.map(OnnxType.int64(), OnnxType.float32()), OnnxType.map(OnnxType.int64(), OnnxType.float64()), OnnxType.map(OnnxType.string(), OnnxType.float32()), OnnxType.map(OnnxType.string(), OnnxType.float64())))),
7553 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string())))),
7554 ;
7555
7556 final OnnxType.TypeVariable typeVariable;
7557
7558 TypeConstraint(OnnxType.TypeVariable typeVariable) {
7559 assert typeVariable.name().equals(name());
7560 this.typeVariable = typeVariable;
7561 }
7562
7563 @Override
7564 public OnnxType.TypeVariable typeVariable() {
7565 return typeVariable;
7566 }
7567 }
7568
7569 public enum InputParameter implements OnnxParameter {
7570 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
7571 ;
7572
7573 final OnnxType type;
7574 final Quantifier quantifier;
7575
7576 InputParameter(OnnxType type, Quantifier quantifier) {
7577 this.type = type;
7578 this.quantifier = quantifier;
7579 }
7580
7581 @Override
7582 public OnnxType type() {
7583 return type;
7584 }
7585
7586 @Override
7587 public Quantifier quantifier() {
7588 return quantifier;
7589 }
7590 }
7591
7592 public enum OutputParameter implements OnnxParameter {
7593 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
7594 ;
7595
7596 final OnnxType type;
7597 final Quantifier quantifier;
7598
7599 OutputParameter(OnnxType type, Quantifier quantifier) {
7600 this.type = type;
7601 this.quantifier = quantifier;
7602 }
7603
7604 @Override
7605 public OnnxType type() {
7606 return type;
7607 }
7608
7609 @Override
7610 public Quantifier quantifier() {
7611 return quantifier;
7612 }
7613 }
7614
7615 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
7616 NAME,
7617 List.of(Attribute.values()),
7618 List.of(TypeConstraint.values()),
7619 List.of(InputParameter.values()),
7620 List.of(OutputParameter.values())
7621 );
7622
7623 public DictVectorizer(ExternalizedOp def) {
7624 super(SCHEMA, def);
7625 }
7626
7627 DictVectorizer(DictVectorizer that, CodeContext cc) {
7628 super(that, cc);
7629 }
7630
7631 @Override
7632 public DictVectorizer transform(CodeContext cc, CodeTransformer ot) {
7633 return new DictVectorizer(this, cc);
7634 }
7635
7636 DictVectorizer(TypeElement resultType, Value X, java.util.Optional<String[]> string_vocabulary, java.util.Optional<long[]> int64_vocabulary) {
7637 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(string_vocabulary, int64_vocabulary));
7638 }
7639
7640 @Override
7641 public SequencedSet<OnnxParameter> onnxOutputs() {
7642 return onnxOutputs(SCHEMA);
7643 }
7644
7645 @Override
7646 public SequencedMap<OnnxParameter, Object> onnxInputs() {
7647 return onnxInputs(SCHEMA, List.of(X()));
7648 }
7649
7650 public Value X() {
7651 return operands().get(0);
7652 }
7653
7654 public java.util.Optional<String[]> string_vocabulary() {
7655 String[] string_vocabulary = Attribute.string_vocabulary.access(String[].class, onnxAttributes);
7656 return java.util.Optional.ofNullable(string_vocabulary).map(String[]::clone);
7657 }
7658
7659 public java.util.Optional<long[]> int64_vocabulary() {
7660 long[] int64_vocabulary = Attribute.int64_vocabulary.access(long[].class, onnxAttributes);
7661 return java.util.Optional.ofNullable(int64_vocabulary).map(long[]::clone);
7662 }
7663
7664 }
7665
7666 public static DictVectorizer DictVectorizer(TypeElement resultType, Value X, java.util.Optional<String[]> string_vocabulary, java.util.Optional<long[]> int64_vocabulary) {
7667 return new DictVectorizer(resultType, X, string_vocabulary, int64_vocabulary);
7668 }
7669
7670 @OpFactoryHelper.OpDeclaration(Div.NAME)
7671 public static final class Div extends OnnxOp {
7672 public static final String NAME = "Div";
7673
7674 public enum Attribute implements OnnxAttribute.None { }
7675
7676 public enum TypeConstraint implements OnnxTypeConstraint {
7677 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
7678 ;
7679
7680 final OnnxType.TypeVariable typeVariable;
7681
7682 TypeConstraint(OnnxType.TypeVariable typeVariable) {
7683 assert typeVariable.name().equals(name());
7684 this.typeVariable = typeVariable;
7685 }
7686
7687 @Override
7688 public OnnxType.TypeVariable typeVariable() {
7689 return typeVariable;
7690 }
7691 }
7692
7693 public enum InputParameter implements OnnxParameter {
7694 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7695 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7696 ;
7697
7698 final OnnxType type;
7699 final Quantifier quantifier;
7700
7701 InputParameter(OnnxType type, Quantifier quantifier) {
7702 this.type = type;
7703 this.quantifier = quantifier;
7704 }
7705
7706 @Override
7707 public OnnxType type() {
7708 return type;
7709 }
7710
7711 @Override
7712 public Quantifier quantifier() {
7713 return quantifier;
7714 }
7715 }
7716
7717 public enum OutputParameter implements OnnxParameter {
7718 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7719 ;
7720
7721 final OnnxType type;
7722 final Quantifier quantifier;
7723
7724 OutputParameter(OnnxType type, Quantifier quantifier) {
7725 this.type = type;
7726 this.quantifier = quantifier;
7727 }
7728
7729 @Override
7730 public OnnxType type() {
7731 return type;
7732 }
7733
7734 @Override
7735 public Quantifier quantifier() {
7736 return quantifier;
7737 }
7738 }
7739
7740 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
7741 NAME,
7742 List.of(Attribute.values()),
7743 List.of(TypeConstraint.values()),
7744 List.of(InputParameter.values()),
7745 List.of(OutputParameter.values())
7746 );
7747
7748 public Div(ExternalizedOp def) {
7749 super(SCHEMA, def);
7750 }
7751
7752 Div(Div that, CodeContext cc) {
7753 super(that, cc);
7754 }
7755
7756 @Override
7757 public Div transform(CodeContext cc, CodeTransformer ot) {
7758 return new Div(this, cc);
7759 }
7760
7761 Div(TypeElement resultType, Value A, Value B) {
7762 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
7763 }
7764
7765 @Override
7766 public SequencedSet<OnnxParameter> onnxOutputs() {
7767 return onnxOutputs(SCHEMA);
7768 }
7769
7770 @Override
7771 public SequencedMap<OnnxParameter, Object> onnxInputs() {
7772 return onnxInputs(SCHEMA, List.of(A(), B()));
7773 }
7774
7775 public Value A() {
7776 return operands().get(0);
7777 }
7778
7779 public Value B() {
7780 return operands().get(1);
7781 }
7782
7783 }
7784
7785 public static Div Div(TypeElement resultType, Value A, Value B) {
7786 return new Div(resultType, A, B);
7787 }
7788
7789 @OpFactoryHelper.OpDeclaration(Dropout.NAME)
7790 public static final class Dropout extends OnnxOp {
7791 public static final String NAME = "Dropout";
7792
7793 public enum Attribute implements OnnxAttribute {
7794 seed(Long.class, true, null),
7795 ;
7796
7797 final Class<?> t;
7798 final boolean optional;
7799 final Object defaultValue;
7800
7801 Attribute(Class<?> type, boolean optional, Object defaultValue) {
7802 this.t = type;
7803 this.optional = optional;
7804 this.defaultValue = defaultValue;
7805 assert optional || defaultValue == null;
7806 }
7807
7808 public Class<?> type() {
7809 return t;
7810 }
7811
7812 public boolean isOptional() {
7813 return optional;
7814 }
7815
7816 public Object defaultValue() {
7817 return defaultValue;
7818 }
7819 }
7820
7821 public enum TypeConstraint implements OnnxTypeConstraint {
7822 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz())))),
7823 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz())))),
7824 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bool())))),
7825 ;
7826
7827 final OnnxType.TypeVariable typeVariable;
7828
7829 TypeConstraint(OnnxType.TypeVariable typeVariable) {
7830 assert typeVariable.name().equals(name());
7831 this.typeVariable = typeVariable;
7832 }
7833
7834 @Override
7835 public OnnxType.TypeVariable typeVariable() {
7836 return typeVariable;
7837 }
7838 }
7839
7840 public enum InputParameter implements OnnxParameter {
7841 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7842 ratio(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
7843 training_mode(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
7844 ;
7845
7846 final OnnxType type;
7847 final Quantifier quantifier;
7848
7849 InputParameter(OnnxType type, Quantifier quantifier) {
7850 this.type = type;
7851 this.quantifier = quantifier;
7852 }
7853
7854 @Override
7855 public OnnxType type() {
7856 return type;
7857 }
7858
7859 @Override
7860 public Quantifier quantifier() {
7861 return quantifier;
7862 }
7863 }
7864
7865 public enum OutputParameter implements OnnxParameter {
7866 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
7867 mask(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
7868 ;
7869
7870 final OnnxType type;
7871 final Quantifier quantifier;
7872
7873 OutputParameter(OnnxType type, Quantifier quantifier) {
7874 this.type = type;
7875 this.quantifier = quantifier;
7876 }
7877
7878 @Override
7879 public OnnxType type() {
7880 return type;
7881 }
7882
7883 @Override
7884 public Quantifier quantifier() {
7885 return quantifier;
7886 }
7887 }
7888
7889 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
7890 NAME,
7891 List.of(Attribute.values()),
7892 List.of(TypeConstraint.values()),
7893 List.of(InputParameter.values()),
7894 List.of(OutputParameter.values())
7895 );
7896
7897 public Dropout(ExternalizedOp def) {
7898 super(SCHEMA, def);
7899 }
7900
7901 Dropout(Dropout that, CodeContext cc) {
7902 super(that, cc);
7903 }
7904
7905 @Override
7906 public Dropout transform(CodeContext cc, CodeTransformer ot) {
7907 return new Dropout(this, cc);
7908 }
7909
7910 Dropout(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value data, java.util.Optional<Value> ratio, java.util.Optional<Value> training_mode, java.util.Optional<Long> seed) {
7911 super(SCHEMA, resultType, optionalOutputs, List.of(data, ratio, training_mode), List.of(seed));
7912 }
7913
7914 @Override
7915 public SequencedSet<OnnxParameter> onnxOutputs() {
7916 return onnxOutputs(SCHEMA);
7917 }
7918
7919 @Override
7920 public SequencedMap<OnnxParameter, Object> onnxInputs() {
7921 return onnxInputs(SCHEMA, List.of(data(), ratio(), training_mode()));
7922 }
7923
7924 public Value data() {
7925 return operands().get(0);
7926 }
7927
7928 public java.util.Optional<Value> ratio() {
7929 int i = optionalInputArguments.indexOf(InputParameter.ratio);
7930 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
7931 }
7932
7933 public java.util.Optional<Value> training_mode() {
7934 int i = optionalInputArguments.indexOf(InputParameter.training_mode);
7935 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
7936 }
7937
7938 public java.util.Optional<Long> seed() {
7939 Long seed = Attribute.seed.access(Long.class, onnxAttributes);
7940 return java.util.Optional.ofNullable(seed);
7941 }
7942
7943 }
7944
7945 public static Dropout Dropout(TypeElement resultType, Set<Dropout.OutputParameter> optionalOutputs, Value data, java.util.Optional<Value> ratio, java.util.Optional<Value> training_mode, java.util.Optional<Long> seed) {
7946 return new Dropout(resultType, optionalOutputs, data, ratio, training_mode, seed);
7947 }
7948
7949 @OpFactoryHelper.OpDeclaration(DynamicQuantizeLinear.NAME)
7950 public static final class DynamicQuantizeLinear extends OnnxOp {
7951 public static final String NAME = "DynamicQuantizeLinear";
7952
7953 public enum Attribute implements OnnxAttribute.None { }
7954
7955 public enum TypeConstraint implements OnnxTypeConstraint {
7956 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32())))),
7957 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8())))),
7958 ;
7959
7960 final OnnxType.TypeVariable typeVariable;
7961
7962 TypeConstraint(OnnxType.TypeVariable typeVariable) {
7963 assert typeVariable.name().equals(name());
7964 this.typeVariable = typeVariable;
7965 }
7966
7967 @Override
7968 public OnnxType.TypeVariable typeVariable() {
7969 return typeVariable;
7970 }
7971 }
7972
7973 public enum InputParameter implements OnnxParameter {
7974 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
7975 ;
7976
7977 final OnnxType type;
7978 final Quantifier quantifier;
7979
7980 InputParameter(OnnxType type, Quantifier quantifier) {
7981 this.type = type;
7982 this.quantifier = quantifier;
7983 }
7984
7985 @Override
7986 public OnnxType type() {
7987 return type;
7988 }
7989
7990 @Override
7991 public Quantifier quantifier() {
7992 return quantifier;
7993 }
7994 }
7995
7996 public enum OutputParameter implements OnnxParameter {
7997 y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
7998 y_scale(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
7999 y_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
8000 ;
8001
8002 final OnnxType type;
8003 final Quantifier quantifier;
8004
8005 OutputParameter(OnnxType type, Quantifier quantifier) {
8006 this.type = type;
8007 this.quantifier = quantifier;
8008 }
8009
8010 @Override
8011 public OnnxType type() {
8012 return type;
8013 }
8014
8015 @Override
8016 public Quantifier quantifier() {
8017 return quantifier;
8018 }
8019 }
8020
8021 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
8022 NAME,
8023 List.of(Attribute.values()),
8024 List.of(TypeConstraint.values()),
8025 List.of(InputParameter.values()),
8026 List.of(OutputParameter.values())
8027 );
8028
8029 public DynamicQuantizeLinear(ExternalizedOp def) {
8030 super(SCHEMA, def);
8031 }
8032
8033 DynamicQuantizeLinear(DynamicQuantizeLinear that, CodeContext cc) {
8034 super(that, cc);
8035 }
8036
8037 @Override
8038 public DynamicQuantizeLinear transform(CodeContext cc, CodeTransformer ot) {
8039 return new DynamicQuantizeLinear(this, cc);
8040 }
8041
8042 DynamicQuantizeLinear(TypeElement resultType, Value x) {
8043 super(SCHEMA, resultType, Set.of(), List.of(x), List.of());
8044 }
8045
8046 @Override
8047 public SequencedSet<OnnxParameter> onnxOutputs() {
8048 return onnxOutputs(SCHEMA);
8049 }
8050
8051 @Override
8052 public SequencedMap<OnnxParameter, Object> onnxInputs() {
8053 return onnxInputs(SCHEMA, List.of(x()));
8054 }
8055
8056 public Value x() {
8057 return operands().get(0);
8058 }
8059
8060 }
8061
8062 public static DynamicQuantizeLinear DynamicQuantizeLinear(TypeElement resultType, Value x) {
8063 return new DynamicQuantizeLinear(resultType, x);
8064 }
8065
8066 @OpFactoryHelper.OpDeclaration(Einsum.NAME)
8067 public static final class Einsum extends OnnxOp {
8068 public static final String NAME = "Einsum";
8069
8070 public enum Attribute implements OnnxAttribute {
8071 equation(String.class, false, null),
8072 ;
8073
8074 final Class<?> t;
8075 final boolean optional;
8076 final Object defaultValue;
8077
8078 Attribute(Class<?> type, boolean optional, Object defaultValue) {
8079 this.t = type;
8080 this.optional = optional;
8081 this.defaultValue = defaultValue;
8082 assert optional || defaultValue == null;
8083 }
8084
8085 public Class<?> type() {
8086 return t;
8087 }
8088
8089 public boolean isOptional() {
8090 return optional;
8091 }
8092
8093 public Object defaultValue() {
8094 return defaultValue;
8095 }
8096 }
8097
8098 public enum TypeConstraint implements OnnxTypeConstraint {
8099 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
8100 ;
8101
8102 final OnnxType.TypeVariable typeVariable;
8103
8104 TypeConstraint(OnnxType.TypeVariable typeVariable) {
8105 assert typeVariable.name().equals(name());
8106 this.typeVariable = typeVariable;
8107 }
8108
8109 @Override
8110 public OnnxType.TypeVariable typeVariable() {
8111 return typeVariable;
8112 }
8113 }
8114
8115 public enum InputParameter implements OnnxParameter {
8116 Inputs(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC),
8117 ;
8118
8119 final OnnxType type;
8120 final Quantifier quantifier;
8121
8122 InputParameter(OnnxType type, Quantifier quantifier) {
8123 this.type = type;
8124 this.quantifier = quantifier;
8125 }
8126
8127 @Override
8128 public OnnxType type() {
8129 return type;
8130 }
8131
8132 @Override
8133 public Quantifier quantifier() {
8134 return quantifier;
8135 }
8136 }
8137
8138 public enum OutputParameter implements OnnxParameter {
8139 Output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8140 ;
8141
8142 final OnnxType type;
8143 final Quantifier quantifier;
8144
8145 OutputParameter(OnnxType type, Quantifier quantifier) {
8146 this.type = type;
8147 this.quantifier = quantifier;
8148 }
8149
8150 @Override
8151 public OnnxType type() {
8152 return type;
8153 }
8154
8155 @Override
8156 public Quantifier quantifier() {
8157 return quantifier;
8158 }
8159 }
8160
8161 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
8162 NAME,
8163 List.of(Attribute.values()),
8164 List.of(TypeConstraint.values()),
8165 List.of(InputParameter.values()),
8166 List.of(OutputParameter.values())
8167 );
8168
8169 public Einsum(ExternalizedOp def) {
8170 super(SCHEMA, def);
8171 }
8172
8173 Einsum(Einsum that, CodeContext cc) {
8174 super(that, cc);
8175 }
8176
8177 @Override
8178 public Einsum transform(CodeContext cc, CodeTransformer ot) {
8179 return new Einsum(this, cc);
8180 }
8181
8182 Einsum(TypeElement resultType, List<Value> Inputs, String equation) {
8183 super(SCHEMA, resultType, Set.of(), List.of(Inputs), List.of(equation));
8184 }
8185
8186 @Override
8187 public SequencedSet<OnnxParameter> onnxOutputs() {
8188 return onnxOutputs(SCHEMA);
8189 }
8190
8191 @Override
8192 public SequencedMap<OnnxParameter, Object> onnxInputs() {
8193 return onnxInputs(SCHEMA, List.of(Inputs()));
8194 }
8195
8196 public List<Value> Inputs() {
8197 return operands();
8198 }
8199
8200 public String equation() {
8201 String equation = Attribute.equation.access(String.class, onnxAttributes);
8202 return equation;
8203 }
8204
8205 }
8206
8207 public static Einsum Einsum(TypeElement resultType, List<Value> Inputs, String equation) {
8208 return new Einsum(resultType, Inputs, equation);
8209 }
8210
8211 @OpFactoryHelper.OpDeclaration(Elu.NAME)
8212 public static final class Elu extends OnnxOp {
8213 public static final String NAME = "Elu";
8214
8215 public enum Attribute implements OnnxAttribute {
8216 alpha(Float.class, true, 1.0f),
8217 ;
8218
8219 final Class<?> t;
8220 final boolean optional;
8221 final Object defaultValue;
8222
8223 Attribute(Class<?> type, boolean optional, Object defaultValue) {
8224 this.t = type;
8225 this.optional = optional;
8226 this.defaultValue = defaultValue;
8227 assert optional || defaultValue == null;
8228 }
8229
8230 public Class<?> type() {
8231 return t;
8232 }
8233
8234 public boolean isOptional() {
8235 return optional;
8236 }
8237
8238 public Object defaultValue() {
8239 return defaultValue;
8240 }
8241 }
8242
8243 public enum TypeConstraint implements OnnxTypeConstraint {
8244 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
8245 ;
8246
8247 final OnnxType.TypeVariable typeVariable;
8248
8249 TypeConstraint(OnnxType.TypeVariable typeVariable) {
8250 assert typeVariable.name().equals(name());
8251 this.typeVariable = typeVariable;
8252 }
8253
8254 @Override
8255 public OnnxType.TypeVariable typeVariable() {
8256 return typeVariable;
8257 }
8258 }
8259
8260 public enum InputParameter implements OnnxParameter {
8261 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8262 ;
8263
8264 final OnnxType type;
8265 final Quantifier quantifier;
8266
8267 InputParameter(OnnxType type, Quantifier quantifier) {
8268 this.type = type;
8269 this.quantifier = quantifier;
8270 }
8271
8272 @Override
8273 public OnnxType type() {
8274 return type;
8275 }
8276
8277 @Override
8278 public Quantifier quantifier() {
8279 return quantifier;
8280 }
8281 }
8282
8283 public enum OutputParameter implements OnnxParameter {
8284 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8285 ;
8286
8287 final OnnxType type;
8288 final Quantifier quantifier;
8289
8290 OutputParameter(OnnxType type, Quantifier quantifier) {
8291 this.type = type;
8292 this.quantifier = quantifier;
8293 }
8294
8295 @Override
8296 public OnnxType type() {
8297 return type;
8298 }
8299
8300 @Override
8301 public Quantifier quantifier() {
8302 return quantifier;
8303 }
8304 }
8305
8306 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
8307 NAME,
8308 List.of(Attribute.values()),
8309 List.of(TypeConstraint.values()),
8310 List.of(InputParameter.values()),
8311 List.of(OutputParameter.values())
8312 );
8313
8314 public Elu(ExternalizedOp def) {
8315 super(SCHEMA, def);
8316 }
8317
8318 Elu(Elu that, CodeContext cc) {
8319 super(that, cc);
8320 }
8321
8322 @Override
8323 public Elu transform(CodeContext cc, CodeTransformer ot) {
8324 return new Elu(this, cc);
8325 }
8326
8327 Elu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
8328 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha));
8329 }
8330
8331 @Override
8332 public SequencedSet<OnnxParameter> onnxOutputs() {
8333 return onnxOutputs(SCHEMA);
8334 }
8335
8336 @Override
8337 public SequencedMap<OnnxParameter, Object> onnxInputs() {
8338 return onnxInputs(SCHEMA, List.of(X()));
8339 }
8340
8341 public Value X() {
8342 return operands().get(0);
8343 }
8344
8345 public java.util.Optional<Float> alpha() {
8346 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
8347 return java.util.Optional.ofNullable(alpha);
8348 }
8349
8350 }
8351
8352 public static Elu Elu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
8353 return new Elu(resultType, X, alpha);
8354 }
8355
8356 @OpFactoryHelper.OpDeclaration(Equal.NAME)
8357 public static final class Equal extends OnnxOp {
8358 public static final String NAME = "Equal";
8359
8360 public enum Attribute implements OnnxAttribute.None { }
8361
8362 public enum TypeConstraint implements OnnxTypeConstraint {
8363 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.string())))),
8364 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
8365 ;
8366
8367 final OnnxType.TypeVariable typeVariable;
8368
8369 TypeConstraint(OnnxType.TypeVariable typeVariable) {
8370 assert typeVariable.name().equals(name());
8371 this.typeVariable = typeVariable;
8372 }
8373
8374 @Override
8375 public OnnxType.TypeVariable typeVariable() {
8376 return typeVariable;
8377 }
8378 }
8379
8380 public enum InputParameter implements OnnxParameter {
8381 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8382 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8383 ;
8384
8385 final OnnxType type;
8386 final Quantifier quantifier;
8387
8388 InputParameter(OnnxType type, Quantifier quantifier) {
8389 this.type = type;
8390 this.quantifier = quantifier;
8391 }
8392
8393 @Override
8394 public OnnxType type() {
8395 return type;
8396 }
8397
8398 @Override
8399 public Quantifier quantifier() {
8400 return quantifier;
8401 }
8402 }
8403
8404 public enum OutputParameter implements OnnxParameter {
8405 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
8406 ;
8407
8408 final OnnxType type;
8409 final Quantifier quantifier;
8410
8411 OutputParameter(OnnxType type, Quantifier quantifier) {
8412 this.type = type;
8413 this.quantifier = quantifier;
8414 }
8415
8416 @Override
8417 public OnnxType type() {
8418 return type;
8419 }
8420
8421 @Override
8422 public Quantifier quantifier() {
8423 return quantifier;
8424 }
8425 }
8426
8427 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
8428 NAME,
8429 List.of(Attribute.values()),
8430 List.of(TypeConstraint.values()),
8431 List.of(InputParameter.values()),
8432 List.of(OutputParameter.values())
8433 );
8434
8435 public Equal(ExternalizedOp def) {
8436 super(SCHEMA, def);
8437 }
8438
8439 Equal(Equal that, CodeContext cc) {
8440 super(that, cc);
8441 }
8442
8443 @Override
8444 public Equal transform(CodeContext cc, CodeTransformer ot) {
8445 return new Equal(this, cc);
8446 }
8447
8448 Equal(TypeElement resultType, Value A, Value B) {
8449 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
8450 }
8451
8452 @Override
8453 public SequencedSet<OnnxParameter> onnxOutputs() {
8454 return onnxOutputs(SCHEMA);
8455 }
8456
8457 @Override
8458 public SequencedMap<OnnxParameter, Object> onnxInputs() {
8459 return onnxInputs(SCHEMA, List.of(A(), B()));
8460 }
8461
8462 public Value A() {
8463 return operands().get(0);
8464 }
8465
8466 public Value B() {
8467 return operands().get(1);
8468 }
8469
8470 }
8471
8472 public static Equal Equal(TypeElement resultType, Value A, Value B) {
8473 return new Equal(resultType, A, B);
8474 }
8475
8476 @OpFactoryHelper.OpDeclaration(Erf.NAME)
8477 public static final class Erf extends OnnxOp {
8478 public static final String NAME = "Erf";
8479
8480 public enum Attribute implements OnnxAttribute.None { }
8481
8482 public enum TypeConstraint implements OnnxTypeConstraint {
8483 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
8484 ;
8485
8486 final OnnxType.TypeVariable typeVariable;
8487
8488 TypeConstraint(OnnxType.TypeVariable typeVariable) {
8489 assert typeVariable.name().equals(name());
8490 this.typeVariable = typeVariable;
8491 }
8492
8493 @Override
8494 public OnnxType.TypeVariable typeVariable() {
8495 return typeVariable;
8496 }
8497 }
8498
8499 public enum InputParameter implements OnnxParameter {
8500 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8501 ;
8502
8503 final OnnxType type;
8504 final Quantifier quantifier;
8505
8506 InputParameter(OnnxType type, Quantifier quantifier) {
8507 this.type = type;
8508 this.quantifier = quantifier;
8509 }
8510
8511 @Override
8512 public OnnxType type() {
8513 return type;
8514 }
8515
8516 @Override
8517 public Quantifier quantifier() {
8518 return quantifier;
8519 }
8520 }
8521
8522 public enum OutputParameter implements OnnxParameter {
8523 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8524 ;
8525
8526 final OnnxType type;
8527 final Quantifier quantifier;
8528
8529 OutputParameter(OnnxType type, Quantifier quantifier) {
8530 this.type = type;
8531 this.quantifier = quantifier;
8532 }
8533
8534 @Override
8535 public OnnxType type() {
8536 return type;
8537 }
8538
8539 @Override
8540 public Quantifier quantifier() {
8541 return quantifier;
8542 }
8543 }
8544
8545 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
8546 NAME,
8547 List.of(Attribute.values()),
8548 List.of(TypeConstraint.values()),
8549 List.of(InputParameter.values()),
8550 List.of(OutputParameter.values())
8551 );
8552
8553 public Erf(ExternalizedOp def) {
8554 super(SCHEMA, def);
8555 }
8556
8557 Erf(Erf that, CodeContext cc) {
8558 super(that, cc);
8559 }
8560
8561 @Override
8562 public Erf transform(CodeContext cc, CodeTransformer ot) {
8563 return new Erf(this, cc);
8564 }
8565
8566 Erf(TypeElement resultType, Value input) {
8567 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
8568 }
8569
8570 @Override
8571 public SequencedSet<OnnxParameter> onnxOutputs() {
8572 return onnxOutputs(SCHEMA);
8573 }
8574
8575 @Override
8576 public SequencedMap<OnnxParameter, Object> onnxInputs() {
8577 return onnxInputs(SCHEMA, List.of(input()));
8578 }
8579
8580 public Value input() {
8581 return operands().get(0);
8582 }
8583
8584 }
8585
8586 public static Erf Erf(TypeElement resultType, Value input) {
8587 return new Erf(resultType, input);
8588 }
8589
8590 @OpFactoryHelper.OpDeclaration(Exp.NAME)
8591 public static final class Exp extends OnnxOp {
8592 public static final String NAME = "Exp";
8593
8594 public enum Attribute implements OnnxAttribute.None { }
8595
8596 public enum TypeConstraint implements OnnxTypeConstraint {
8597 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
8598 ;
8599
8600 final OnnxType.TypeVariable typeVariable;
8601
8602 TypeConstraint(OnnxType.TypeVariable typeVariable) {
8603 assert typeVariable.name().equals(name());
8604 this.typeVariable = typeVariable;
8605 }
8606
8607 @Override
8608 public OnnxType.TypeVariable typeVariable() {
8609 return typeVariable;
8610 }
8611 }
8612
8613 public enum InputParameter implements OnnxParameter {
8614 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8615 ;
8616
8617 final OnnxType type;
8618 final Quantifier quantifier;
8619
8620 InputParameter(OnnxType type, Quantifier quantifier) {
8621 this.type = type;
8622 this.quantifier = quantifier;
8623 }
8624
8625 @Override
8626 public OnnxType type() {
8627 return type;
8628 }
8629
8630 @Override
8631 public Quantifier quantifier() {
8632 return quantifier;
8633 }
8634 }
8635
8636 public enum OutputParameter implements OnnxParameter {
8637 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8638 ;
8639
8640 final OnnxType type;
8641 final Quantifier quantifier;
8642
8643 OutputParameter(OnnxType type, Quantifier quantifier) {
8644 this.type = type;
8645 this.quantifier = quantifier;
8646 }
8647
8648 @Override
8649 public OnnxType type() {
8650 return type;
8651 }
8652
8653 @Override
8654 public Quantifier quantifier() {
8655 return quantifier;
8656 }
8657 }
8658
8659 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
8660 NAME,
8661 List.of(Attribute.values()),
8662 List.of(TypeConstraint.values()),
8663 List.of(InputParameter.values()),
8664 List.of(OutputParameter.values())
8665 );
8666
8667 public Exp(ExternalizedOp def) {
8668 super(SCHEMA, def);
8669 }
8670
8671 Exp(Exp that, CodeContext cc) {
8672 super(that, cc);
8673 }
8674
8675 @Override
8676 public Exp transform(CodeContext cc, CodeTransformer ot) {
8677 return new Exp(this, cc);
8678 }
8679
8680 Exp(TypeElement resultType, Value input) {
8681 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
8682 }
8683
8684 @Override
8685 public SequencedSet<OnnxParameter> onnxOutputs() {
8686 return onnxOutputs(SCHEMA);
8687 }
8688
8689 @Override
8690 public SequencedMap<OnnxParameter, Object> onnxInputs() {
8691 return onnxInputs(SCHEMA, List.of(input()));
8692 }
8693
8694 public Value input() {
8695 return operands().get(0);
8696 }
8697
8698 }
8699
8700 public static Exp Exp(TypeElement resultType, Value input) {
8701 return new Exp(resultType, input);
8702 }
8703
8704 @OpFactoryHelper.OpDeclaration(Expand.NAME)
8705 public static final class Expand extends OnnxOp {
8706 public static final String NAME = "Expand";
8707
8708 public enum Attribute implements OnnxAttribute.None { }
8709
8710 public enum TypeConstraint implements OnnxTypeConstraint {
8711 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
8712 ;
8713
8714 final OnnxType.TypeVariable typeVariable;
8715
8716 TypeConstraint(OnnxType.TypeVariable typeVariable) {
8717 assert typeVariable.name().equals(name());
8718 this.typeVariable = typeVariable;
8719 }
8720
8721 @Override
8722 public OnnxType.TypeVariable typeVariable() {
8723 return typeVariable;
8724 }
8725 }
8726
8727 public enum InputParameter implements OnnxParameter {
8728 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8729 shape(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
8730 ;
8731
8732 final OnnxType type;
8733 final Quantifier quantifier;
8734
8735 InputParameter(OnnxType type, Quantifier quantifier) {
8736 this.type = type;
8737 this.quantifier = quantifier;
8738 }
8739
8740 @Override
8741 public OnnxType type() {
8742 return type;
8743 }
8744
8745 @Override
8746 public Quantifier quantifier() {
8747 return quantifier;
8748 }
8749 }
8750
8751 public enum OutputParameter implements OnnxParameter {
8752 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
8753 ;
8754
8755 final OnnxType type;
8756 final Quantifier quantifier;
8757
8758 OutputParameter(OnnxType type, Quantifier quantifier) {
8759 this.type = type;
8760 this.quantifier = quantifier;
8761 }
8762
8763 @Override
8764 public OnnxType type() {
8765 return type;
8766 }
8767
8768 @Override
8769 public Quantifier quantifier() {
8770 return quantifier;
8771 }
8772 }
8773
8774 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
8775 NAME,
8776 List.of(Attribute.values()),
8777 List.of(TypeConstraint.values()),
8778 List.of(InputParameter.values()),
8779 List.of(OutputParameter.values())
8780 );
8781
8782 public Expand(ExternalizedOp def) {
8783 super(SCHEMA, def);
8784 }
8785
8786 Expand(Expand that, CodeContext cc) {
8787 super(that, cc);
8788 }
8789
8790 @Override
8791 public Expand transform(CodeContext cc, CodeTransformer ot) {
8792 return new Expand(this, cc);
8793 }
8794
8795 Expand(TypeElement resultType, Value input, Value shape) {
8796 super(SCHEMA, resultType, Set.of(), List.of(input, shape), List.of());
8797 }
8798
8799 @Override
8800 public SequencedSet<OnnxParameter> onnxOutputs() {
8801 return onnxOutputs(SCHEMA);
8802 }
8803
8804 @Override
8805 public SequencedMap<OnnxParameter, Object> onnxInputs() {
8806 return onnxInputs(SCHEMA, List.of(input(), shape()));
8807 }
8808
8809 public Value input() {
8810 return operands().get(0);
8811 }
8812
8813 public Value shape() {
8814 return operands().get(1);
8815 }
8816
8817 }
8818
8819 public static Expand Expand(TypeElement resultType, Value input, Value shape) {
8820 return new Expand(resultType, input, shape);
8821 }
8822
8823 @OpFactoryHelper.OpDeclaration(EyeLike.NAME)
8824 public static final class EyeLike extends OnnxOp {
8825 public static final String NAME = "EyeLike";
8826
8827 public enum Attribute implements OnnxAttribute {
8828 dtype(Long.class, true, null),
8829 k(Long.class, true, 0),
8830 ;
8831
8832 final Class<?> t;
8833 final boolean optional;
8834 final Object defaultValue;
8835
8836 Attribute(Class<?> type, boolean optional, Object defaultValue) {
8837 this.t = type;
8838 this.optional = optional;
8839 this.defaultValue = defaultValue;
8840 assert optional || defaultValue == null;
8841 }
8842
8843 public Class<?> type() {
8844 return t;
8845 }
8846
8847 public boolean isOptional() {
8848 return optional;
8849 }
8850
8851 public Object defaultValue() {
8852 return defaultValue;
8853 }
8854 }
8855
8856 public enum TypeConstraint implements OnnxTypeConstraint {
8857 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bool())))),
8858 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bool())))),
8859 ;
8860
8861 final OnnxType.TypeVariable typeVariable;
8862
8863 TypeConstraint(OnnxType.TypeVariable typeVariable) {
8864 assert typeVariable.name().equals(name());
8865 this.typeVariable = typeVariable;
8866 }
8867
8868 @Override
8869 public OnnxType.TypeVariable typeVariable() {
8870 return typeVariable;
8871 }
8872 }
8873
8874 public enum InputParameter implements OnnxParameter {
8875 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
8876 ;
8877
8878 final OnnxType type;
8879 final Quantifier quantifier;
8880
8881 InputParameter(OnnxType type, Quantifier quantifier) {
8882 this.type = type;
8883 this.quantifier = quantifier;
8884 }
8885
8886 @Override
8887 public OnnxType type() {
8888 return type;
8889 }
8890
8891 @Override
8892 public Quantifier quantifier() {
8893 return quantifier;
8894 }
8895 }
8896
8897 public enum OutputParameter implements OnnxParameter {
8898 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
8899 ;
8900
8901 final OnnxType type;
8902 final Quantifier quantifier;
8903
8904 OutputParameter(OnnxType type, Quantifier quantifier) {
8905 this.type = type;
8906 this.quantifier = quantifier;
8907 }
8908
8909 @Override
8910 public OnnxType type() {
8911 return type;
8912 }
8913
8914 @Override
8915 public Quantifier quantifier() {
8916 return quantifier;
8917 }
8918 }
8919
8920 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
8921 NAME,
8922 List.of(Attribute.values()),
8923 List.of(TypeConstraint.values()),
8924 List.of(InputParameter.values()),
8925 List.of(OutputParameter.values())
8926 );
8927
8928 public EyeLike(ExternalizedOp def) {
8929 super(SCHEMA, def);
8930 }
8931
8932 EyeLike(EyeLike that, CodeContext cc) {
8933 super(that, cc);
8934 }
8935
8936 @Override
8937 public EyeLike transform(CodeContext cc, CodeTransformer ot) {
8938 return new EyeLike(this, cc);
8939 }
8940
8941 EyeLike(TypeElement resultType, Value input, java.util.Optional<Long> dtype, java.util.Optional<Long> k) {
8942 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(dtype, k));
8943 }
8944
8945 @Override
8946 public SequencedSet<OnnxParameter> onnxOutputs() {
8947 return onnxOutputs(SCHEMA);
8948 }
8949
8950 @Override
8951 public SequencedMap<OnnxParameter, Object> onnxInputs() {
8952 return onnxInputs(SCHEMA, List.of(input()));
8953 }
8954
8955 public Value input() {
8956 return operands().get(0);
8957 }
8958
8959 public java.util.Optional<Long> dtype() {
8960 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes);
8961 return java.util.Optional.ofNullable(dtype);
8962 }
8963
8964 public java.util.Optional<Long> k() {
8965 Long k = Attribute.k.access(Long.class, onnxAttributes);
8966 return java.util.Optional.ofNullable(k);
8967 }
8968
8969 }
8970
8971 public static EyeLike EyeLike(TypeElement resultType, Value input, java.util.Optional<Long> dtype, java.util.Optional<Long> k) {
8972 return new EyeLike(resultType, input, dtype, k);
8973 }
8974
8975 @OpFactoryHelper.OpDeclaration(FeatureVectorizer.NAME)
8976 public static final class FeatureVectorizer extends OnnxOp {
8977 public static final String NAME = "FeatureVectorizer";
8978
8979 public enum Attribute implements OnnxAttribute {
8980 inputdimensions(long[].class, true, null),
8981 ;
8982
8983 final Class<?> t;
8984 final boolean optional;
8985 final Object defaultValue;
8986
8987 Attribute(Class<?> type, boolean optional, Object defaultValue) {
8988 this.t = type;
8989 this.optional = optional;
8990 this.defaultValue = defaultValue;
8991 assert optional || defaultValue == null;
8992 }
8993
8994 public Class<?> type() {
8995 return t;
8996 }
8997
8998 public boolean isOptional() {
8999 return optional;
9000 }
9001
9002 public Object defaultValue() {
9003 return defaultValue;
9004 }
9005 }
9006
9007 public enum TypeConstraint implements OnnxTypeConstraint {
9008 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
9009 ;
9010
9011 final OnnxType.TypeVariable typeVariable;
9012
9013 TypeConstraint(OnnxType.TypeVariable typeVariable) {
9014 assert typeVariable.name().equals(name());
9015 this.typeVariable = typeVariable;
9016 }
9017
9018 @Override
9019 public OnnxType.TypeVariable typeVariable() {
9020 return typeVariable;
9021 }
9022 }
9023
9024 public enum InputParameter implements OnnxParameter {
9025 X(TypeConstraint.T1.typeVariable(), Quantifier.VARIADIC),
9026 ;
9027
9028 final OnnxType type;
9029 final Quantifier quantifier;
9030
9031 InputParameter(OnnxType type, Quantifier quantifier) {
9032 this.type = type;
9033 this.quantifier = quantifier;
9034 }
9035
9036 @Override
9037 public OnnxType type() {
9038 return type;
9039 }
9040
9041 @Override
9042 public Quantifier quantifier() {
9043 return quantifier;
9044 }
9045 }
9046
9047 public enum OutputParameter implements OnnxParameter {
9048 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
9049 ;
9050
9051 final OnnxType type;
9052 final Quantifier quantifier;
9053
9054 OutputParameter(OnnxType type, Quantifier quantifier) {
9055 this.type = type;
9056 this.quantifier = quantifier;
9057 }
9058
9059 @Override
9060 public OnnxType type() {
9061 return type;
9062 }
9063
9064 @Override
9065 public Quantifier quantifier() {
9066 return quantifier;
9067 }
9068 }
9069
9070 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
9071 NAME,
9072 List.of(Attribute.values()),
9073 List.of(TypeConstraint.values()),
9074 List.of(InputParameter.values()),
9075 List.of(OutputParameter.values())
9076 );
9077
9078 public FeatureVectorizer(ExternalizedOp def) {
9079 super(SCHEMA, def);
9080 }
9081
9082 FeatureVectorizer(FeatureVectorizer that, CodeContext cc) {
9083 super(that, cc);
9084 }
9085
9086 @Override
9087 public FeatureVectorizer transform(CodeContext cc, CodeTransformer ot) {
9088 return new FeatureVectorizer(this, cc);
9089 }
9090
9091 FeatureVectorizer(TypeElement resultType, List<Value> X, java.util.Optional<long[]> inputdimensions) {
9092 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(inputdimensions));
9093 }
9094
9095 @Override
9096 public SequencedSet<OnnxParameter> onnxOutputs() {
9097 return onnxOutputs(SCHEMA);
9098 }
9099
9100 @Override
9101 public SequencedMap<OnnxParameter, Object> onnxInputs() {
9102 return onnxInputs(SCHEMA, List.of(X()));
9103 }
9104
9105 public List<Value> X() {
9106 return operands();
9107 }
9108
9109 public java.util.Optional<long[]> inputdimensions() {
9110 long[] inputdimensions = Attribute.inputdimensions.access(long[].class, onnxAttributes);
9111 return java.util.Optional.ofNullable(inputdimensions).map(long[]::clone);
9112 }
9113
9114 }
9115
9116 public static FeatureVectorizer FeatureVectorizer(TypeElement resultType, List<Value> X, java.util.Optional<long[]> inputdimensions) {
9117 return new FeatureVectorizer(resultType, X, inputdimensions);
9118 }
9119
9120 @OpFactoryHelper.OpDeclaration(Flatten.NAME)
9121 public static final class Flatten extends OnnxOp {
9122 public static final String NAME = "Flatten";
9123
9124 public enum Attribute implements OnnxAttribute {
9125 axis(Long.class, true, 1),
9126 ;
9127
9128 final Class<?> t;
9129 final boolean optional;
9130 final Object defaultValue;
9131
9132 Attribute(Class<?> type, boolean optional, Object defaultValue) {
9133 this.t = type;
9134 this.optional = optional;
9135 this.defaultValue = defaultValue;
9136 assert optional || defaultValue == null;
9137 }
9138
9139 public Class<?> type() {
9140 return t;
9141 }
9142
9143 public boolean isOptional() {
9144 return optional;
9145 }
9146
9147 public Object defaultValue() {
9148 return defaultValue;
9149 }
9150 }
9151
9152 public enum TypeConstraint implements OnnxTypeConstraint {
9153 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
9154 ;
9155
9156 final OnnxType.TypeVariable typeVariable;
9157
9158 TypeConstraint(OnnxType.TypeVariable typeVariable) {
9159 assert typeVariable.name().equals(name());
9160 this.typeVariable = typeVariable;
9161 }
9162
9163 @Override
9164 public OnnxType.TypeVariable typeVariable() {
9165 return typeVariable;
9166 }
9167 }
9168
9169 public enum InputParameter implements OnnxParameter {
9170 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9171 ;
9172
9173 final OnnxType type;
9174 final Quantifier quantifier;
9175
9176 InputParameter(OnnxType type, Quantifier quantifier) {
9177 this.type = type;
9178 this.quantifier = quantifier;
9179 }
9180
9181 @Override
9182 public OnnxType type() {
9183 return type;
9184 }
9185
9186 @Override
9187 public Quantifier quantifier() {
9188 return quantifier;
9189 }
9190 }
9191
9192 public enum OutputParameter implements OnnxParameter {
9193 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9194 ;
9195
9196 final OnnxType type;
9197 final Quantifier quantifier;
9198
9199 OutputParameter(OnnxType type, Quantifier quantifier) {
9200 this.type = type;
9201 this.quantifier = quantifier;
9202 }
9203
9204 @Override
9205 public OnnxType type() {
9206 return type;
9207 }
9208
9209 @Override
9210 public Quantifier quantifier() {
9211 return quantifier;
9212 }
9213 }
9214
9215 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
9216 NAME,
9217 List.of(Attribute.values()),
9218 List.of(TypeConstraint.values()),
9219 List.of(InputParameter.values()),
9220 List.of(OutputParameter.values())
9221 );
9222
9223 public Flatten(ExternalizedOp def) {
9224 super(SCHEMA, def);
9225 }
9226
9227 Flatten(Flatten that, CodeContext cc) {
9228 super(that, cc);
9229 }
9230
9231 @Override
9232 public Flatten transform(CodeContext cc, CodeTransformer ot) {
9233 return new Flatten(this, cc);
9234 }
9235
9236 Flatten(TypeElement resultType, Value input, java.util.Optional<Long> axis) {
9237 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(axis));
9238 }
9239
9240 @Override
9241 public SequencedSet<OnnxParameter> onnxOutputs() {
9242 return onnxOutputs(SCHEMA);
9243 }
9244
9245 @Override
9246 public SequencedMap<OnnxParameter, Object> onnxInputs() {
9247 return onnxInputs(SCHEMA, List.of(input()));
9248 }
9249
9250 public Value input() {
9251 return operands().get(0);
9252 }
9253
9254 public java.util.Optional<Long> axis() {
9255 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
9256 return java.util.Optional.ofNullable(axis);
9257 }
9258
9259 }
9260
9261 public static Flatten Flatten(TypeElement resultType, Value input, java.util.Optional<Long> axis) {
9262 return new Flatten(resultType, input, axis);
9263 }
9264
9265 @OpFactoryHelper.OpDeclaration(Floor.NAME)
9266 public static final class Floor extends OnnxOp {
9267 public static final String NAME = "Floor";
9268
9269 public enum Attribute implements OnnxAttribute.None { }
9270
9271 public enum TypeConstraint implements OnnxTypeConstraint {
9272 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
9273 ;
9274
9275 final OnnxType.TypeVariable typeVariable;
9276
9277 TypeConstraint(OnnxType.TypeVariable typeVariable) {
9278 assert typeVariable.name().equals(name());
9279 this.typeVariable = typeVariable;
9280 }
9281
9282 @Override
9283 public OnnxType.TypeVariable typeVariable() {
9284 return typeVariable;
9285 }
9286 }
9287
9288 public enum InputParameter implements OnnxParameter {
9289 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9290 ;
9291
9292 final OnnxType type;
9293 final Quantifier quantifier;
9294
9295 InputParameter(OnnxType type, Quantifier quantifier) {
9296 this.type = type;
9297 this.quantifier = quantifier;
9298 }
9299
9300 @Override
9301 public OnnxType type() {
9302 return type;
9303 }
9304
9305 @Override
9306 public Quantifier quantifier() {
9307 return quantifier;
9308 }
9309 }
9310
9311 public enum OutputParameter implements OnnxParameter {
9312 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9313 ;
9314
9315 final OnnxType type;
9316 final Quantifier quantifier;
9317
9318 OutputParameter(OnnxType type, Quantifier quantifier) {
9319 this.type = type;
9320 this.quantifier = quantifier;
9321 }
9322
9323 @Override
9324 public OnnxType type() {
9325 return type;
9326 }
9327
9328 @Override
9329 public Quantifier quantifier() {
9330 return quantifier;
9331 }
9332 }
9333
9334 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
9335 NAME,
9336 List.of(Attribute.values()),
9337 List.of(TypeConstraint.values()),
9338 List.of(InputParameter.values()),
9339 List.of(OutputParameter.values())
9340 );
9341
9342 public Floor(ExternalizedOp def) {
9343 super(SCHEMA, def);
9344 }
9345
9346 Floor(Floor that, CodeContext cc) {
9347 super(that, cc);
9348 }
9349
9350 @Override
9351 public Floor transform(CodeContext cc, CodeTransformer ot) {
9352 return new Floor(this, cc);
9353 }
9354
9355 Floor(TypeElement resultType, Value X) {
9356 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
9357 }
9358
9359 @Override
9360 public SequencedSet<OnnxParameter> onnxOutputs() {
9361 return onnxOutputs(SCHEMA);
9362 }
9363
9364 @Override
9365 public SequencedMap<OnnxParameter, Object> onnxInputs() {
9366 return onnxInputs(SCHEMA, List.of(X()));
9367 }
9368
9369 public Value X() {
9370 return operands().get(0);
9371 }
9372
9373 }
9374
9375 public static Floor Floor(TypeElement resultType, Value X) {
9376 return new Floor(resultType, X);
9377 }
9378
9379 @OpFactoryHelper.OpDeclaration(GRU.NAME)
9380 public static final class GRU extends OnnxOp {
9381 public static final String NAME = "GRU";
9382
9383 public enum Attribute implements OnnxAttribute {
9384 layout(Long.class, true, 0),
9385 activation_alpha(float[].class, true, null),
9386 hidden_size(Long.class, true, null),
9387 activation_beta(float[].class, true, null),
9388 activations(String[].class, true, null),
9389 linear_before_reset(Long.class, true, 0),
9390 clip(Float.class, true, null),
9391 direction(String.class, true, "forward"),
9392 ;
9393
9394 final Class<?> t;
9395 final boolean optional;
9396 final Object defaultValue;
9397
9398 Attribute(Class<?> type, boolean optional, Object defaultValue) {
9399 this.t = type;
9400 this.optional = optional;
9401 this.defaultValue = defaultValue;
9402 assert optional || defaultValue == null;
9403 }
9404
9405 public Class<?> type() {
9406 return t;
9407 }
9408
9409 public boolean isOptional() {
9410 return optional;
9411 }
9412
9413 public Object defaultValue() {
9414 return defaultValue;
9415 }
9416 }
9417
9418 public enum TypeConstraint implements OnnxTypeConstraint {
9419 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
9420 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32())))),
9421 ;
9422
9423 final OnnxType.TypeVariable typeVariable;
9424
9425 TypeConstraint(OnnxType.TypeVariable typeVariable) {
9426 assert typeVariable.name().equals(name());
9427 this.typeVariable = typeVariable;
9428 }
9429
9430 @Override
9431 public OnnxType.TypeVariable typeVariable() {
9432 return typeVariable;
9433 }
9434 }
9435
9436 public enum InputParameter implements OnnxParameter {
9437 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9438 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9439 R(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9440 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
9441 sequence_lens(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
9442 initial_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
9443 ;
9444
9445 final OnnxType type;
9446 final Quantifier quantifier;
9447
9448 InputParameter(OnnxType type, Quantifier quantifier) {
9449 this.type = type;
9450 this.quantifier = quantifier;
9451 }
9452
9453 @Override
9454 public OnnxType type() {
9455 return type;
9456 }
9457
9458 @Override
9459 public Quantifier quantifier() {
9460 return quantifier;
9461 }
9462 }
9463
9464 public enum OutputParameter implements OnnxParameter {
9465 Y(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
9466 Y_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
9467 ;
9468
9469 final OnnxType type;
9470 final Quantifier quantifier;
9471
9472 OutputParameter(OnnxType type, Quantifier quantifier) {
9473 this.type = type;
9474 this.quantifier = quantifier;
9475 }
9476
9477 @Override
9478 public OnnxType type() {
9479 return type;
9480 }
9481
9482 @Override
9483 public Quantifier quantifier() {
9484 return quantifier;
9485 }
9486 }
9487
9488 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
9489 NAME,
9490 List.of(Attribute.values()),
9491 List.of(TypeConstraint.values()),
9492 List.of(InputParameter.values()),
9493 List.of(OutputParameter.values())
9494 );
9495
9496 public GRU(ExternalizedOp def) {
9497 super(SCHEMA, def);
9498 }
9499
9500 GRU(GRU that, CodeContext cc) {
9501 super(that, cc);
9502 }
9503
9504 @Override
9505 public GRU transform(CodeContext cc, CodeTransformer ot) {
9506 return new GRU(this, cc);
9507 }
9508
9509 GRU(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value X, Value W, Value R, java.util.Optional<Value> B, java.util.Optional<Value> sequence_lens, java.util.Optional<Value> initial_h, java.util.Optional<Long> layout, java.util.Optional<float[]> activation_alpha, java.util.Optional<Long> hidden_size, java.util.Optional<float[]> activation_beta, java.util.Optional<String[]> activations, java.util.Optional<Long> linear_before_reset, java.util.Optional<Float> clip, java.util.Optional<String> direction) {
9510 super(SCHEMA, resultType, optionalOutputs, List.of(X, W, R, B, sequence_lens, initial_h), List.of(layout, activation_alpha, hidden_size, activation_beta, activations, linear_before_reset, clip, direction));
9511 }
9512
9513 @Override
9514 public SequencedSet<OnnxParameter> onnxOutputs() {
9515 return onnxOutputs(SCHEMA);
9516 }
9517
9518 @Override
9519 public SequencedMap<OnnxParameter, Object> onnxInputs() {
9520 return onnxInputs(SCHEMA, List.of(X(), W(), R(), B(), sequence_lens(), initial_h()));
9521 }
9522
9523 public Value X() {
9524 return operands().get(0);
9525 }
9526
9527 public Value W() {
9528 return operands().get(1);
9529 }
9530
9531 public Value R() {
9532 return operands().get(2);
9533 }
9534
9535 public java.util.Optional<Value> B() {
9536 int i = optionalInputArguments.indexOf(InputParameter.B);
9537 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
9538 }
9539
9540 public java.util.Optional<Value> sequence_lens() {
9541 int i = optionalInputArguments.indexOf(InputParameter.sequence_lens);
9542 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
9543 }
9544
9545 public java.util.Optional<Value> initial_h() {
9546 int i = optionalInputArguments.indexOf(InputParameter.initial_h);
9547 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
9548 }
9549
9550 public java.util.Optional<Long> layout() {
9551 Long layout = Attribute.layout.access(Long.class, onnxAttributes);
9552 return java.util.Optional.ofNullable(layout);
9553 }
9554
9555 public java.util.Optional<float[]> activation_alpha() {
9556 float[] activation_alpha = Attribute.activation_alpha.access(float[].class, onnxAttributes);
9557 return java.util.Optional.ofNullable(activation_alpha).map(float[]::clone);
9558 }
9559
9560 public java.util.Optional<Long> hidden_size() {
9561 Long hidden_size = Attribute.hidden_size.access(Long.class, onnxAttributes);
9562 return java.util.Optional.ofNullable(hidden_size);
9563 }
9564
9565 public java.util.Optional<float[]> activation_beta() {
9566 float[] activation_beta = Attribute.activation_beta.access(float[].class, onnxAttributes);
9567 return java.util.Optional.ofNullable(activation_beta).map(float[]::clone);
9568 }
9569
9570 public java.util.Optional<String[]> activations() {
9571 String[] activations = Attribute.activations.access(String[].class, onnxAttributes);
9572 return java.util.Optional.ofNullable(activations).map(String[]::clone);
9573 }
9574
9575 public java.util.Optional<Long> linear_before_reset() {
9576 Long linear_before_reset = Attribute.linear_before_reset.access(Long.class, onnxAttributes);
9577 return java.util.Optional.ofNullable(linear_before_reset);
9578 }
9579
9580 public java.util.Optional<Float> clip() {
9581 Float clip = Attribute.clip.access(Float.class, onnxAttributes);
9582 return java.util.Optional.ofNullable(clip);
9583 }
9584
9585 public java.util.Optional<String> direction() {
9586 String direction = Attribute.direction.access(String.class, onnxAttributes);
9587 return java.util.Optional.ofNullable(direction);
9588 }
9589
9590 }
9591
9592 public static GRU GRU(TypeElement resultType, Set<GRU.OutputParameter> optionalOutputs, Value X, Value W, Value R, java.util.Optional<Value> B, java.util.Optional<Value> sequence_lens, java.util.Optional<Value> initial_h, java.util.Optional<Long> layout, java.util.Optional<float[]> activation_alpha, java.util.Optional<Long> hidden_size, java.util.Optional<float[]> activation_beta, java.util.Optional<String[]> activations, java.util.Optional<Long> linear_before_reset, java.util.Optional<Float> clip, java.util.Optional<String> direction) {
9593 return new GRU(resultType, optionalOutputs, X, W, R, B, sequence_lens, initial_h, layout, activation_alpha, hidden_size, activation_beta, activations, linear_before_reset, clip, direction);
9594 }
9595
9596 @OpFactoryHelper.OpDeclaration(Gather.NAME)
9597 public static final class Gather extends OnnxOp {
9598 public static final String NAME = "Gather";
9599
9600 public enum Attribute implements OnnxAttribute {
9601 axis(Long.class, true, 0),
9602 ;
9603
9604 final Class<?> t;
9605 final boolean optional;
9606 final Object defaultValue;
9607
9608 Attribute(Class<?> type, boolean optional, Object defaultValue) {
9609 this.t = type;
9610 this.optional = optional;
9611 this.defaultValue = defaultValue;
9612 assert optional || defaultValue == null;
9613 }
9614
9615 public Class<?> type() {
9616 return t;
9617 }
9618
9619 public boolean isOptional() {
9620 return optional;
9621 }
9622
9623 public Object defaultValue() {
9624 return defaultValue;
9625 }
9626 }
9627
9628 public enum TypeConstraint implements OnnxTypeConstraint {
9629 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
9630 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
9631 ;
9632
9633 final OnnxType.TypeVariable typeVariable;
9634
9635 TypeConstraint(OnnxType.TypeVariable typeVariable) {
9636 assert typeVariable.name().equals(name());
9637 this.typeVariable = typeVariable;
9638 }
9639
9640 @Override
9641 public OnnxType.TypeVariable typeVariable() {
9642 return typeVariable;
9643 }
9644 }
9645
9646 public enum InputParameter implements OnnxParameter {
9647 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9648 indices(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
9649 ;
9650
9651 final OnnxType type;
9652 final Quantifier quantifier;
9653
9654 InputParameter(OnnxType type, Quantifier quantifier) {
9655 this.type = type;
9656 this.quantifier = quantifier;
9657 }
9658
9659 @Override
9660 public OnnxType type() {
9661 return type;
9662 }
9663
9664 @Override
9665 public Quantifier quantifier() {
9666 return quantifier;
9667 }
9668 }
9669
9670 public enum OutputParameter implements OnnxParameter {
9671 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9672 ;
9673
9674 final OnnxType type;
9675 final Quantifier quantifier;
9676
9677 OutputParameter(OnnxType type, Quantifier quantifier) {
9678 this.type = type;
9679 this.quantifier = quantifier;
9680 }
9681
9682 @Override
9683 public OnnxType type() {
9684 return type;
9685 }
9686
9687 @Override
9688 public Quantifier quantifier() {
9689 return quantifier;
9690 }
9691 }
9692
9693 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
9694 NAME,
9695 List.of(Attribute.values()),
9696 List.of(TypeConstraint.values()),
9697 List.of(InputParameter.values()),
9698 List.of(OutputParameter.values())
9699 );
9700
9701 public Gather(ExternalizedOp def) {
9702 super(SCHEMA, def);
9703 }
9704
9705 Gather(Gather that, CodeContext cc) {
9706 super(that, cc);
9707 }
9708
9709 @Override
9710 public Gather transform(CodeContext cc, CodeTransformer ot) {
9711 return new Gather(this, cc);
9712 }
9713
9714 Gather(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> axis) {
9715 super(SCHEMA, resultType, Set.of(), List.of(data, indices), List.of(axis));
9716 }
9717
9718 @Override
9719 public SequencedSet<OnnxParameter> onnxOutputs() {
9720 return onnxOutputs(SCHEMA);
9721 }
9722
9723 @Override
9724 public SequencedMap<OnnxParameter, Object> onnxInputs() {
9725 return onnxInputs(SCHEMA, List.of(data(), indices()));
9726 }
9727
9728 public Value data() {
9729 return operands().get(0);
9730 }
9731
9732 public Value indices() {
9733 return operands().get(1);
9734 }
9735
9736 public java.util.Optional<Long> axis() {
9737 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
9738 return java.util.Optional.ofNullable(axis);
9739 }
9740
9741 }
9742
9743 public static Gather Gather(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> axis) {
9744 return new Gather(resultType, data, indices, axis);
9745 }
9746
9747 @OpFactoryHelper.OpDeclaration(GatherElements.NAME)
9748 public static final class GatherElements extends OnnxOp {
9749 public static final String NAME = "GatherElements";
9750
9751 public enum Attribute implements OnnxAttribute {
9752 axis(Long.class, true, 0),
9753 ;
9754
9755 final Class<?> t;
9756 final boolean optional;
9757 final Object defaultValue;
9758
9759 Attribute(Class<?> type, boolean optional, Object defaultValue) {
9760 this.t = type;
9761 this.optional = optional;
9762 this.defaultValue = defaultValue;
9763 assert optional || defaultValue == null;
9764 }
9765
9766 public Class<?> type() {
9767 return t;
9768 }
9769
9770 public boolean isOptional() {
9771 return optional;
9772 }
9773
9774 public Object defaultValue() {
9775 return defaultValue;
9776 }
9777 }
9778
9779 public enum TypeConstraint implements OnnxTypeConstraint {
9780 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
9781 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
9782 ;
9783
9784 final OnnxType.TypeVariable typeVariable;
9785
9786 TypeConstraint(OnnxType.TypeVariable typeVariable) {
9787 assert typeVariable.name().equals(name());
9788 this.typeVariable = typeVariable;
9789 }
9790
9791 @Override
9792 public OnnxType.TypeVariable typeVariable() {
9793 return typeVariable;
9794 }
9795 }
9796
9797 public enum InputParameter implements OnnxParameter {
9798 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9799 indices(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
9800 ;
9801
9802 final OnnxType type;
9803 final Quantifier quantifier;
9804
9805 InputParameter(OnnxType type, Quantifier quantifier) {
9806 this.type = type;
9807 this.quantifier = quantifier;
9808 }
9809
9810 @Override
9811 public OnnxType type() {
9812 return type;
9813 }
9814
9815 @Override
9816 public Quantifier quantifier() {
9817 return quantifier;
9818 }
9819 }
9820
9821 public enum OutputParameter implements OnnxParameter {
9822 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9823 ;
9824
9825 final OnnxType type;
9826 final Quantifier quantifier;
9827
9828 OutputParameter(OnnxType type, Quantifier quantifier) {
9829 this.type = type;
9830 this.quantifier = quantifier;
9831 }
9832
9833 @Override
9834 public OnnxType type() {
9835 return type;
9836 }
9837
9838 @Override
9839 public Quantifier quantifier() {
9840 return quantifier;
9841 }
9842 }
9843
9844 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
9845 NAME,
9846 List.of(Attribute.values()),
9847 List.of(TypeConstraint.values()),
9848 List.of(InputParameter.values()),
9849 List.of(OutputParameter.values())
9850 );
9851
9852 public GatherElements(ExternalizedOp def) {
9853 super(SCHEMA, def);
9854 }
9855
9856 GatherElements(GatherElements that, CodeContext cc) {
9857 super(that, cc);
9858 }
9859
9860 @Override
9861 public GatherElements transform(CodeContext cc, CodeTransformer ot) {
9862 return new GatherElements(this, cc);
9863 }
9864
9865 GatherElements(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> axis) {
9866 super(SCHEMA, resultType, Set.of(), List.of(data, indices), List.of(axis));
9867 }
9868
9869 @Override
9870 public SequencedSet<OnnxParameter> onnxOutputs() {
9871 return onnxOutputs(SCHEMA);
9872 }
9873
9874 @Override
9875 public SequencedMap<OnnxParameter, Object> onnxInputs() {
9876 return onnxInputs(SCHEMA, List.of(data(), indices()));
9877 }
9878
9879 public Value data() {
9880 return operands().get(0);
9881 }
9882
9883 public Value indices() {
9884 return operands().get(1);
9885 }
9886
9887 public java.util.Optional<Long> axis() {
9888 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
9889 return java.util.Optional.ofNullable(axis);
9890 }
9891
9892 }
9893
9894 public static GatherElements GatherElements(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> axis) {
9895 return new GatherElements(resultType, data, indices, axis);
9896 }
9897
9898 @OpFactoryHelper.OpDeclaration(GatherND.NAME)
9899 public static final class GatherND extends OnnxOp {
9900 public static final String NAME = "GatherND";
9901
9902 public enum Attribute implements OnnxAttribute {
9903 batch_dims(Long.class, true, 0),
9904 ;
9905
9906 final Class<?> t;
9907 final boolean optional;
9908 final Object defaultValue;
9909
9910 Attribute(Class<?> type, boolean optional, Object defaultValue) {
9911 this.t = type;
9912 this.optional = optional;
9913 this.defaultValue = defaultValue;
9914 assert optional || defaultValue == null;
9915 }
9916
9917 public Class<?> type() {
9918 return t;
9919 }
9920
9921 public boolean isOptional() {
9922 return optional;
9923 }
9924
9925 public Object defaultValue() {
9926 return defaultValue;
9927 }
9928 }
9929
9930 public enum TypeConstraint implements OnnxTypeConstraint {
9931 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
9932 ;
9933
9934 final OnnxType.TypeVariable typeVariable;
9935
9936 TypeConstraint(OnnxType.TypeVariable typeVariable) {
9937 assert typeVariable.name().equals(name());
9938 this.typeVariable = typeVariable;
9939 }
9940
9941 @Override
9942 public OnnxType.TypeVariable typeVariable() {
9943 return typeVariable;
9944 }
9945 }
9946
9947 public enum InputParameter implements OnnxParameter {
9948 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9949 indices(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
9950 ;
9951
9952 final OnnxType type;
9953 final Quantifier quantifier;
9954
9955 InputParameter(OnnxType type, Quantifier quantifier) {
9956 this.type = type;
9957 this.quantifier = quantifier;
9958 }
9959
9960 @Override
9961 public OnnxType type() {
9962 return type;
9963 }
9964
9965 @Override
9966 public Quantifier quantifier() {
9967 return quantifier;
9968 }
9969 }
9970
9971 public enum OutputParameter implements OnnxParameter {
9972 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
9973 ;
9974
9975 final OnnxType type;
9976 final Quantifier quantifier;
9977
9978 OutputParameter(OnnxType type, Quantifier quantifier) {
9979 this.type = type;
9980 this.quantifier = quantifier;
9981 }
9982
9983 @Override
9984 public OnnxType type() {
9985 return type;
9986 }
9987
9988 @Override
9989 public Quantifier quantifier() {
9990 return quantifier;
9991 }
9992 }
9993
9994 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
9995 NAME,
9996 List.of(Attribute.values()),
9997 List.of(TypeConstraint.values()),
9998 List.of(InputParameter.values()),
9999 List.of(OutputParameter.values())
10000 );
10001
10002 public GatherND(ExternalizedOp def) {
10003 super(SCHEMA, def);
10004 }
10005
10006 GatherND(GatherND that, CodeContext cc) {
10007 super(that, cc);
10008 }
10009
10010 @Override
10011 public GatherND transform(CodeContext cc, CodeTransformer ot) {
10012 return new GatherND(this, cc);
10013 }
10014
10015 GatherND(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> batch_dims) {
10016 super(SCHEMA, resultType, Set.of(), List.of(data, indices), List.of(batch_dims));
10017 }
10018
10019 @Override
10020 public SequencedSet<OnnxParameter> onnxOutputs() {
10021 return onnxOutputs(SCHEMA);
10022 }
10023
10024 @Override
10025 public SequencedMap<OnnxParameter, Object> onnxInputs() {
10026 return onnxInputs(SCHEMA, List.of(data(), indices()));
10027 }
10028
10029 public Value data() {
10030 return operands().get(0);
10031 }
10032
10033 public Value indices() {
10034 return operands().get(1);
10035 }
10036
10037 public java.util.Optional<Long> batch_dims() {
10038 Long batch_dims = Attribute.batch_dims.access(Long.class, onnxAttributes);
10039 return java.util.Optional.ofNullable(batch_dims);
10040 }
10041
10042 }
10043
10044 public static GatherND GatherND(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> batch_dims) {
10045 return new GatherND(resultType, data, indices, batch_dims);
10046 }
10047
10048 @OpFactoryHelper.OpDeclaration(Gelu.NAME)
10049 public static final class Gelu extends OnnxOp {
10050 public static final String NAME = "Gelu";
10051
10052 public enum Attribute implements OnnxAttribute {
10053 approximate(String.class, true, "none"),
10054 ;
10055
10056 final Class<?> t;
10057 final boolean optional;
10058 final Object defaultValue;
10059
10060 Attribute(Class<?> type, boolean optional, Object defaultValue) {
10061 this.t = type;
10062 this.optional = optional;
10063 this.defaultValue = defaultValue;
10064 assert optional || defaultValue == null;
10065 }
10066
10067 public Class<?> type() {
10068 return t;
10069 }
10070
10071 public boolean isOptional() {
10072 return optional;
10073 }
10074
10075 public Object defaultValue() {
10076 return defaultValue;
10077 }
10078 }
10079
10080 public enum TypeConstraint implements OnnxTypeConstraint {
10081 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
10082 ;
10083
10084 final OnnxType.TypeVariable typeVariable;
10085
10086 TypeConstraint(OnnxType.TypeVariable typeVariable) {
10087 assert typeVariable.name().equals(name());
10088 this.typeVariable = typeVariable;
10089 }
10090
10091 @Override
10092 public OnnxType.TypeVariable typeVariable() {
10093 return typeVariable;
10094 }
10095 }
10096
10097 public enum InputParameter implements OnnxParameter {
10098 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10099 ;
10100
10101 final OnnxType type;
10102 final Quantifier quantifier;
10103
10104 InputParameter(OnnxType type, Quantifier quantifier) {
10105 this.type = type;
10106 this.quantifier = quantifier;
10107 }
10108
10109 @Override
10110 public OnnxType type() {
10111 return type;
10112 }
10113
10114 @Override
10115 public Quantifier quantifier() {
10116 return quantifier;
10117 }
10118 }
10119
10120 public enum OutputParameter implements OnnxParameter {
10121 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10122 ;
10123
10124 final OnnxType type;
10125 final Quantifier quantifier;
10126
10127 OutputParameter(OnnxType type, Quantifier quantifier) {
10128 this.type = type;
10129 this.quantifier = quantifier;
10130 }
10131
10132 @Override
10133 public OnnxType type() {
10134 return type;
10135 }
10136
10137 @Override
10138 public Quantifier quantifier() {
10139 return quantifier;
10140 }
10141 }
10142
10143 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
10144 NAME,
10145 List.of(Attribute.values()),
10146 List.of(TypeConstraint.values()),
10147 List.of(InputParameter.values()),
10148 List.of(OutputParameter.values())
10149 );
10150
10151 public Gelu(ExternalizedOp def) {
10152 super(SCHEMA, def);
10153 }
10154
10155 Gelu(Gelu that, CodeContext cc) {
10156 super(that, cc);
10157 }
10158
10159 @Override
10160 public Gelu transform(CodeContext cc, CodeTransformer ot) {
10161 return new Gelu(this, cc);
10162 }
10163
10164 Gelu(TypeElement resultType, Value X, java.util.Optional<String> approximate) {
10165 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(approximate));
10166 }
10167
10168 @Override
10169 public SequencedSet<OnnxParameter> onnxOutputs() {
10170 return onnxOutputs(SCHEMA);
10171 }
10172
10173 @Override
10174 public SequencedMap<OnnxParameter, Object> onnxInputs() {
10175 return onnxInputs(SCHEMA, List.of(X()));
10176 }
10177
10178 public Value X() {
10179 return operands().get(0);
10180 }
10181
10182 public java.util.Optional<String> approximate() {
10183 String approximate = Attribute.approximate.access(String.class, onnxAttributes);
10184 return java.util.Optional.ofNullable(approximate);
10185 }
10186
10187 }
10188
10189 public static Gelu Gelu(TypeElement resultType, Value X, java.util.Optional<String> approximate) {
10190 return new Gelu(resultType, X, approximate);
10191 }
10192
10193 @OpFactoryHelper.OpDeclaration(Gemm.NAME)
10194 public static final class Gemm extends OnnxOp {
10195 public static final String NAME = "Gemm";
10196
10197 public enum Attribute implements OnnxAttribute {
10198 alpha(Float.class, true, 1.0f),
10199 transB(Long.class, true, 0),
10200 beta(Float.class, true, 1.0f),
10201 transA(Long.class, true, 0),
10202 ;
10203
10204 final Class<?> t;
10205 final boolean optional;
10206 final Object defaultValue;
10207
10208 Attribute(Class<?> type, boolean optional, Object defaultValue) {
10209 this.t = type;
10210 this.optional = optional;
10211 this.defaultValue = defaultValue;
10212 assert optional || defaultValue == null;
10213 }
10214
10215 public Class<?> type() {
10216 return t;
10217 }
10218
10219 public boolean isOptional() {
10220 return optional;
10221 }
10222
10223 public Object defaultValue() {
10224 return defaultValue;
10225 }
10226 }
10227
10228 public enum TypeConstraint implements OnnxTypeConstraint {
10229 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16())))),
10230 ;
10231
10232 final OnnxType.TypeVariable typeVariable;
10233
10234 TypeConstraint(OnnxType.TypeVariable typeVariable) {
10235 assert typeVariable.name().equals(name());
10236 this.typeVariable = typeVariable;
10237 }
10238
10239 @Override
10240 public OnnxType.TypeVariable typeVariable() {
10241 return typeVariable;
10242 }
10243 }
10244
10245 public enum InputParameter implements OnnxParameter {
10246 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10247 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10248 C(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
10249 ;
10250
10251 final OnnxType type;
10252 final Quantifier quantifier;
10253
10254 InputParameter(OnnxType type, Quantifier quantifier) {
10255 this.type = type;
10256 this.quantifier = quantifier;
10257 }
10258
10259 @Override
10260 public OnnxType type() {
10261 return type;
10262 }
10263
10264 @Override
10265 public Quantifier quantifier() {
10266 return quantifier;
10267 }
10268 }
10269
10270 public enum OutputParameter implements OnnxParameter {
10271 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10272 ;
10273
10274 final OnnxType type;
10275 final Quantifier quantifier;
10276
10277 OutputParameter(OnnxType type, Quantifier quantifier) {
10278 this.type = type;
10279 this.quantifier = quantifier;
10280 }
10281
10282 @Override
10283 public OnnxType type() {
10284 return type;
10285 }
10286
10287 @Override
10288 public Quantifier quantifier() {
10289 return quantifier;
10290 }
10291 }
10292
10293 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
10294 NAME,
10295 List.of(Attribute.values()),
10296 List.of(TypeConstraint.values()),
10297 List.of(InputParameter.values()),
10298 List.of(OutputParameter.values())
10299 );
10300
10301 public Gemm(ExternalizedOp def) {
10302 super(SCHEMA, def);
10303 }
10304
10305 Gemm(Gemm that, CodeContext cc) {
10306 super(that, cc);
10307 }
10308
10309 @Override
10310 public Gemm transform(CodeContext cc, CodeTransformer ot) {
10311 return new Gemm(this, cc);
10312 }
10313
10314 Gemm(TypeElement resultType, Value A, Value B, java.util.Optional<Value> C, java.util.Optional<Float> alpha, java.util.Optional<Long> transB, java.util.Optional<Float> beta, java.util.Optional<Long> transA) {
10315 super(SCHEMA, resultType, Set.of(), List.of(A, B, C), List.of(alpha, transB, beta, transA));
10316 }
10317
10318 @Override
10319 public SequencedSet<OnnxParameter> onnxOutputs() {
10320 return onnxOutputs(SCHEMA);
10321 }
10322
10323 @Override
10324 public SequencedMap<OnnxParameter, Object> onnxInputs() {
10325 return onnxInputs(SCHEMA, List.of(A(), B(), C()));
10326 }
10327
10328 public Value A() {
10329 return operands().get(0);
10330 }
10331
10332 public Value B() {
10333 return operands().get(1);
10334 }
10335
10336 public java.util.Optional<Value> C() {
10337 int i = optionalInputArguments.indexOf(InputParameter.C);
10338 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
10339 }
10340
10341 public java.util.Optional<Float> alpha() {
10342 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
10343 return java.util.Optional.ofNullable(alpha);
10344 }
10345
10346 public java.util.Optional<Long> transB() {
10347 Long transB = Attribute.transB.access(Long.class, onnxAttributes);
10348 return java.util.Optional.ofNullable(transB);
10349 }
10350
10351 public java.util.Optional<Float> beta() {
10352 Float beta = Attribute.beta.access(Float.class, onnxAttributes);
10353 return java.util.Optional.ofNullable(beta);
10354 }
10355
10356 public java.util.Optional<Long> transA() {
10357 Long transA = Attribute.transA.access(Long.class, onnxAttributes);
10358 return java.util.Optional.ofNullable(transA);
10359 }
10360
10361 }
10362
10363 public static Gemm Gemm(TypeElement resultType, Value A, Value B, java.util.Optional<Value> C, java.util.Optional<Float> alpha, java.util.Optional<Long> transB, java.util.Optional<Float> beta, java.util.Optional<Long> transA) {
10364 return new Gemm(resultType, A, B, C, alpha, transB, beta, transA);
10365 }
10366
10367 @OpFactoryHelper.OpDeclaration(GlobalAveragePool.NAME)
10368 public static final class GlobalAveragePool extends OnnxOp {
10369 public static final String NAME = "GlobalAveragePool";
10370
10371 public enum Attribute implements OnnxAttribute.None { }
10372
10373 public enum TypeConstraint implements OnnxTypeConstraint {
10374 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
10375 ;
10376
10377 final OnnxType.TypeVariable typeVariable;
10378
10379 TypeConstraint(OnnxType.TypeVariable typeVariable) {
10380 assert typeVariable.name().equals(name());
10381 this.typeVariable = typeVariable;
10382 }
10383
10384 @Override
10385 public OnnxType.TypeVariable typeVariable() {
10386 return typeVariable;
10387 }
10388 }
10389
10390 public enum InputParameter implements OnnxParameter {
10391 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10392 ;
10393
10394 final OnnxType type;
10395 final Quantifier quantifier;
10396
10397 InputParameter(OnnxType type, Quantifier quantifier) {
10398 this.type = type;
10399 this.quantifier = quantifier;
10400 }
10401
10402 @Override
10403 public OnnxType type() {
10404 return type;
10405 }
10406
10407 @Override
10408 public Quantifier quantifier() {
10409 return quantifier;
10410 }
10411 }
10412
10413 public enum OutputParameter implements OnnxParameter {
10414 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10415 ;
10416
10417 final OnnxType type;
10418 final Quantifier quantifier;
10419
10420 OutputParameter(OnnxType type, Quantifier quantifier) {
10421 this.type = type;
10422 this.quantifier = quantifier;
10423 }
10424
10425 @Override
10426 public OnnxType type() {
10427 return type;
10428 }
10429
10430 @Override
10431 public Quantifier quantifier() {
10432 return quantifier;
10433 }
10434 }
10435
10436 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
10437 NAME,
10438 List.of(Attribute.values()),
10439 List.of(TypeConstraint.values()),
10440 List.of(InputParameter.values()),
10441 List.of(OutputParameter.values())
10442 );
10443
10444 public GlobalAveragePool(ExternalizedOp def) {
10445 super(SCHEMA, def);
10446 }
10447
10448 GlobalAveragePool(GlobalAveragePool that, CodeContext cc) {
10449 super(that, cc);
10450 }
10451
10452 @Override
10453 public GlobalAveragePool transform(CodeContext cc, CodeTransformer ot) {
10454 return new GlobalAveragePool(this, cc);
10455 }
10456
10457 GlobalAveragePool(TypeElement resultType, Value X) {
10458 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
10459 }
10460
10461 @Override
10462 public SequencedSet<OnnxParameter> onnxOutputs() {
10463 return onnxOutputs(SCHEMA);
10464 }
10465
10466 @Override
10467 public SequencedMap<OnnxParameter, Object> onnxInputs() {
10468 return onnxInputs(SCHEMA, List.of(X()));
10469 }
10470
10471 public Value X() {
10472 return operands().get(0);
10473 }
10474
10475 }
10476
10477 public static GlobalAveragePool GlobalAveragePool(TypeElement resultType, Value X) {
10478 return new GlobalAveragePool(resultType, X);
10479 }
10480
10481 @OpFactoryHelper.OpDeclaration(GlobalLpPool.NAME)
10482 public static final class GlobalLpPool extends OnnxOp {
10483 public static final String NAME = "GlobalLpPool";
10484
10485 public enum Attribute implements OnnxAttribute {
10486 p(Long.class, true, 2),
10487 ;
10488
10489 final Class<?> t;
10490 final boolean optional;
10491 final Object defaultValue;
10492
10493 Attribute(Class<?> type, boolean optional, Object defaultValue) {
10494 this.t = type;
10495 this.optional = optional;
10496 this.defaultValue = defaultValue;
10497 assert optional || defaultValue == null;
10498 }
10499
10500 public Class<?> type() {
10501 return t;
10502 }
10503
10504 public boolean isOptional() {
10505 return optional;
10506 }
10507
10508 public Object defaultValue() {
10509 return defaultValue;
10510 }
10511 }
10512
10513 public enum TypeConstraint implements OnnxTypeConstraint {
10514 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
10515 ;
10516
10517 final OnnxType.TypeVariable typeVariable;
10518
10519 TypeConstraint(OnnxType.TypeVariable typeVariable) {
10520 assert typeVariable.name().equals(name());
10521 this.typeVariable = typeVariable;
10522 }
10523
10524 @Override
10525 public OnnxType.TypeVariable typeVariable() {
10526 return typeVariable;
10527 }
10528 }
10529
10530 public enum InputParameter implements OnnxParameter {
10531 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10532 ;
10533
10534 final OnnxType type;
10535 final Quantifier quantifier;
10536
10537 InputParameter(OnnxType type, Quantifier quantifier) {
10538 this.type = type;
10539 this.quantifier = quantifier;
10540 }
10541
10542 @Override
10543 public OnnxType type() {
10544 return type;
10545 }
10546
10547 @Override
10548 public Quantifier quantifier() {
10549 return quantifier;
10550 }
10551 }
10552
10553 public enum OutputParameter implements OnnxParameter {
10554 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10555 ;
10556
10557 final OnnxType type;
10558 final Quantifier quantifier;
10559
10560 OutputParameter(OnnxType type, Quantifier quantifier) {
10561 this.type = type;
10562 this.quantifier = quantifier;
10563 }
10564
10565 @Override
10566 public OnnxType type() {
10567 return type;
10568 }
10569
10570 @Override
10571 public Quantifier quantifier() {
10572 return quantifier;
10573 }
10574 }
10575
10576 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
10577 NAME,
10578 List.of(Attribute.values()),
10579 List.of(TypeConstraint.values()),
10580 List.of(InputParameter.values()),
10581 List.of(OutputParameter.values())
10582 );
10583
10584 public GlobalLpPool(ExternalizedOp def) {
10585 super(SCHEMA, def);
10586 }
10587
10588 GlobalLpPool(GlobalLpPool that, CodeContext cc) {
10589 super(that, cc);
10590 }
10591
10592 @Override
10593 public GlobalLpPool transform(CodeContext cc, CodeTransformer ot) {
10594 return new GlobalLpPool(this, cc);
10595 }
10596
10597 GlobalLpPool(TypeElement resultType, Value X, java.util.Optional<Long> p) {
10598 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(p));
10599 }
10600
10601 @Override
10602 public SequencedSet<OnnxParameter> onnxOutputs() {
10603 return onnxOutputs(SCHEMA);
10604 }
10605
10606 @Override
10607 public SequencedMap<OnnxParameter, Object> onnxInputs() {
10608 return onnxInputs(SCHEMA, List.of(X()));
10609 }
10610
10611 public Value X() {
10612 return operands().get(0);
10613 }
10614
10615 public java.util.Optional<Long> p() {
10616 Long p = Attribute.p.access(Long.class, onnxAttributes);
10617 return java.util.Optional.ofNullable(p);
10618 }
10619
10620 }
10621
10622 public static GlobalLpPool GlobalLpPool(TypeElement resultType, Value X, java.util.Optional<Long> p) {
10623 return new GlobalLpPool(resultType, X, p);
10624 }
10625
10626 @OpFactoryHelper.OpDeclaration(GlobalMaxPool.NAME)
10627 public static final class GlobalMaxPool extends OnnxOp {
10628 public static final String NAME = "GlobalMaxPool";
10629
10630 public enum Attribute implements OnnxAttribute.None { }
10631
10632 public enum TypeConstraint implements OnnxTypeConstraint {
10633 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
10634 ;
10635
10636 final OnnxType.TypeVariable typeVariable;
10637
10638 TypeConstraint(OnnxType.TypeVariable typeVariable) {
10639 assert typeVariable.name().equals(name());
10640 this.typeVariable = typeVariable;
10641 }
10642
10643 @Override
10644 public OnnxType.TypeVariable typeVariable() {
10645 return typeVariable;
10646 }
10647 }
10648
10649 public enum InputParameter implements OnnxParameter {
10650 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10651 ;
10652
10653 final OnnxType type;
10654 final Quantifier quantifier;
10655
10656 InputParameter(OnnxType type, Quantifier quantifier) {
10657 this.type = type;
10658 this.quantifier = quantifier;
10659 }
10660
10661 @Override
10662 public OnnxType type() {
10663 return type;
10664 }
10665
10666 @Override
10667 public Quantifier quantifier() {
10668 return quantifier;
10669 }
10670 }
10671
10672 public enum OutputParameter implements OnnxParameter {
10673 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10674 ;
10675
10676 final OnnxType type;
10677 final Quantifier quantifier;
10678
10679 OutputParameter(OnnxType type, Quantifier quantifier) {
10680 this.type = type;
10681 this.quantifier = quantifier;
10682 }
10683
10684 @Override
10685 public OnnxType type() {
10686 return type;
10687 }
10688
10689 @Override
10690 public Quantifier quantifier() {
10691 return quantifier;
10692 }
10693 }
10694
10695 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
10696 NAME,
10697 List.of(Attribute.values()),
10698 List.of(TypeConstraint.values()),
10699 List.of(InputParameter.values()),
10700 List.of(OutputParameter.values())
10701 );
10702
10703 public GlobalMaxPool(ExternalizedOp def) {
10704 super(SCHEMA, def);
10705 }
10706
10707 GlobalMaxPool(GlobalMaxPool that, CodeContext cc) {
10708 super(that, cc);
10709 }
10710
10711 @Override
10712 public GlobalMaxPool transform(CodeContext cc, CodeTransformer ot) {
10713 return new GlobalMaxPool(this, cc);
10714 }
10715
10716 GlobalMaxPool(TypeElement resultType, Value X) {
10717 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
10718 }
10719
10720 @Override
10721 public SequencedSet<OnnxParameter> onnxOutputs() {
10722 return onnxOutputs(SCHEMA);
10723 }
10724
10725 @Override
10726 public SequencedMap<OnnxParameter, Object> onnxInputs() {
10727 return onnxInputs(SCHEMA, List.of(X()));
10728 }
10729
10730 public Value X() {
10731 return operands().get(0);
10732 }
10733
10734 }
10735
10736 public static GlobalMaxPool GlobalMaxPool(TypeElement resultType, Value X) {
10737 return new GlobalMaxPool(resultType, X);
10738 }
10739
10740 @OpFactoryHelper.OpDeclaration(Gradient.NAME)
10741 public static final class Gradient extends OnnxOp {
10742 public static final String NAME = "Gradient";
10743
10744 public enum Attribute implements OnnxAttribute {
10745 y(String.class, false, null),
10746 zs(String[].class, true, null),
10747 xs(String[].class, false, null),
10748 ;
10749
10750 final Class<?> t;
10751 final boolean optional;
10752 final Object defaultValue;
10753
10754 Attribute(Class<?> type, boolean optional, Object defaultValue) {
10755 this.t = type;
10756 this.optional = optional;
10757 this.defaultValue = defaultValue;
10758 assert optional || defaultValue == null;
10759 }
10760
10761 public Class<?> type() {
10762 return t;
10763 }
10764
10765 public boolean isOptional() {
10766 return optional;
10767 }
10768
10769 public Object defaultValue() {
10770 return defaultValue;
10771 }
10772 }
10773
10774 public enum TypeConstraint implements OnnxTypeConstraint {
10775 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
10776 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
10777 ;
10778
10779 final OnnxType.TypeVariable typeVariable;
10780
10781 TypeConstraint(OnnxType.TypeVariable typeVariable) {
10782 assert typeVariable.name().equals(name());
10783 this.typeVariable = typeVariable;
10784 }
10785
10786 @Override
10787 public OnnxType.TypeVariable typeVariable() {
10788 return typeVariable;
10789 }
10790 }
10791
10792 public enum InputParameter implements OnnxParameter {
10793 Inputs(TypeConstraint.T1.typeVariable(), Quantifier.VARIADIC),
10794 ;
10795
10796 final OnnxType type;
10797 final Quantifier quantifier;
10798
10799 InputParameter(OnnxType type, Quantifier quantifier) {
10800 this.type = type;
10801 this.quantifier = quantifier;
10802 }
10803
10804 @Override
10805 public OnnxType type() {
10806 return type;
10807 }
10808
10809 @Override
10810 public Quantifier quantifier() {
10811 return quantifier;
10812 }
10813 }
10814
10815 public enum OutputParameter implements OnnxParameter {
10816 Outputs(TypeConstraint.T2.typeVariable(), Quantifier.VARIADIC),
10817 ;
10818
10819 final OnnxType type;
10820 final Quantifier quantifier;
10821
10822 OutputParameter(OnnxType type, Quantifier quantifier) {
10823 this.type = type;
10824 this.quantifier = quantifier;
10825 }
10826
10827 @Override
10828 public OnnxType type() {
10829 return type;
10830 }
10831
10832 @Override
10833 public Quantifier quantifier() {
10834 return quantifier;
10835 }
10836 }
10837
10838 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
10839 NAME,
10840 List.of(Attribute.values()),
10841 List.of(TypeConstraint.values()),
10842 List.of(InputParameter.values()),
10843 List.of(OutputParameter.values())
10844 );
10845
10846 public Gradient(ExternalizedOp def) {
10847 super(SCHEMA, def);
10848 }
10849
10850 Gradient(Gradient that, CodeContext cc) {
10851 super(that, cc);
10852 }
10853
10854 @Override
10855 public Gradient transform(CodeContext cc, CodeTransformer ot) {
10856 return new Gradient(this, cc);
10857 }
10858
10859 Gradient(TypeElement resultType, List<Value> Inputs, String y, java.util.Optional<String[]> zs, String[] xs) {
10860 super(SCHEMA, resultType, Set.of(), List.of(Inputs), List.of(y, zs, xs));
10861 }
10862
10863 @Override
10864 public SequencedSet<OnnxParameter> onnxOutputs() {
10865 return onnxOutputs(SCHEMA);
10866 }
10867
10868 @Override
10869 public SequencedMap<OnnxParameter, Object> onnxInputs() {
10870 return onnxInputs(SCHEMA, List.of(Inputs()));
10871 }
10872
10873 public List<Value> Inputs() {
10874 return operands();
10875 }
10876
10877 public String y() {
10878 String y = Attribute.y.access(String.class, onnxAttributes);
10879 return y;
10880 }
10881
10882 public java.util.Optional<String[]> zs() {
10883 String[] zs = Attribute.zs.access(String[].class, onnxAttributes);
10884 return java.util.Optional.ofNullable(zs).map(String[]::clone);
10885 }
10886
10887 public String[] xs() {
10888 String[] xs = Attribute.xs.access(String[].class, onnxAttributes);
10889 return xs.clone();
10890 }
10891
10892 }
10893
10894 public static Gradient Gradient(TypeElement resultType, List<Value> Inputs, String y, java.util.Optional<String[]> zs, String[] xs) {
10895 return new Gradient(resultType, Inputs, y, zs, xs);
10896 }
10897
10898 @OpFactoryHelper.OpDeclaration(Greater.NAME)
10899 public static final class Greater extends OnnxOp {
10900 public static final String NAME = "Greater";
10901
10902 public enum Attribute implements OnnxAttribute.None { }
10903
10904 public enum TypeConstraint implements OnnxTypeConstraint {
10905 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
10906 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
10907 ;
10908
10909 final OnnxType.TypeVariable typeVariable;
10910
10911 TypeConstraint(OnnxType.TypeVariable typeVariable) {
10912 assert typeVariable.name().equals(name());
10913 this.typeVariable = typeVariable;
10914 }
10915
10916 @Override
10917 public OnnxType.TypeVariable typeVariable() {
10918 return typeVariable;
10919 }
10920 }
10921
10922 public enum InputParameter implements OnnxParameter {
10923 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10924 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
10925 ;
10926
10927 final OnnxType type;
10928 final Quantifier quantifier;
10929
10930 InputParameter(OnnxType type, Quantifier quantifier) {
10931 this.type = type;
10932 this.quantifier = quantifier;
10933 }
10934
10935 @Override
10936 public OnnxType type() {
10937 return type;
10938 }
10939
10940 @Override
10941 public Quantifier quantifier() {
10942 return quantifier;
10943 }
10944 }
10945
10946 public enum OutputParameter implements OnnxParameter {
10947 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
10948 ;
10949
10950 final OnnxType type;
10951 final Quantifier quantifier;
10952
10953 OutputParameter(OnnxType type, Quantifier quantifier) {
10954 this.type = type;
10955 this.quantifier = quantifier;
10956 }
10957
10958 @Override
10959 public OnnxType type() {
10960 return type;
10961 }
10962
10963 @Override
10964 public Quantifier quantifier() {
10965 return quantifier;
10966 }
10967 }
10968
10969 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
10970 NAME,
10971 List.of(Attribute.values()),
10972 List.of(TypeConstraint.values()),
10973 List.of(InputParameter.values()),
10974 List.of(OutputParameter.values())
10975 );
10976
10977 public Greater(ExternalizedOp def) {
10978 super(SCHEMA, def);
10979 }
10980
10981 Greater(Greater that, CodeContext cc) {
10982 super(that, cc);
10983 }
10984
10985 @Override
10986 public Greater transform(CodeContext cc, CodeTransformer ot) {
10987 return new Greater(this, cc);
10988 }
10989
10990 Greater(TypeElement resultType, Value A, Value B) {
10991 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
10992 }
10993
10994 @Override
10995 public SequencedSet<OnnxParameter> onnxOutputs() {
10996 return onnxOutputs(SCHEMA);
10997 }
10998
10999 @Override
11000 public SequencedMap<OnnxParameter, Object> onnxInputs() {
11001 return onnxInputs(SCHEMA, List.of(A(), B()));
11002 }
11003
11004 public Value A() {
11005 return operands().get(0);
11006 }
11007
11008 public Value B() {
11009 return operands().get(1);
11010 }
11011
11012 }
11013
11014 public static Greater Greater(TypeElement resultType, Value A, Value B) {
11015 return new Greater(resultType, A, B);
11016 }
11017
11018 @OpFactoryHelper.OpDeclaration(GreaterOrEqual.NAME)
11019 public static final class GreaterOrEqual extends OnnxOp {
11020 public static final String NAME = "GreaterOrEqual";
11021
11022 public enum Attribute implements OnnxAttribute.None { }
11023
11024 public enum TypeConstraint implements OnnxTypeConstraint {
11025 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
11026 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
11027 ;
11028
11029 final OnnxType.TypeVariable typeVariable;
11030
11031 TypeConstraint(OnnxType.TypeVariable typeVariable) {
11032 assert typeVariable.name().equals(name());
11033 this.typeVariable = typeVariable;
11034 }
11035
11036 @Override
11037 public OnnxType.TypeVariable typeVariable() {
11038 return typeVariable;
11039 }
11040 }
11041
11042 public enum InputParameter implements OnnxParameter {
11043 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11044 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11045 ;
11046
11047 final OnnxType type;
11048 final Quantifier quantifier;
11049
11050 InputParameter(OnnxType type, Quantifier quantifier) {
11051 this.type = type;
11052 this.quantifier = quantifier;
11053 }
11054
11055 @Override
11056 public OnnxType type() {
11057 return type;
11058 }
11059
11060 @Override
11061 public Quantifier quantifier() {
11062 return quantifier;
11063 }
11064 }
11065
11066 public enum OutputParameter implements OnnxParameter {
11067 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
11068 ;
11069
11070 final OnnxType type;
11071 final Quantifier quantifier;
11072
11073 OutputParameter(OnnxType type, Quantifier quantifier) {
11074 this.type = type;
11075 this.quantifier = quantifier;
11076 }
11077
11078 @Override
11079 public OnnxType type() {
11080 return type;
11081 }
11082
11083 @Override
11084 public Quantifier quantifier() {
11085 return quantifier;
11086 }
11087 }
11088
11089 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
11090 NAME,
11091 List.of(Attribute.values()),
11092 List.of(TypeConstraint.values()),
11093 List.of(InputParameter.values()),
11094 List.of(OutputParameter.values())
11095 );
11096
11097 public GreaterOrEqual(ExternalizedOp def) {
11098 super(SCHEMA, def);
11099 }
11100
11101 GreaterOrEqual(GreaterOrEqual that, CodeContext cc) {
11102 super(that, cc);
11103 }
11104
11105 @Override
11106 public GreaterOrEqual transform(CodeContext cc, CodeTransformer ot) {
11107 return new GreaterOrEqual(this, cc);
11108 }
11109
11110 GreaterOrEqual(TypeElement resultType, Value A, Value B) {
11111 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
11112 }
11113
11114 @Override
11115 public SequencedSet<OnnxParameter> onnxOutputs() {
11116 return onnxOutputs(SCHEMA);
11117 }
11118
11119 @Override
11120 public SequencedMap<OnnxParameter, Object> onnxInputs() {
11121 return onnxInputs(SCHEMA, List.of(A(), B()));
11122 }
11123
11124 public Value A() {
11125 return operands().get(0);
11126 }
11127
11128 public Value B() {
11129 return operands().get(1);
11130 }
11131
11132 }
11133
11134 public static GreaterOrEqual GreaterOrEqual(TypeElement resultType, Value A, Value B) {
11135 return new GreaterOrEqual(resultType, A, B);
11136 }
11137
11138 @OpFactoryHelper.OpDeclaration(GridSample.NAME)
11139 public static final class GridSample extends OnnxOp {
11140 public static final String NAME = "GridSample";
11141
11142 public enum Attribute implements OnnxAttribute {
11143 mode(String.class, true, "linear"),
11144 align_corners(Long.class, true, 0),
11145 padding_mode(String.class, true, "zeros"),
11146 ;
11147
11148 final Class<?> t;
11149 final boolean optional;
11150 final Object defaultValue;
11151
11152 Attribute(Class<?> type, boolean optional, Object defaultValue) {
11153 this.t = type;
11154 this.optional = optional;
11155 this.defaultValue = defaultValue;
11156 assert optional || defaultValue == null;
11157 }
11158
11159 public Class<?> type() {
11160 return t;
11161 }
11162
11163 public boolean isOptional() {
11164 return optional;
11165 }
11166
11167 public Object defaultValue() {
11168 return defaultValue;
11169 }
11170 }
11171
11172 public enum TypeConstraint implements OnnxTypeConstraint {
11173 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
11174 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
11175 ;
11176
11177 final OnnxType.TypeVariable typeVariable;
11178
11179 TypeConstraint(OnnxType.TypeVariable typeVariable) {
11180 assert typeVariable.name().equals(name());
11181 this.typeVariable = typeVariable;
11182 }
11183
11184 @Override
11185 public OnnxType.TypeVariable typeVariable() {
11186 return typeVariable;
11187 }
11188 }
11189
11190 public enum InputParameter implements OnnxParameter {
11191 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
11192 grid(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
11193 ;
11194
11195 final OnnxType type;
11196 final Quantifier quantifier;
11197
11198 InputParameter(OnnxType type, Quantifier quantifier) {
11199 this.type = type;
11200 this.quantifier = quantifier;
11201 }
11202
11203 @Override
11204 public OnnxType type() {
11205 return type;
11206 }
11207
11208 @Override
11209 public Quantifier quantifier() {
11210 return quantifier;
11211 }
11212 }
11213
11214 public enum OutputParameter implements OnnxParameter {
11215 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
11216 ;
11217
11218 final OnnxType type;
11219 final Quantifier quantifier;
11220
11221 OutputParameter(OnnxType type, Quantifier quantifier) {
11222 this.type = type;
11223 this.quantifier = quantifier;
11224 }
11225
11226 @Override
11227 public OnnxType type() {
11228 return type;
11229 }
11230
11231 @Override
11232 public Quantifier quantifier() {
11233 return quantifier;
11234 }
11235 }
11236
11237 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
11238 NAME,
11239 List.of(Attribute.values()),
11240 List.of(TypeConstraint.values()),
11241 List.of(InputParameter.values()),
11242 List.of(OutputParameter.values())
11243 );
11244
11245 public GridSample(ExternalizedOp def) {
11246 super(SCHEMA, def);
11247 }
11248
11249 GridSample(GridSample that, CodeContext cc) {
11250 super(that, cc);
11251 }
11252
11253 @Override
11254 public GridSample transform(CodeContext cc, CodeTransformer ot) {
11255 return new GridSample(this, cc);
11256 }
11257
11258 GridSample(TypeElement resultType, Value X, Value grid, java.util.Optional<String> mode, java.util.Optional<Long> align_corners, java.util.Optional<String> padding_mode) {
11259 super(SCHEMA, resultType, Set.of(), List.of(X, grid), List.of(mode, align_corners, padding_mode));
11260 }
11261
11262 @Override
11263 public SequencedSet<OnnxParameter> onnxOutputs() {
11264 return onnxOutputs(SCHEMA);
11265 }
11266
11267 @Override
11268 public SequencedMap<OnnxParameter, Object> onnxInputs() {
11269 return onnxInputs(SCHEMA, List.of(X(), grid()));
11270 }
11271
11272 public Value X() {
11273 return operands().get(0);
11274 }
11275
11276 public Value grid() {
11277 return operands().get(1);
11278 }
11279
11280 public java.util.Optional<String> mode() {
11281 String mode = Attribute.mode.access(String.class, onnxAttributes);
11282 return java.util.Optional.ofNullable(mode);
11283 }
11284
11285 public java.util.Optional<Long> align_corners() {
11286 Long align_corners = Attribute.align_corners.access(Long.class, onnxAttributes);
11287 return java.util.Optional.ofNullable(align_corners);
11288 }
11289
11290 public java.util.Optional<String> padding_mode() {
11291 String padding_mode = Attribute.padding_mode.access(String.class, onnxAttributes);
11292 return java.util.Optional.ofNullable(padding_mode);
11293 }
11294
11295 }
11296
11297 public static GridSample GridSample(TypeElement resultType, Value X, Value grid, java.util.Optional<String> mode, java.util.Optional<Long> align_corners, java.util.Optional<String> padding_mode) {
11298 return new GridSample(resultType, X, grid, mode, align_corners, padding_mode);
11299 }
11300
11301 @OpFactoryHelper.OpDeclaration(GroupNormalization.NAME)
11302 public static final class GroupNormalization extends OnnxOp {
11303 public static final String NAME = "GroupNormalization";
11304
11305 public enum Attribute implements OnnxAttribute {
11306 epsilon(Float.class, true, 1.0E-5f),
11307 stash_type(Long.class, true, 1),
11308 num_groups(Long.class, false, null),
11309 ;
11310
11311 final Class<?> t;
11312 final boolean optional;
11313 final Object defaultValue;
11314
11315 Attribute(Class<?> type, boolean optional, Object defaultValue) {
11316 this.t = type;
11317 this.optional = optional;
11318 this.defaultValue = defaultValue;
11319 assert optional || defaultValue == null;
11320 }
11321
11322 public Class<?> type() {
11323 return t;
11324 }
11325
11326 public boolean isOptional() {
11327 return optional;
11328 }
11329
11330 public Object defaultValue() {
11331 return defaultValue;
11332 }
11333 }
11334
11335 public enum TypeConstraint implements OnnxTypeConstraint {
11336 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
11337 ;
11338
11339 final OnnxType.TypeVariable typeVariable;
11340
11341 TypeConstraint(OnnxType.TypeVariable typeVariable) {
11342 assert typeVariable.name().equals(name());
11343 this.typeVariable = typeVariable;
11344 }
11345
11346 @Override
11347 public OnnxType.TypeVariable typeVariable() {
11348 return typeVariable;
11349 }
11350 }
11351
11352 public enum InputParameter implements OnnxParameter {
11353 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11354 scale(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11355 bias(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11356 ;
11357
11358 final OnnxType type;
11359 final Quantifier quantifier;
11360
11361 InputParameter(OnnxType type, Quantifier quantifier) {
11362 this.type = type;
11363 this.quantifier = quantifier;
11364 }
11365
11366 @Override
11367 public OnnxType type() {
11368 return type;
11369 }
11370
11371 @Override
11372 public Quantifier quantifier() {
11373 return quantifier;
11374 }
11375 }
11376
11377 public enum OutputParameter implements OnnxParameter {
11378 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11379 ;
11380
11381 final OnnxType type;
11382 final Quantifier quantifier;
11383
11384 OutputParameter(OnnxType type, Quantifier quantifier) {
11385 this.type = type;
11386 this.quantifier = quantifier;
11387 }
11388
11389 @Override
11390 public OnnxType type() {
11391 return type;
11392 }
11393
11394 @Override
11395 public Quantifier quantifier() {
11396 return quantifier;
11397 }
11398 }
11399
11400 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
11401 NAME,
11402 List.of(Attribute.values()),
11403 List.of(TypeConstraint.values()),
11404 List.of(InputParameter.values()),
11405 List.of(OutputParameter.values())
11406 );
11407
11408 public GroupNormalization(ExternalizedOp def) {
11409 super(SCHEMA, def);
11410 }
11411
11412 GroupNormalization(GroupNormalization that, CodeContext cc) {
11413 super(that, cc);
11414 }
11415
11416 @Override
11417 public GroupNormalization transform(CodeContext cc, CodeTransformer ot) {
11418 return new GroupNormalization(this, cc);
11419 }
11420
11421 GroupNormalization(TypeElement resultType, Value X, Value scale, Value bias, java.util.Optional<Float> epsilon, java.util.Optional<Long> stash_type, long num_groups) {
11422 super(SCHEMA, resultType, Set.of(), List.of(X, scale, bias), List.of(epsilon, stash_type, num_groups));
11423 }
11424
11425 @Override
11426 public SequencedSet<OnnxParameter> onnxOutputs() {
11427 return onnxOutputs(SCHEMA);
11428 }
11429
11430 @Override
11431 public SequencedMap<OnnxParameter, Object> onnxInputs() {
11432 return onnxInputs(SCHEMA, List.of(X(), scale(), bias()));
11433 }
11434
11435 public Value X() {
11436 return operands().get(0);
11437 }
11438
11439 public Value scale() {
11440 return operands().get(1);
11441 }
11442
11443 public Value bias() {
11444 return operands().get(2);
11445 }
11446
11447 public java.util.Optional<Float> epsilon() {
11448 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes);
11449 return java.util.Optional.ofNullable(epsilon);
11450 }
11451
11452 public java.util.Optional<Long> stash_type() {
11453 Long stash_type = Attribute.stash_type.access(Long.class, onnxAttributes);
11454 return java.util.Optional.ofNullable(stash_type);
11455 }
11456
11457 public long num_groups() {
11458 long num_groups = Attribute.num_groups.access(Long.class, onnxAttributes);
11459 return num_groups;
11460 }
11461
11462 }
11463
11464 public static GroupNormalization GroupNormalization(TypeElement resultType, Value X, Value scale, Value bias, java.util.Optional<Float> epsilon, java.util.Optional<Long> stash_type, long num_groups) {
11465 return new GroupNormalization(resultType, X, scale, bias, epsilon, stash_type, num_groups);
11466 }
11467
11468 @OpFactoryHelper.OpDeclaration(HammingWindow.NAME)
11469 public static final class HammingWindow extends OnnxOp {
11470 public static final String NAME = "HammingWindow";
11471
11472 public enum Attribute implements OnnxAttribute {
11473 periodic(Long.class, true, 1),
11474 output_datatype(Long.class, true, 1),
11475 ;
11476
11477 final Class<?> t;
11478 final boolean optional;
11479 final Object defaultValue;
11480
11481 Attribute(Class<?> type, boolean optional, Object defaultValue) {
11482 this.t = type;
11483 this.optional = optional;
11484 this.defaultValue = defaultValue;
11485 assert optional || defaultValue == null;
11486 }
11487
11488 public Class<?> type() {
11489 return t;
11490 }
11491
11492 public boolean isOptional() {
11493 return optional;
11494 }
11495
11496 public Object defaultValue() {
11497 return defaultValue;
11498 }
11499 }
11500
11501 public enum TypeConstraint implements OnnxTypeConstraint {
11502 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
11503 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
11504 ;
11505
11506 final OnnxType.TypeVariable typeVariable;
11507
11508 TypeConstraint(OnnxType.TypeVariable typeVariable) {
11509 assert typeVariable.name().equals(name());
11510 this.typeVariable = typeVariable;
11511 }
11512
11513 @Override
11514 public OnnxType.TypeVariable typeVariable() {
11515 return typeVariable;
11516 }
11517 }
11518
11519 public enum InputParameter implements OnnxParameter {
11520 size(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
11521 ;
11522
11523 final OnnxType type;
11524 final Quantifier quantifier;
11525
11526 InputParameter(OnnxType type, Quantifier quantifier) {
11527 this.type = type;
11528 this.quantifier = quantifier;
11529 }
11530
11531 @Override
11532 public OnnxType type() {
11533 return type;
11534 }
11535
11536 @Override
11537 public Quantifier quantifier() {
11538 return quantifier;
11539 }
11540 }
11541
11542 public enum OutputParameter implements OnnxParameter {
11543 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
11544 ;
11545
11546 final OnnxType type;
11547 final Quantifier quantifier;
11548
11549 OutputParameter(OnnxType type, Quantifier quantifier) {
11550 this.type = type;
11551 this.quantifier = quantifier;
11552 }
11553
11554 @Override
11555 public OnnxType type() {
11556 return type;
11557 }
11558
11559 @Override
11560 public Quantifier quantifier() {
11561 return quantifier;
11562 }
11563 }
11564
11565 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
11566 NAME,
11567 List.of(Attribute.values()),
11568 List.of(TypeConstraint.values()),
11569 List.of(InputParameter.values()),
11570 List.of(OutputParameter.values())
11571 );
11572
11573 public HammingWindow(ExternalizedOp def) {
11574 super(SCHEMA, def);
11575 }
11576
11577 HammingWindow(HammingWindow that, CodeContext cc) {
11578 super(that, cc);
11579 }
11580
11581 @Override
11582 public HammingWindow transform(CodeContext cc, CodeTransformer ot) {
11583 return new HammingWindow(this, cc);
11584 }
11585
11586 HammingWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) {
11587 super(SCHEMA, resultType, Set.of(), List.of(size), List.of(periodic, output_datatype));
11588 }
11589
11590 @Override
11591 public SequencedSet<OnnxParameter> onnxOutputs() {
11592 return onnxOutputs(SCHEMA);
11593 }
11594
11595 @Override
11596 public SequencedMap<OnnxParameter, Object> onnxInputs() {
11597 return onnxInputs(SCHEMA, List.of(size()));
11598 }
11599
11600 public Value size() {
11601 return operands().get(0);
11602 }
11603
11604 public java.util.Optional<Long> periodic() {
11605 Long periodic = Attribute.periodic.access(Long.class, onnxAttributes);
11606 return java.util.Optional.ofNullable(periodic);
11607 }
11608
11609 public java.util.Optional<Long> output_datatype() {
11610 Long output_datatype = Attribute.output_datatype.access(Long.class, onnxAttributes);
11611 return java.util.Optional.ofNullable(output_datatype);
11612 }
11613
11614 }
11615
11616 public static HammingWindow HammingWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) {
11617 return new HammingWindow(resultType, size, periodic, output_datatype);
11618 }
11619
11620 @OpFactoryHelper.OpDeclaration(HannWindow.NAME)
11621 public static final class HannWindow extends OnnxOp {
11622 public static final String NAME = "HannWindow";
11623
11624 public enum Attribute implements OnnxAttribute {
11625 periodic(Long.class, true, 1),
11626 output_datatype(Long.class, true, 1),
11627 ;
11628
11629 final Class<?> t;
11630 final boolean optional;
11631 final Object defaultValue;
11632
11633 Attribute(Class<?> type, boolean optional, Object defaultValue) {
11634 this.t = type;
11635 this.optional = optional;
11636 this.defaultValue = defaultValue;
11637 assert optional || defaultValue == null;
11638 }
11639
11640 public Class<?> type() {
11641 return t;
11642 }
11643
11644 public boolean isOptional() {
11645 return optional;
11646 }
11647
11648 public Object defaultValue() {
11649 return defaultValue;
11650 }
11651 }
11652
11653 public enum TypeConstraint implements OnnxTypeConstraint {
11654 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
11655 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
11656 ;
11657
11658 final OnnxType.TypeVariable typeVariable;
11659
11660 TypeConstraint(OnnxType.TypeVariable typeVariable) {
11661 assert typeVariable.name().equals(name());
11662 this.typeVariable = typeVariable;
11663 }
11664
11665 @Override
11666 public OnnxType.TypeVariable typeVariable() {
11667 return typeVariable;
11668 }
11669 }
11670
11671 public enum InputParameter implements OnnxParameter {
11672 size(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
11673 ;
11674
11675 final OnnxType type;
11676 final Quantifier quantifier;
11677
11678 InputParameter(OnnxType type, Quantifier quantifier) {
11679 this.type = type;
11680 this.quantifier = quantifier;
11681 }
11682
11683 @Override
11684 public OnnxType type() {
11685 return type;
11686 }
11687
11688 @Override
11689 public Quantifier quantifier() {
11690 return quantifier;
11691 }
11692 }
11693
11694 public enum OutputParameter implements OnnxParameter {
11695 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
11696 ;
11697
11698 final OnnxType type;
11699 final Quantifier quantifier;
11700
11701 OutputParameter(OnnxType type, Quantifier quantifier) {
11702 this.type = type;
11703 this.quantifier = quantifier;
11704 }
11705
11706 @Override
11707 public OnnxType type() {
11708 return type;
11709 }
11710
11711 @Override
11712 public Quantifier quantifier() {
11713 return quantifier;
11714 }
11715 }
11716
11717 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
11718 NAME,
11719 List.of(Attribute.values()),
11720 List.of(TypeConstraint.values()),
11721 List.of(InputParameter.values()),
11722 List.of(OutputParameter.values())
11723 );
11724
11725 public HannWindow(ExternalizedOp def) {
11726 super(SCHEMA, def);
11727 }
11728
11729 HannWindow(HannWindow that, CodeContext cc) {
11730 super(that, cc);
11731 }
11732
11733 @Override
11734 public HannWindow transform(CodeContext cc, CodeTransformer ot) {
11735 return new HannWindow(this, cc);
11736 }
11737
11738 HannWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) {
11739 super(SCHEMA, resultType, Set.of(), List.of(size), List.of(periodic, output_datatype));
11740 }
11741
11742 @Override
11743 public SequencedSet<OnnxParameter> onnxOutputs() {
11744 return onnxOutputs(SCHEMA);
11745 }
11746
11747 @Override
11748 public SequencedMap<OnnxParameter, Object> onnxInputs() {
11749 return onnxInputs(SCHEMA, List.of(size()));
11750 }
11751
11752 public Value size() {
11753 return operands().get(0);
11754 }
11755
11756 public java.util.Optional<Long> periodic() {
11757 Long periodic = Attribute.periodic.access(Long.class, onnxAttributes);
11758 return java.util.Optional.ofNullable(periodic);
11759 }
11760
11761 public java.util.Optional<Long> output_datatype() {
11762 Long output_datatype = Attribute.output_datatype.access(Long.class, onnxAttributes);
11763 return java.util.Optional.ofNullable(output_datatype);
11764 }
11765
11766 }
11767
11768 public static HannWindow HannWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) {
11769 return new HannWindow(resultType, size, periodic, output_datatype);
11770 }
11771
11772 @OpFactoryHelper.OpDeclaration(HardSigmoid.NAME)
11773 public static final class HardSigmoid extends OnnxOp {
11774 public static final String NAME = "HardSigmoid";
11775
11776 public enum Attribute implements OnnxAttribute {
11777 alpha(Float.class, true, 0.2f),
11778 beta(Float.class, true, 0.5f),
11779 ;
11780
11781 final Class<?> t;
11782 final boolean optional;
11783 final Object defaultValue;
11784
11785 Attribute(Class<?> type, boolean optional, Object defaultValue) {
11786 this.t = type;
11787 this.optional = optional;
11788 this.defaultValue = defaultValue;
11789 assert optional || defaultValue == null;
11790 }
11791
11792 public Class<?> type() {
11793 return t;
11794 }
11795
11796 public boolean isOptional() {
11797 return optional;
11798 }
11799
11800 public Object defaultValue() {
11801 return defaultValue;
11802 }
11803 }
11804
11805 public enum TypeConstraint implements OnnxTypeConstraint {
11806 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
11807 ;
11808
11809 final OnnxType.TypeVariable typeVariable;
11810
11811 TypeConstraint(OnnxType.TypeVariable typeVariable) {
11812 assert typeVariable.name().equals(name());
11813 this.typeVariable = typeVariable;
11814 }
11815
11816 @Override
11817 public OnnxType.TypeVariable typeVariable() {
11818 return typeVariable;
11819 }
11820 }
11821
11822 public enum InputParameter implements OnnxParameter {
11823 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11824 ;
11825
11826 final OnnxType type;
11827 final Quantifier quantifier;
11828
11829 InputParameter(OnnxType type, Quantifier quantifier) {
11830 this.type = type;
11831 this.quantifier = quantifier;
11832 }
11833
11834 @Override
11835 public OnnxType type() {
11836 return type;
11837 }
11838
11839 @Override
11840 public Quantifier quantifier() {
11841 return quantifier;
11842 }
11843 }
11844
11845 public enum OutputParameter implements OnnxParameter {
11846 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11847 ;
11848
11849 final OnnxType type;
11850 final Quantifier quantifier;
11851
11852 OutputParameter(OnnxType type, Quantifier quantifier) {
11853 this.type = type;
11854 this.quantifier = quantifier;
11855 }
11856
11857 @Override
11858 public OnnxType type() {
11859 return type;
11860 }
11861
11862 @Override
11863 public Quantifier quantifier() {
11864 return quantifier;
11865 }
11866 }
11867
11868 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
11869 NAME,
11870 List.of(Attribute.values()),
11871 List.of(TypeConstraint.values()),
11872 List.of(InputParameter.values()),
11873 List.of(OutputParameter.values())
11874 );
11875
11876 public HardSigmoid(ExternalizedOp def) {
11877 super(SCHEMA, def);
11878 }
11879
11880 HardSigmoid(HardSigmoid that, CodeContext cc) {
11881 super(that, cc);
11882 }
11883
11884 @Override
11885 public HardSigmoid transform(CodeContext cc, CodeTransformer ot) {
11886 return new HardSigmoid(this, cc);
11887 }
11888
11889 HardSigmoid(TypeElement resultType, Value X, java.util.Optional<Float> alpha, java.util.Optional<Float> beta) {
11890 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha, beta));
11891 }
11892
11893 @Override
11894 public SequencedSet<OnnxParameter> onnxOutputs() {
11895 return onnxOutputs(SCHEMA);
11896 }
11897
11898 @Override
11899 public SequencedMap<OnnxParameter, Object> onnxInputs() {
11900 return onnxInputs(SCHEMA, List.of(X()));
11901 }
11902
11903 public Value X() {
11904 return operands().get(0);
11905 }
11906
11907 public java.util.Optional<Float> alpha() {
11908 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
11909 return java.util.Optional.ofNullable(alpha);
11910 }
11911
11912 public java.util.Optional<Float> beta() {
11913 Float beta = Attribute.beta.access(Float.class, onnxAttributes);
11914 return java.util.Optional.ofNullable(beta);
11915 }
11916
11917 }
11918
11919 public static HardSigmoid HardSigmoid(TypeElement resultType, Value X, java.util.Optional<Float> alpha, java.util.Optional<Float> beta) {
11920 return new HardSigmoid(resultType, X, alpha, beta);
11921 }
11922
11923 @OpFactoryHelper.OpDeclaration(HardSwish.NAME)
11924 public static final class HardSwish extends OnnxOp {
11925 public static final String NAME = "HardSwish";
11926
11927 public enum Attribute implements OnnxAttribute.None { }
11928
11929 public enum TypeConstraint implements OnnxTypeConstraint {
11930 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
11931 ;
11932
11933 final OnnxType.TypeVariable typeVariable;
11934
11935 TypeConstraint(OnnxType.TypeVariable typeVariable) {
11936 assert typeVariable.name().equals(name());
11937 this.typeVariable = typeVariable;
11938 }
11939
11940 @Override
11941 public OnnxType.TypeVariable typeVariable() {
11942 return typeVariable;
11943 }
11944 }
11945
11946 public enum InputParameter implements OnnxParameter {
11947 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11948 ;
11949
11950 final OnnxType type;
11951 final Quantifier quantifier;
11952
11953 InputParameter(OnnxType type, Quantifier quantifier) {
11954 this.type = type;
11955 this.quantifier = quantifier;
11956 }
11957
11958 @Override
11959 public OnnxType type() {
11960 return type;
11961 }
11962
11963 @Override
11964 public Quantifier quantifier() {
11965 return quantifier;
11966 }
11967 }
11968
11969 public enum OutputParameter implements OnnxParameter {
11970 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
11971 ;
11972
11973 final OnnxType type;
11974 final Quantifier quantifier;
11975
11976 OutputParameter(OnnxType type, Quantifier quantifier) {
11977 this.type = type;
11978 this.quantifier = quantifier;
11979 }
11980
11981 @Override
11982 public OnnxType type() {
11983 return type;
11984 }
11985
11986 @Override
11987 public Quantifier quantifier() {
11988 return quantifier;
11989 }
11990 }
11991
11992 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
11993 NAME,
11994 List.of(Attribute.values()),
11995 List.of(TypeConstraint.values()),
11996 List.of(InputParameter.values()),
11997 List.of(OutputParameter.values())
11998 );
11999
12000 public HardSwish(ExternalizedOp def) {
12001 super(SCHEMA, def);
12002 }
12003
12004 HardSwish(HardSwish that, CodeContext cc) {
12005 super(that, cc);
12006 }
12007
12008 @Override
12009 public HardSwish transform(CodeContext cc, CodeTransformer ot) {
12010 return new HardSwish(this, cc);
12011 }
12012
12013 HardSwish(TypeElement resultType, Value X) {
12014 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
12015 }
12016
12017 @Override
12018 public SequencedSet<OnnxParameter> onnxOutputs() {
12019 return onnxOutputs(SCHEMA);
12020 }
12021
12022 @Override
12023 public SequencedMap<OnnxParameter, Object> onnxInputs() {
12024 return onnxInputs(SCHEMA, List.of(X()));
12025 }
12026
12027 public Value X() {
12028 return operands().get(0);
12029 }
12030
12031 }
12032
12033 public static HardSwish HardSwish(TypeElement resultType, Value X) {
12034 return new HardSwish(resultType, X);
12035 }
12036
12037 @OpFactoryHelper.OpDeclaration(Hardmax.NAME)
12038 public static final class Hardmax extends OnnxOp {
12039 public static final String NAME = "Hardmax";
12040
12041 public enum Attribute implements OnnxAttribute {
12042 axis(Long.class, true, -1),
12043 ;
12044
12045 final Class<?> t;
12046 final boolean optional;
12047 final Object defaultValue;
12048
12049 Attribute(Class<?> type, boolean optional, Object defaultValue) {
12050 this.t = type;
12051 this.optional = optional;
12052 this.defaultValue = defaultValue;
12053 assert optional || defaultValue == null;
12054 }
12055
12056 public Class<?> type() {
12057 return t;
12058 }
12059
12060 public boolean isOptional() {
12061 return optional;
12062 }
12063
12064 public Object defaultValue() {
12065 return defaultValue;
12066 }
12067 }
12068
12069 public enum TypeConstraint implements OnnxTypeConstraint {
12070 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
12071 ;
12072
12073 final OnnxType.TypeVariable typeVariable;
12074
12075 TypeConstraint(OnnxType.TypeVariable typeVariable) {
12076 assert typeVariable.name().equals(name());
12077 this.typeVariable = typeVariable;
12078 }
12079
12080 @Override
12081 public OnnxType.TypeVariable typeVariable() {
12082 return typeVariable;
12083 }
12084 }
12085
12086 public enum InputParameter implements OnnxParameter {
12087 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
12088 ;
12089
12090 final OnnxType type;
12091 final Quantifier quantifier;
12092
12093 InputParameter(OnnxType type, Quantifier quantifier) {
12094 this.type = type;
12095 this.quantifier = quantifier;
12096 }
12097
12098 @Override
12099 public OnnxType type() {
12100 return type;
12101 }
12102
12103 @Override
12104 public Quantifier quantifier() {
12105 return quantifier;
12106 }
12107 }
12108
12109 public enum OutputParameter implements OnnxParameter {
12110 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
12111 ;
12112
12113 final OnnxType type;
12114 final Quantifier quantifier;
12115
12116 OutputParameter(OnnxType type, Quantifier quantifier) {
12117 this.type = type;
12118 this.quantifier = quantifier;
12119 }
12120
12121 @Override
12122 public OnnxType type() {
12123 return type;
12124 }
12125
12126 @Override
12127 public Quantifier quantifier() {
12128 return quantifier;
12129 }
12130 }
12131
12132 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
12133 NAME,
12134 List.of(Attribute.values()),
12135 List.of(TypeConstraint.values()),
12136 List.of(InputParameter.values()),
12137 List.of(OutputParameter.values())
12138 );
12139
12140 public Hardmax(ExternalizedOp def) {
12141 super(SCHEMA, def);
12142 }
12143
12144 Hardmax(Hardmax that, CodeContext cc) {
12145 super(that, cc);
12146 }
12147
12148 @Override
12149 public Hardmax transform(CodeContext cc, CodeTransformer ot) {
12150 return new Hardmax(this, cc);
12151 }
12152
12153 Hardmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) {
12154 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(axis));
12155 }
12156
12157 @Override
12158 public SequencedSet<OnnxParameter> onnxOutputs() {
12159 return onnxOutputs(SCHEMA);
12160 }
12161
12162 @Override
12163 public SequencedMap<OnnxParameter, Object> onnxInputs() {
12164 return onnxInputs(SCHEMA, List.of(input()));
12165 }
12166
12167 public Value input() {
12168 return operands().get(0);
12169 }
12170
12171 public java.util.Optional<Long> axis() {
12172 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
12173 return java.util.Optional.ofNullable(axis);
12174 }
12175
12176 }
12177
12178 public static Hardmax Hardmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) {
12179 return new Hardmax(resultType, input, axis);
12180 }
12181
12182 @OpFactoryHelper.OpDeclaration(Identity.NAME)
12183 public static final class Identity extends OnnxOp {
12184 public static final String NAME = "Identity";
12185
12186 public enum Attribute implements OnnxAttribute.None { }
12187
12188 public enum TypeConstraint implements OnnxTypeConstraint {
12189 V(new OnnxType.TypeVariable("V", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0()), OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128())), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint8()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int8()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.string()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.bool()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.complex64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))), OnnxType.optional(OnnxType.tensor(OnnxType.uint8())), OnnxType.optional(OnnxType.tensor(OnnxType.uint16())), OnnxType.optional(OnnxType.tensor(OnnxType.uint32())), OnnxType.optional(OnnxType.tensor(OnnxType.uint64())), OnnxType.optional(OnnxType.tensor(OnnxType.int8())), OnnxType.optional(OnnxType.tensor(OnnxType.int16())), OnnxType.optional(OnnxType.tensor(OnnxType.int32())), OnnxType.optional(OnnxType.tensor(OnnxType.int64())), OnnxType.optional(OnnxType.tensor(OnnxType.float16())), OnnxType.optional(OnnxType.tensor(OnnxType.float32())), OnnxType.optional(OnnxType.tensor(OnnxType.float64())), OnnxType.optional(OnnxType.tensor(OnnxType.string())), OnnxType.optional(OnnxType.tensor(OnnxType.bool())), OnnxType.optional(OnnxType.tensor(OnnxType.complex64())), OnnxType.optional(OnnxType.tensor(OnnxType.complex128()))))),
12190 ;
12191
12192 final OnnxType.TypeVariable typeVariable;
12193
12194 TypeConstraint(OnnxType.TypeVariable typeVariable) {
12195 assert typeVariable.name().equals(name());
12196 this.typeVariable = typeVariable;
12197 }
12198
12199 @Override
12200 public OnnxType.TypeVariable typeVariable() {
12201 return typeVariable;
12202 }
12203 }
12204
12205 public enum InputParameter implements OnnxParameter {
12206 input(TypeConstraint.V.typeVariable(), Quantifier.REQUIRED),
12207 ;
12208
12209 final OnnxType type;
12210 final Quantifier quantifier;
12211
12212 InputParameter(OnnxType type, Quantifier quantifier) {
12213 this.type = type;
12214 this.quantifier = quantifier;
12215 }
12216
12217 @Override
12218 public OnnxType type() {
12219 return type;
12220 }
12221
12222 @Override
12223 public Quantifier quantifier() {
12224 return quantifier;
12225 }
12226 }
12227
12228 public enum OutputParameter implements OnnxParameter {
12229 output(TypeConstraint.V.typeVariable(), Quantifier.REQUIRED),
12230 ;
12231
12232 final OnnxType type;
12233 final Quantifier quantifier;
12234
12235 OutputParameter(OnnxType type, Quantifier quantifier) {
12236 this.type = type;
12237 this.quantifier = quantifier;
12238 }
12239
12240 @Override
12241 public OnnxType type() {
12242 return type;
12243 }
12244
12245 @Override
12246 public Quantifier quantifier() {
12247 return quantifier;
12248 }
12249 }
12250
12251 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
12252 NAME,
12253 List.of(Attribute.values()),
12254 List.of(TypeConstraint.values()),
12255 List.of(InputParameter.values()),
12256 List.of(OutputParameter.values())
12257 );
12258
12259 public Identity(ExternalizedOp def) {
12260 super(SCHEMA, def);
12261 }
12262
12263 Identity(Identity that, CodeContext cc) {
12264 super(that, cc);
12265 }
12266
12267 @Override
12268 public Identity transform(CodeContext cc, CodeTransformer ot) {
12269 return new Identity(this, cc);
12270 }
12271
12272 Identity(TypeElement resultType, Value input) {
12273 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
12274 }
12275
12276 @Override
12277 public SequencedSet<OnnxParameter> onnxOutputs() {
12278 return onnxOutputs(SCHEMA);
12279 }
12280
12281 @Override
12282 public SequencedMap<OnnxParameter, Object> onnxInputs() {
12283 return onnxInputs(SCHEMA, List.of(input()));
12284 }
12285
12286 public Value input() {
12287 return operands().get(0);
12288 }
12289
12290 }
12291
12292 public static Identity Identity(TypeElement resultType, Value input) {
12293 return new Identity(resultType, input);
12294 }
12295
12296 @OpFactoryHelper.OpDeclaration(ImageDecoder.NAME)
12297 public static final class ImageDecoder extends OnnxOp {
12298 public static final String NAME = "ImageDecoder";
12299
12300 public enum Attribute implements OnnxAttribute {
12301 pixel_format(String.class, true, "RGB"),
12302 ;
12303
12304 final Class<?> t;
12305 final boolean optional;
12306 final Object defaultValue;
12307
12308 Attribute(Class<?> type, boolean optional, Object defaultValue) {
12309 this.t = type;
12310 this.optional = optional;
12311 this.defaultValue = defaultValue;
12312 assert optional || defaultValue == null;
12313 }
12314
12315 public Class<?> type() {
12316 return t;
12317 }
12318
12319 public boolean isOptional() {
12320 return optional;
12321 }
12322
12323 public Object defaultValue() {
12324 return defaultValue;
12325 }
12326 }
12327
12328 public enum TypeConstraint implements OnnxTypeConstraint {
12329 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8())))),
12330 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8())))),
12331 ;
12332
12333 final OnnxType.TypeVariable typeVariable;
12334
12335 TypeConstraint(OnnxType.TypeVariable typeVariable) {
12336 assert typeVariable.name().equals(name());
12337 this.typeVariable = typeVariable;
12338 }
12339
12340 @Override
12341 public OnnxType.TypeVariable typeVariable() {
12342 return typeVariable;
12343 }
12344 }
12345
12346 public enum InputParameter implements OnnxParameter {
12347 encoded_stream(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
12348 ;
12349
12350 final OnnxType type;
12351 final Quantifier quantifier;
12352
12353 InputParameter(OnnxType type, Quantifier quantifier) {
12354 this.type = type;
12355 this.quantifier = quantifier;
12356 }
12357
12358 @Override
12359 public OnnxType type() {
12360 return type;
12361 }
12362
12363 @Override
12364 public Quantifier quantifier() {
12365 return quantifier;
12366 }
12367 }
12368
12369 public enum OutputParameter implements OnnxParameter {
12370 image(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
12371 ;
12372
12373 final OnnxType type;
12374 final Quantifier quantifier;
12375
12376 OutputParameter(OnnxType type, Quantifier quantifier) {
12377 this.type = type;
12378 this.quantifier = quantifier;
12379 }
12380
12381 @Override
12382 public OnnxType type() {
12383 return type;
12384 }
12385
12386 @Override
12387 public Quantifier quantifier() {
12388 return quantifier;
12389 }
12390 }
12391
12392 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
12393 NAME,
12394 List.of(Attribute.values()),
12395 List.of(TypeConstraint.values()),
12396 List.of(InputParameter.values()),
12397 List.of(OutputParameter.values())
12398 );
12399
12400 public ImageDecoder(ExternalizedOp def) {
12401 super(SCHEMA, def);
12402 }
12403
12404 ImageDecoder(ImageDecoder that, CodeContext cc) {
12405 super(that, cc);
12406 }
12407
12408 @Override
12409 public ImageDecoder transform(CodeContext cc, CodeTransformer ot) {
12410 return new ImageDecoder(this, cc);
12411 }
12412
12413 ImageDecoder(TypeElement resultType, Value encoded_stream, java.util.Optional<String> pixel_format) {
12414 super(SCHEMA, resultType, Set.of(), List.of(encoded_stream), List.of(pixel_format));
12415 }
12416
12417 @Override
12418 public SequencedSet<OnnxParameter> onnxOutputs() {
12419 return onnxOutputs(SCHEMA);
12420 }
12421
12422 @Override
12423 public SequencedMap<OnnxParameter, Object> onnxInputs() {
12424 return onnxInputs(SCHEMA, List.of(encoded_stream()));
12425 }
12426
12427 public Value encoded_stream() {
12428 return operands().get(0);
12429 }
12430
12431 public java.util.Optional<String> pixel_format() {
12432 String pixel_format = Attribute.pixel_format.access(String.class, onnxAttributes);
12433 return java.util.Optional.ofNullable(pixel_format);
12434 }
12435
12436 }
12437
12438 public static ImageDecoder ImageDecoder(TypeElement resultType, Value encoded_stream, java.util.Optional<String> pixel_format) {
12439 return new ImageDecoder(resultType, encoded_stream, pixel_format);
12440 }
12441
12442 @OpFactoryHelper.OpDeclaration(Imputer.NAME)
12443 public static final class Imputer extends OnnxOp {
12444 public static final String NAME = "Imputer";
12445
12446 public enum Attribute implements OnnxAttribute {
12447 replaced_value_int64(Long.class, true, 0),
12448 replaced_value_float(Float.class, true, 0.0f),
12449 imputed_value_int64s(long[].class, true, null),
12450 imputed_value_floats(float[].class, true, null),
12451 ;
12452
12453 final Class<?> t;
12454 final boolean optional;
12455 final Object defaultValue;
12456
12457 Attribute(Class<?> type, boolean optional, Object defaultValue) {
12458 this.t = type;
12459 this.optional = optional;
12460 this.defaultValue = defaultValue;
12461 assert optional || defaultValue == null;
12462 }
12463
12464 public Class<?> type() {
12465 return t;
12466 }
12467
12468 public boolean isOptional() {
12469 return optional;
12470 }
12471
12472 public Object defaultValue() {
12473 return defaultValue;
12474 }
12475 }
12476
12477 public enum TypeConstraint implements OnnxTypeConstraint {
12478 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
12479 ;
12480
12481 final OnnxType.TypeVariable typeVariable;
12482
12483 TypeConstraint(OnnxType.TypeVariable typeVariable) {
12484 assert typeVariable.name().equals(name());
12485 this.typeVariable = typeVariable;
12486 }
12487
12488 @Override
12489 public OnnxType.TypeVariable typeVariable() {
12490 return typeVariable;
12491 }
12492 }
12493
12494 public enum InputParameter implements OnnxParameter {
12495 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
12496 ;
12497
12498 final OnnxType type;
12499 final Quantifier quantifier;
12500
12501 InputParameter(OnnxType type, Quantifier quantifier) {
12502 this.type = type;
12503 this.quantifier = quantifier;
12504 }
12505
12506 @Override
12507 public OnnxType type() {
12508 return type;
12509 }
12510
12511 @Override
12512 public Quantifier quantifier() {
12513 return quantifier;
12514 }
12515 }
12516
12517 public enum OutputParameter implements OnnxParameter {
12518 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
12519 ;
12520
12521 final OnnxType type;
12522 final Quantifier quantifier;
12523
12524 OutputParameter(OnnxType type, Quantifier quantifier) {
12525 this.type = type;
12526 this.quantifier = quantifier;
12527 }
12528
12529 @Override
12530 public OnnxType type() {
12531 return type;
12532 }
12533
12534 @Override
12535 public Quantifier quantifier() {
12536 return quantifier;
12537 }
12538 }
12539
12540 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
12541 NAME,
12542 List.of(Attribute.values()),
12543 List.of(TypeConstraint.values()),
12544 List.of(InputParameter.values()),
12545 List.of(OutputParameter.values())
12546 );
12547
12548 public Imputer(ExternalizedOp def) {
12549 super(SCHEMA, def);
12550 }
12551
12552 Imputer(Imputer that, CodeContext cc) {
12553 super(that, cc);
12554 }
12555
12556 @Override
12557 public Imputer transform(CodeContext cc, CodeTransformer ot) {
12558 return new Imputer(this, cc);
12559 }
12560
12561 Imputer(TypeElement resultType, Value X, java.util.Optional<Long> replaced_value_int64, java.util.Optional<Float> replaced_value_float, java.util.Optional<long[]> imputed_value_int64s, java.util.Optional<float[]> imputed_value_floats) {
12562 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(replaced_value_int64, replaced_value_float, imputed_value_int64s, imputed_value_floats));
12563 }
12564
12565 @Override
12566 public SequencedSet<OnnxParameter> onnxOutputs() {
12567 return onnxOutputs(SCHEMA);
12568 }
12569
12570 @Override
12571 public SequencedMap<OnnxParameter, Object> onnxInputs() {
12572 return onnxInputs(SCHEMA, List.of(X()));
12573 }
12574
12575 public Value X() {
12576 return operands().get(0);
12577 }
12578
12579 public java.util.Optional<Long> replaced_value_int64() {
12580 Long replaced_value_int64 = Attribute.replaced_value_int64.access(Long.class, onnxAttributes);
12581 return java.util.Optional.ofNullable(replaced_value_int64);
12582 }
12583
12584 public java.util.Optional<Float> replaced_value_float() {
12585 Float replaced_value_float = Attribute.replaced_value_float.access(Float.class, onnxAttributes);
12586 return java.util.Optional.ofNullable(replaced_value_float);
12587 }
12588
12589 public java.util.Optional<long[]> imputed_value_int64s() {
12590 long[] imputed_value_int64s = Attribute.imputed_value_int64s.access(long[].class, onnxAttributes);
12591 return java.util.Optional.ofNullable(imputed_value_int64s).map(long[]::clone);
12592 }
12593
12594 public java.util.Optional<float[]> imputed_value_floats() {
12595 float[] imputed_value_floats = Attribute.imputed_value_floats.access(float[].class, onnxAttributes);
12596 return java.util.Optional.ofNullable(imputed_value_floats).map(float[]::clone);
12597 }
12598
12599 }
12600
12601 public static Imputer Imputer(TypeElement resultType, Value X, java.util.Optional<Long> replaced_value_int64, java.util.Optional<Float> replaced_value_float, java.util.Optional<long[]> imputed_value_int64s, java.util.Optional<float[]> imputed_value_floats) {
12602 return new Imputer(resultType, X, replaced_value_int64, replaced_value_float, imputed_value_int64s, imputed_value_floats);
12603 }
12604
12605 @OpFactoryHelper.OpDeclaration(InstanceNormalization.NAME)
12606 public static final class InstanceNormalization extends OnnxOp {
12607 public static final String NAME = "InstanceNormalization";
12608
12609 public enum Attribute implements OnnxAttribute {
12610 epsilon(Float.class, true, 1.0E-5f),
12611 ;
12612
12613 final Class<?> t;
12614 final boolean optional;
12615 final Object defaultValue;
12616
12617 Attribute(Class<?> type, boolean optional, Object defaultValue) {
12618 this.t = type;
12619 this.optional = optional;
12620 this.defaultValue = defaultValue;
12621 assert optional || defaultValue == null;
12622 }
12623
12624 public Class<?> type() {
12625 return t;
12626 }
12627
12628 public boolean isOptional() {
12629 return optional;
12630 }
12631
12632 public Object defaultValue() {
12633 return defaultValue;
12634 }
12635 }
12636
12637 public enum TypeConstraint implements OnnxTypeConstraint {
12638 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
12639 ;
12640
12641 final OnnxType.TypeVariable typeVariable;
12642
12643 TypeConstraint(OnnxType.TypeVariable typeVariable) {
12644 assert typeVariable.name().equals(name());
12645 this.typeVariable = typeVariable;
12646 }
12647
12648 @Override
12649 public OnnxType.TypeVariable typeVariable() {
12650 return typeVariable;
12651 }
12652 }
12653
12654 public enum InputParameter implements OnnxParameter {
12655 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
12656 scale(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
12657 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
12658 ;
12659
12660 final OnnxType type;
12661 final Quantifier quantifier;
12662
12663 InputParameter(OnnxType type, Quantifier quantifier) {
12664 this.type = type;
12665 this.quantifier = quantifier;
12666 }
12667
12668 @Override
12669 public OnnxType type() {
12670 return type;
12671 }
12672
12673 @Override
12674 public Quantifier quantifier() {
12675 return quantifier;
12676 }
12677 }
12678
12679 public enum OutputParameter implements OnnxParameter {
12680 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
12681 ;
12682
12683 final OnnxType type;
12684 final Quantifier quantifier;
12685
12686 OutputParameter(OnnxType type, Quantifier quantifier) {
12687 this.type = type;
12688 this.quantifier = quantifier;
12689 }
12690
12691 @Override
12692 public OnnxType type() {
12693 return type;
12694 }
12695
12696 @Override
12697 public Quantifier quantifier() {
12698 return quantifier;
12699 }
12700 }
12701
12702 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
12703 NAME,
12704 List.of(Attribute.values()),
12705 List.of(TypeConstraint.values()),
12706 List.of(InputParameter.values()),
12707 List.of(OutputParameter.values())
12708 );
12709
12710 public InstanceNormalization(ExternalizedOp def) {
12711 super(SCHEMA, def);
12712 }
12713
12714 InstanceNormalization(InstanceNormalization that, CodeContext cc) {
12715 super(that, cc);
12716 }
12717
12718 @Override
12719 public InstanceNormalization transform(CodeContext cc, CodeTransformer ot) {
12720 return new InstanceNormalization(this, cc);
12721 }
12722
12723 InstanceNormalization(TypeElement resultType, Value input, Value scale, Value B, java.util.Optional<Float> epsilon) {
12724 super(SCHEMA, resultType, Set.of(), List.of(input, scale, B), List.of(epsilon));
12725 }
12726
12727 @Override
12728 public SequencedSet<OnnxParameter> onnxOutputs() {
12729 return onnxOutputs(SCHEMA);
12730 }
12731
12732 @Override
12733 public SequencedMap<OnnxParameter, Object> onnxInputs() {
12734 return onnxInputs(SCHEMA, List.of(input(), scale(), B()));
12735 }
12736
12737 public Value input() {
12738 return operands().get(0);
12739 }
12740
12741 public Value scale() {
12742 return operands().get(1);
12743 }
12744
12745 public Value B() {
12746 return operands().get(2);
12747 }
12748
12749 public java.util.Optional<Float> epsilon() {
12750 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes);
12751 return java.util.Optional.ofNullable(epsilon);
12752 }
12753
12754 }
12755
12756 public static InstanceNormalization InstanceNormalization(TypeElement resultType, Value input, Value scale, Value B, java.util.Optional<Float> epsilon) {
12757 return new InstanceNormalization(resultType, input, scale, B, epsilon);
12758 }
12759
12760 @OpFactoryHelper.OpDeclaration(IsInf.NAME)
12761 public static final class IsInf extends OnnxOp {
12762 public static final String NAME = "IsInf";
12763
12764 public enum Attribute implements OnnxAttribute {
12765 detect_negative(Long.class, true, 1),
12766 detect_positive(Long.class, true, 1),
12767 ;
12768
12769 final Class<?> t;
12770 final boolean optional;
12771 final Object defaultValue;
12772
12773 Attribute(Class<?> type, boolean optional, Object defaultValue) {
12774 this.t = type;
12775 this.optional = optional;
12776 this.defaultValue = defaultValue;
12777 assert optional || defaultValue == null;
12778 }
12779
12780 public Class<?> type() {
12781 return t;
12782 }
12783
12784 public boolean isOptional() {
12785 return optional;
12786 }
12787
12788 public Object defaultValue() {
12789 return defaultValue;
12790 }
12791 }
12792
12793 public enum TypeConstraint implements OnnxTypeConstraint {
12794 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz())))),
12795 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bool())))),
12796 ;
12797
12798 final OnnxType.TypeVariable typeVariable;
12799
12800 TypeConstraint(OnnxType.TypeVariable typeVariable) {
12801 assert typeVariable.name().equals(name());
12802 this.typeVariable = typeVariable;
12803 }
12804
12805 @Override
12806 public OnnxType.TypeVariable typeVariable() {
12807 return typeVariable;
12808 }
12809 }
12810
12811 public enum InputParameter implements OnnxParameter {
12812 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
12813 ;
12814
12815 final OnnxType type;
12816 final Quantifier quantifier;
12817
12818 InputParameter(OnnxType type, Quantifier quantifier) {
12819 this.type = type;
12820 this.quantifier = quantifier;
12821 }
12822
12823 @Override
12824 public OnnxType type() {
12825 return type;
12826 }
12827
12828 @Override
12829 public Quantifier quantifier() {
12830 return quantifier;
12831 }
12832 }
12833
12834 public enum OutputParameter implements OnnxParameter {
12835 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
12836 ;
12837
12838 final OnnxType type;
12839 final Quantifier quantifier;
12840
12841 OutputParameter(OnnxType type, Quantifier quantifier) {
12842 this.type = type;
12843 this.quantifier = quantifier;
12844 }
12845
12846 @Override
12847 public OnnxType type() {
12848 return type;
12849 }
12850
12851 @Override
12852 public Quantifier quantifier() {
12853 return quantifier;
12854 }
12855 }
12856
12857 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
12858 NAME,
12859 List.of(Attribute.values()),
12860 List.of(TypeConstraint.values()),
12861 List.of(InputParameter.values()),
12862 List.of(OutputParameter.values())
12863 );
12864
12865 public IsInf(ExternalizedOp def) {
12866 super(SCHEMA, def);
12867 }
12868
12869 IsInf(IsInf that, CodeContext cc) {
12870 super(that, cc);
12871 }
12872
12873 @Override
12874 public IsInf transform(CodeContext cc, CodeTransformer ot) {
12875 return new IsInf(this, cc);
12876 }
12877
12878 IsInf(TypeElement resultType, Value X, java.util.Optional<Long> detect_negative, java.util.Optional<Long> detect_positive) {
12879 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(detect_negative, detect_positive));
12880 }
12881
12882 @Override
12883 public SequencedSet<OnnxParameter> onnxOutputs() {
12884 return onnxOutputs(SCHEMA);
12885 }
12886
12887 @Override
12888 public SequencedMap<OnnxParameter, Object> onnxInputs() {
12889 return onnxInputs(SCHEMA, List.of(X()));
12890 }
12891
12892 public Value X() {
12893 return operands().get(0);
12894 }
12895
12896 public java.util.Optional<Long> detect_negative() {
12897 Long detect_negative = Attribute.detect_negative.access(Long.class, onnxAttributes);
12898 return java.util.Optional.ofNullable(detect_negative);
12899 }
12900
12901 public java.util.Optional<Long> detect_positive() {
12902 Long detect_positive = Attribute.detect_positive.access(Long.class, onnxAttributes);
12903 return java.util.Optional.ofNullable(detect_positive);
12904 }
12905
12906 }
12907
12908 public static IsInf IsInf(TypeElement resultType, Value X, java.util.Optional<Long> detect_negative, java.util.Optional<Long> detect_positive) {
12909 return new IsInf(resultType, X, detect_negative, detect_positive);
12910 }
12911
12912 @OpFactoryHelper.OpDeclaration(IsNaN.NAME)
12913 public static final class IsNaN extends OnnxOp {
12914 public static final String NAME = "IsNaN";
12915
12916 public enum Attribute implements OnnxAttribute.None { }
12917
12918 public enum TypeConstraint implements OnnxTypeConstraint {
12919 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz())))),
12920 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bool())))),
12921 ;
12922
12923 final OnnxType.TypeVariable typeVariable;
12924
12925 TypeConstraint(OnnxType.TypeVariable typeVariable) {
12926 assert typeVariable.name().equals(name());
12927 this.typeVariable = typeVariable;
12928 }
12929
12930 @Override
12931 public OnnxType.TypeVariable typeVariable() {
12932 return typeVariable;
12933 }
12934 }
12935
12936 public enum InputParameter implements OnnxParameter {
12937 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
12938 ;
12939
12940 final OnnxType type;
12941 final Quantifier quantifier;
12942
12943 InputParameter(OnnxType type, Quantifier quantifier) {
12944 this.type = type;
12945 this.quantifier = quantifier;
12946 }
12947
12948 @Override
12949 public OnnxType type() {
12950 return type;
12951 }
12952
12953 @Override
12954 public Quantifier quantifier() {
12955 return quantifier;
12956 }
12957 }
12958
12959 public enum OutputParameter implements OnnxParameter {
12960 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
12961 ;
12962
12963 final OnnxType type;
12964 final Quantifier quantifier;
12965
12966 OutputParameter(OnnxType type, Quantifier quantifier) {
12967 this.type = type;
12968 this.quantifier = quantifier;
12969 }
12970
12971 @Override
12972 public OnnxType type() {
12973 return type;
12974 }
12975
12976 @Override
12977 public Quantifier quantifier() {
12978 return quantifier;
12979 }
12980 }
12981
12982 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
12983 NAME,
12984 List.of(Attribute.values()),
12985 List.of(TypeConstraint.values()),
12986 List.of(InputParameter.values()),
12987 List.of(OutputParameter.values())
12988 );
12989
12990 public IsNaN(ExternalizedOp def) {
12991 super(SCHEMA, def);
12992 }
12993
12994 IsNaN(IsNaN that, CodeContext cc) {
12995 super(that, cc);
12996 }
12997
12998 @Override
12999 public IsNaN transform(CodeContext cc, CodeTransformer ot) {
13000 return new IsNaN(this, cc);
13001 }
13002
13003 IsNaN(TypeElement resultType, Value X) {
13004 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
13005 }
13006
13007 @Override
13008 public SequencedSet<OnnxParameter> onnxOutputs() {
13009 return onnxOutputs(SCHEMA);
13010 }
13011
13012 @Override
13013 public SequencedMap<OnnxParameter, Object> onnxInputs() {
13014 return onnxInputs(SCHEMA, List.of(X()));
13015 }
13016
13017 public Value X() {
13018 return operands().get(0);
13019 }
13020
13021 }
13022
13023 public static IsNaN IsNaN(TypeElement resultType, Value X) {
13024 return new IsNaN(resultType, X);
13025 }
13026
13027 @OpFactoryHelper.OpDeclaration(LRN.NAME)
13028 public static final class LRN extends OnnxOp {
13029 public static final String NAME = "LRN";
13030
13031 public enum Attribute implements OnnxAttribute {
13032 size(Long.class, false, null),
13033 alpha(Float.class, true, 1.0E-4f),
13034 bias(Float.class, true, 1.0f),
13035 beta(Float.class, true, 0.75f),
13036 ;
13037
13038 final Class<?> t;
13039 final boolean optional;
13040 final Object defaultValue;
13041
13042 Attribute(Class<?> type, boolean optional, Object defaultValue) {
13043 this.t = type;
13044 this.optional = optional;
13045 this.defaultValue = defaultValue;
13046 assert optional || defaultValue == null;
13047 }
13048
13049 public Class<?> type() {
13050 return t;
13051 }
13052
13053 public boolean isOptional() {
13054 return optional;
13055 }
13056
13057 public Object defaultValue() {
13058 return defaultValue;
13059 }
13060 }
13061
13062 public enum TypeConstraint implements OnnxTypeConstraint {
13063 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
13064 ;
13065
13066 final OnnxType.TypeVariable typeVariable;
13067
13068 TypeConstraint(OnnxType.TypeVariable typeVariable) {
13069 assert typeVariable.name().equals(name());
13070 this.typeVariable = typeVariable;
13071 }
13072
13073 @Override
13074 public OnnxType.TypeVariable typeVariable() {
13075 return typeVariable;
13076 }
13077 }
13078
13079 public enum InputParameter implements OnnxParameter {
13080 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13081 ;
13082
13083 final OnnxType type;
13084 final Quantifier quantifier;
13085
13086 InputParameter(OnnxType type, Quantifier quantifier) {
13087 this.type = type;
13088 this.quantifier = quantifier;
13089 }
13090
13091 @Override
13092 public OnnxType type() {
13093 return type;
13094 }
13095
13096 @Override
13097 public Quantifier quantifier() {
13098 return quantifier;
13099 }
13100 }
13101
13102 public enum OutputParameter implements OnnxParameter {
13103 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13104 ;
13105
13106 final OnnxType type;
13107 final Quantifier quantifier;
13108
13109 OutputParameter(OnnxType type, Quantifier quantifier) {
13110 this.type = type;
13111 this.quantifier = quantifier;
13112 }
13113
13114 @Override
13115 public OnnxType type() {
13116 return type;
13117 }
13118
13119 @Override
13120 public Quantifier quantifier() {
13121 return quantifier;
13122 }
13123 }
13124
13125 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
13126 NAME,
13127 List.of(Attribute.values()),
13128 List.of(TypeConstraint.values()),
13129 List.of(InputParameter.values()),
13130 List.of(OutputParameter.values())
13131 );
13132
13133 public LRN(ExternalizedOp def) {
13134 super(SCHEMA, def);
13135 }
13136
13137 LRN(LRN that, CodeContext cc) {
13138 super(that, cc);
13139 }
13140
13141 @Override
13142 public LRN transform(CodeContext cc, CodeTransformer ot) {
13143 return new LRN(this, cc);
13144 }
13145
13146 LRN(TypeElement resultType, Value X, long size, java.util.Optional<Float> alpha, java.util.Optional<Float> bias, java.util.Optional<Float> beta) {
13147 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(size, alpha, bias, beta));
13148 }
13149
13150 @Override
13151 public SequencedSet<OnnxParameter> onnxOutputs() {
13152 return onnxOutputs(SCHEMA);
13153 }
13154
13155 @Override
13156 public SequencedMap<OnnxParameter, Object> onnxInputs() {
13157 return onnxInputs(SCHEMA, List.of(X()));
13158 }
13159
13160 public Value X() {
13161 return operands().get(0);
13162 }
13163
13164 public long size() {
13165 long size = Attribute.size.access(Long.class, onnxAttributes);
13166 return size;
13167 }
13168
13169 public java.util.Optional<Float> alpha() {
13170 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
13171 return java.util.Optional.ofNullable(alpha);
13172 }
13173
13174 public java.util.Optional<Float> bias() {
13175 Float bias = Attribute.bias.access(Float.class, onnxAttributes);
13176 return java.util.Optional.ofNullable(bias);
13177 }
13178
13179 public java.util.Optional<Float> beta() {
13180 Float beta = Attribute.beta.access(Float.class, onnxAttributes);
13181 return java.util.Optional.ofNullable(beta);
13182 }
13183
13184 }
13185
13186 public static LRN LRN(TypeElement resultType, Value X, long size, java.util.Optional<Float> alpha, java.util.Optional<Float> bias, java.util.Optional<Float> beta) {
13187 return new LRN(resultType, X, size, alpha, bias, beta);
13188 }
13189
13190 @OpFactoryHelper.OpDeclaration(LSTM.NAME)
13191 public static final class LSTM extends OnnxOp {
13192 public static final String NAME = "LSTM";
13193
13194 public enum Attribute implements OnnxAttribute {
13195 layout(Long.class, true, 0),
13196 input_forget(Long.class, true, 0),
13197 activation_alpha(float[].class, true, null),
13198 hidden_size(Long.class, true, null),
13199 activation_beta(float[].class, true, null),
13200 activations(String[].class, true, null),
13201 clip(Float.class, true, null),
13202 direction(String.class, true, "forward"),
13203 ;
13204
13205 final Class<?> t;
13206 final boolean optional;
13207 final Object defaultValue;
13208
13209 Attribute(Class<?> type, boolean optional, Object defaultValue) {
13210 this.t = type;
13211 this.optional = optional;
13212 this.defaultValue = defaultValue;
13213 assert optional || defaultValue == null;
13214 }
13215
13216 public Class<?> type() {
13217 return t;
13218 }
13219
13220 public boolean isOptional() {
13221 return optional;
13222 }
13223
13224 public Object defaultValue() {
13225 return defaultValue;
13226 }
13227 }
13228
13229 public enum TypeConstraint implements OnnxTypeConstraint {
13230 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
13231 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32())))),
13232 ;
13233
13234 final OnnxType.TypeVariable typeVariable;
13235
13236 TypeConstraint(OnnxType.TypeVariable typeVariable) {
13237 assert typeVariable.name().equals(name());
13238 this.typeVariable = typeVariable;
13239 }
13240
13241 @Override
13242 public OnnxType.TypeVariable typeVariable() {
13243 return typeVariable;
13244 }
13245 }
13246
13247 public enum InputParameter implements OnnxParameter {
13248 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13249 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13250 R(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13251 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
13252 sequence_lens(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
13253 initial_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
13254 initial_c(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
13255 P(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
13256 ;
13257
13258 final OnnxType type;
13259 final Quantifier quantifier;
13260
13261 InputParameter(OnnxType type, Quantifier quantifier) {
13262 this.type = type;
13263 this.quantifier = quantifier;
13264 }
13265
13266 @Override
13267 public OnnxType type() {
13268 return type;
13269 }
13270
13271 @Override
13272 public Quantifier quantifier() {
13273 return quantifier;
13274 }
13275 }
13276
13277 public enum OutputParameter implements OnnxParameter {
13278 Y(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
13279 Y_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
13280 Y_c(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
13281 ;
13282
13283 final OnnxType type;
13284 final Quantifier quantifier;
13285
13286 OutputParameter(OnnxType type, Quantifier quantifier) {
13287 this.type = type;
13288 this.quantifier = quantifier;
13289 }
13290
13291 @Override
13292 public OnnxType type() {
13293 return type;
13294 }
13295
13296 @Override
13297 public Quantifier quantifier() {
13298 return quantifier;
13299 }
13300 }
13301
13302 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
13303 NAME,
13304 List.of(Attribute.values()),
13305 List.of(TypeConstraint.values()),
13306 List.of(InputParameter.values()),
13307 List.of(OutputParameter.values())
13308 );
13309
13310 public LSTM(ExternalizedOp def) {
13311 super(SCHEMA, def);
13312 }
13313
13314 LSTM(LSTM that, CodeContext cc) {
13315 super(that, cc);
13316 }
13317
13318 @Override
13319 public LSTM transform(CodeContext cc, CodeTransformer ot) {
13320 return new LSTM(this, cc);
13321 }
13322
13323 LSTM(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value X, Value W, Value R, java.util.Optional<Value> B, java.util.Optional<Value> sequence_lens, java.util.Optional<Value> initial_h, java.util.Optional<Value> initial_c, java.util.Optional<Value> P, java.util.Optional<Long> layout, java.util.Optional<Long> input_forget, java.util.Optional<float[]> activation_alpha, java.util.Optional<Long> hidden_size, java.util.Optional<float[]> activation_beta, java.util.Optional<String[]> activations, java.util.Optional<Float> clip, java.util.Optional<String> direction) {
13324 super(SCHEMA, resultType, optionalOutputs, List.of(X, W, R, B, sequence_lens, initial_h, initial_c, P), List.of(layout, input_forget, activation_alpha, hidden_size, activation_beta, activations, clip, direction));
13325 }
13326
13327 @Override
13328 public SequencedSet<OnnxParameter> onnxOutputs() {
13329 return onnxOutputs(SCHEMA);
13330 }
13331
13332 @Override
13333 public SequencedMap<OnnxParameter, Object> onnxInputs() {
13334 return onnxInputs(SCHEMA, List.of(X(), W(), R(), B(), sequence_lens(), initial_h(), initial_c(), P()));
13335 }
13336
13337 public Value X() {
13338 return operands().get(0);
13339 }
13340
13341 public Value W() {
13342 return operands().get(1);
13343 }
13344
13345 public Value R() {
13346 return operands().get(2);
13347 }
13348
13349 public java.util.Optional<Value> B() {
13350 int i = optionalInputArguments.indexOf(InputParameter.B);
13351 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
13352 }
13353
13354 public java.util.Optional<Value> sequence_lens() {
13355 int i = optionalInputArguments.indexOf(InputParameter.sequence_lens);
13356 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
13357 }
13358
13359 public java.util.Optional<Value> initial_h() {
13360 int i = optionalInputArguments.indexOf(InputParameter.initial_h);
13361 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
13362 }
13363
13364 public java.util.Optional<Value> initial_c() {
13365 int i = optionalInputArguments.indexOf(InputParameter.initial_c);
13366 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
13367 }
13368
13369 public java.util.Optional<Value> P() {
13370 int i = optionalInputArguments.indexOf(InputParameter.P);
13371 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
13372 }
13373
13374 public java.util.Optional<Long> layout() {
13375 Long layout = Attribute.layout.access(Long.class, onnxAttributes);
13376 return java.util.Optional.ofNullable(layout);
13377 }
13378
13379 public java.util.Optional<Long> input_forget() {
13380 Long input_forget = Attribute.input_forget.access(Long.class, onnxAttributes);
13381 return java.util.Optional.ofNullable(input_forget);
13382 }
13383
13384 public java.util.Optional<float[]> activation_alpha() {
13385 float[] activation_alpha = Attribute.activation_alpha.access(float[].class, onnxAttributes);
13386 return java.util.Optional.ofNullable(activation_alpha).map(float[]::clone);
13387 }
13388
13389 public java.util.Optional<Long> hidden_size() {
13390 Long hidden_size = Attribute.hidden_size.access(Long.class, onnxAttributes);
13391 return java.util.Optional.ofNullable(hidden_size);
13392 }
13393
13394 public java.util.Optional<float[]> activation_beta() {
13395 float[] activation_beta = Attribute.activation_beta.access(float[].class, onnxAttributes);
13396 return java.util.Optional.ofNullable(activation_beta).map(float[]::clone);
13397 }
13398
13399 public java.util.Optional<String[]> activations() {
13400 String[] activations = Attribute.activations.access(String[].class, onnxAttributes);
13401 return java.util.Optional.ofNullable(activations).map(String[]::clone);
13402 }
13403
13404 public java.util.Optional<Float> clip() {
13405 Float clip = Attribute.clip.access(Float.class, onnxAttributes);
13406 return java.util.Optional.ofNullable(clip);
13407 }
13408
13409 public java.util.Optional<String> direction() {
13410 String direction = Attribute.direction.access(String.class, onnxAttributes);
13411 return java.util.Optional.ofNullable(direction);
13412 }
13413
13414 }
13415
13416 public static LSTM LSTM(TypeElement resultType, Set<LSTM.OutputParameter> optionalOutputs, Value X, Value W, Value R, java.util.Optional<Value> B, java.util.Optional<Value> sequence_lens, java.util.Optional<Value> initial_h, java.util.Optional<Value> initial_c, java.util.Optional<Value> P, java.util.Optional<Long> layout, java.util.Optional<Long> input_forget, java.util.Optional<float[]> activation_alpha, java.util.Optional<Long> hidden_size, java.util.Optional<float[]> activation_beta, java.util.Optional<String[]> activations, java.util.Optional<Float> clip, java.util.Optional<String> direction) {
13417 return new LSTM(resultType, optionalOutputs, X, W, R, B, sequence_lens, initial_h, initial_c, P, layout, input_forget, activation_alpha, hidden_size, activation_beta, activations, clip, direction);
13418 }
13419
13420 @OpFactoryHelper.OpDeclaration(LabelEncoder.NAME)
13421 public static final class LabelEncoder extends OnnxOp {
13422 public static final String NAME = "LabelEncoder";
13423
13424 public enum Attribute implements OnnxAttribute {
13425 values_strings(String[].class, true, null),
13426 keys_int64s(long[].class, true, null),
13427 keys_tensor(Tensor.class, true, null),
13428 keys_strings(String[].class, true, null),
13429 default_float(Float.class, true, -0.0f),
13430 keys_floats(float[].class, true, null),
13431 default_tensor(Tensor.class, true, null),
13432 default_int64(Long.class, true, -1),
13433 values_tensor(Tensor.class, true, null),
13434 values_int64s(long[].class, true, null),
13435 default_string(String.class, true, "_Unused"),
13436 values_floats(float[].class, true, null),
13437 ;
13438
13439 final Class<?> t;
13440 final boolean optional;
13441 final Object defaultValue;
13442
13443 Attribute(Class<?> type, boolean optional, Object defaultValue) {
13444 this.t = type;
13445 this.optional = optional;
13446 this.defaultValue = defaultValue;
13447 assert optional || defaultValue == null;
13448 }
13449
13450 public Class<?> type() {
13451 return t;
13452 }
13453
13454 public boolean isOptional() {
13455 return optional;
13456 }
13457
13458 public Object defaultValue() {
13459 return defaultValue;
13460 }
13461 }
13462
13463 public enum TypeConstraint implements OnnxTypeConstraint {
13464 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.float64())))),
13465 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.float64())))),
13466 ;
13467
13468 final OnnxType.TypeVariable typeVariable;
13469
13470 TypeConstraint(OnnxType.TypeVariable typeVariable) {
13471 assert typeVariable.name().equals(name());
13472 this.typeVariable = typeVariable;
13473 }
13474
13475 @Override
13476 public OnnxType.TypeVariable typeVariable() {
13477 return typeVariable;
13478 }
13479 }
13480
13481 public enum InputParameter implements OnnxParameter {
13482 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
13483 ;
13484
13485 final OnnxType type;
13486 final Quantifier quantifier;
13487
13488 InputParameter(OnnxType type, Quantifier quantifier) {
13489 this.type = type;
13490 this.quantifier = quantifier;
13491 }
13492
13493 @Override
13494 public OnnxType type() {
13495 return type;
13496 }
13497
13498 @Override
13499 public Quantifier quantifier() {
13500 return quantifier;
13501 }
13502 }
13503
13504 public enum OutputParameter implements OnnxParameter {
13505 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
13506 ;
13507
13508 final OnnxType type;
13509 final Quantifier quantifier;
13510
13511 OutputParameter(OnnxType type, Quantifier quantifier) {
13512 this.type = type;
13513 this.quantifier = quantifier;
13514 }
13515
13516 @Override
13517 public OnnxType type() {
13518 return type;
13519 }
13520
13521 @Override
13522 public Quantifier quantifier() {
13523 return quantifier;
13524 }
13525 }
13526
13527 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
13528 NAME,
13529 List.of(Attribute.values()),
13530 List.of(TypeConstraint.values()),
13531 List.of(InputParameter.values()),
13532 List.of(OutputParameter.values())
13533 );
13534
13535 public LabelEncoder(ExternalizedOp def) {
13536 super(SCHEMA, def);
13537 }
13538
13539 LabelEncoder(LabelEncoder that, CodeContext cc) {
13540 super(that, cc);
13541 }
13542
13543 @Override
13544 public LabelEncoder transform(CodeContext cc, CodeTransformer ot) {
13545 return new LabelEncoder(this, cc);
13546 }
13547
13548 LabelEncoder(TypeElement resultType, Value X, java.util.Optional<String[]> values_strings, java.util.Optional<long[]> keys_int64s, java.util.Optional<Tensor> keys_tensor, java.util.Optional<String[]> keys_strings, java.util.Optional<Float> default_float, java.util.Optional<float[]> keys_floats, java.util.Optional<Tensor> default_tensor, java.util.Optional<Long> default_int64, java.util.Optional<Tensor> values_tensor, java.util.Optional<long[]> values_int64s, java.util.Optional<String> default_string, java.util.Optional<float[]> values_floats) {
13549 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(values_strings, keys_int64s, keys_tensor, keys_strings, default_float, keys_floats, default_tensor, default_int64, values_tensor, values_int64s, default_string, values_floats));
13550 }
13551
13552 @Override
13553 public SequencedSet<OnnxParameter> onnxOutputs() {
13554 return onnxOutputs(SCHEMA);
13555 }
13556
13557 @Override
13558 public SequencedMap<OnnxParameter, Object> onnxInputs() {
13559 return onnxInputs(SCHEMA, List.of(X()));
13560 }
13561
13562 public Value X() {
13563 return operands().get(0);
13564 }
13565
13566 public java.util.Optional<String[]> values_strings() {
13567 String[] values_strings = Attribute.values_strings.access(String[].class, onnxAttributes);
13568 return java.util.Optional.ofNullable(values_strings).map(String[]::clone);
13569 }
13570
13571 public java.util.Optional<long[]> keys_int64s() {
13572 long[] keys_int64s = Attribute.keys_int64s.access(long[].class, onnxAttributes);
13573 return java.util.Optional.ofNullable(keys_int64s).map(long[]::clone);
13574 }
13575
13576 public java.util.Optional<Tensor> keys_tensor() {
13577 Tensor keys_tensor = Attribute.keys_tensor.access(Tensor.class, onnxAttributes);
13578 return java.util.Optional.ofNullable(keys_tensor);
13579 }
13580
13581 public java.util.Optional<String[]> keys_strings() {
13582 String[] keys_strings = Attribute.keys_strings.access(String[].class, onnxAttributes);
13583 return java.util.Optional.ofNullable(keys_strings).map(String[]::clone);
13584 }
13585
13586 public java.util.Optional<Float> default_float() {
13587 Float default_float = Attribute.default_float.access(Float.class, onnxAttributes);
13588 return java.util.Optional.ofNullable(default_float);
13589 }
13590
13591 public java.util.Optional<float[]> keys_floats() {
13592 float[] keys_floats = Attribute.keys_floats.access(float[].class, onnxAttributes);
13593 return java.util.Optional.ofNullable(keys_floats).map(float[]::clone);
13594 }
13595
13596 public java.util.Optional<Tensor> default_tensor() {
13597 Tensor default_tensor = Attribute.default_tensor.access(Tensor.class, onnxAttributes);
13598 return java.util.Optional.ofNullable(default_tensor);
13599 }
13600
13601 public java.util.Optional<Long> default_int64() {
13602 Long default_int64 = Attribute.default_int64.access(Long.class, onnxAttributes);
13603 return java.util.Optional.ofNullable(default_int64);
13604 }
13605
13606 public java.util.Optional<Tensor> values_tensor() {
13607 Tensor values_tensor = Attribute.values_tensor.access(Tensor.class, onnxAttributes);
13608 return java.util.Optional.ofNullable(values_tensor);
13609 }
13610
13611 public java.util.Optional<long[]> values_int64s() {
13612 long[] values_int64s = Attribute.values_int64s.access(long[].class, onnxAttributes);
13613 return java.util.Optional.ofNullable(values_int64s).map(long[]::clone);
13614 }
13615
13616 public java.util.Optional<String> default_string() {
13617 String default_string = Attribute.default_string.access(String.class, onnxAttributes);
13618 return java.util.Optional.ofNullable(default_string);
13619 }
13620
13621 public java.util.Optional<float[]> values_floats() {
13622 float[] values_floats = Attribute.values_floats.access(float[].class, onnxAttributes);
13623 return java.util.Optional.ofNullable(values_floats).map(float[]::clone);
13624 }
13625
13626 }
13627
13628 public static LabelEncoder LabelEncoder(TypeElement resultType, Value X, java.util.Optional<String[]> values_strings, java.util.Optional<long[]> keys_int64s, java.util.Optional<Tensor> keys_tensor, java.util.Optional<String[]> keys_strings, java.util.Optional<Float> default_float, java.util.Optional<float[]> keys_floats, java.util.Optional<Tensor> default_tensor, java.util.Optional<Long> default_int64, java.util.Optional<Tensor> values_tensor, java.util.Optional<long[]> values_int64s, java.util.Optional<String> default_string, java.util.Optional<float[]> values_floats) {
13629 return new LabelEncoder(resultType, X, values_strings, keys_int64s, keys_tensor, keys_strings, default_float, keys_floats, default_tensor, default_int64, values_tensor, values_int64s, default_string, values_floats);
13630 }
13631
13632 @OpFactoryHelper.OpDeclaration(LayerNormalization.NAME)
13633 public static final class LayerNormalization extends OnnxOp {
13634 public static final String NAME = "LayerNormalization";
13635
13636 public enum Attribute implements OnnxAttribute {
13637 epsilon(Float.class, true, 1.0E-5f),
13638 stash_type(Long.class, true, 1),
13639 axis(Long.class, true, -1),
13640 ;
13641
13642 final Class<?> t;
13643 final boolean optional;
13644 final Object defaultValue;
13645
13646 Attribute(Class<?> type, boolean optional, Object defaultValue) {
13647 this.t = type;
13648 this.optional = optional;
13649 this.defaultValue = defaultValue;
13650 assert optional || defaultValue == null;
13651 }
13652
13653 public Class<?> type() {
13654 return t;
13655 }
13656
13657 public boolean isOptional() {
13658 return optional;
13659 }
13660
13661 public Object defaultValue() {
13662 return defaultValue;
13663 }
13664 }
13665
13666 public enum TypeConstraint implements OnnxTypeConstraint {
13667 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
13668 U(new OnnxType.TypeVariable("U", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.bfloat16())))),
13669 ;
13670
13671 final OnnxType.TypeVariable typeVariable;
13672
13673 TypeConstraint(OnnxType.TypeVariable typeVariable) {
13674 assert typeVariable.name().equals(name());
13675 this.typeVariable = typeVariable;
13676 }
13677
13678 @Override
13679 public OnnxType.TypeVariable typeVariable() {
13680 return typeVariable;
13681 }
13682 }
13683
13684 public enum InputParameter implements OnnxParameter {
13685 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13686 Scale(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13687 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
13688 ;
13689
13690 final OnnxType type;
13691 final Quantifier quantifier;
13692
13693 InputParameter(OnnxType type, Quantifier quantifier) {
13694 this.type = type;
13695 this.quantifier = quantifier;
13696 }
13697
13698 @Override
13699 public OnnxType type() {
13700 return type;
13701 }
13702
13703 @Override
13704 public Quantifier quantifier() {
13705 return quantifier;
13706 }
13707 }
13708
13709 public enum OutputParameter implements OnnxParameter {
13710 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13711 Mean(TypeConstraint.U.typeVariable(), Quantifier.OPTIONAL),
13712 InvStdDev(TypeConstraint.U.typeVariable(), Quantifier.OPTIONAL),
13713 ;
13714
13715 final OnnxType type;
13716 final Quantifier quantifier;
13717
13718 OutputParameter(OnnxType type, Quantifier quantifier) {
13719 this.type = type;
13720 this.quantifier = quantifier;
13721 }
13722
13723 @Override
13724 public OnnxType type() {
13725 return type;
13726 }
13727
13728 @Override
13729 public Quantifier quantifier() {
13730 return quantifier;
13731 }
13732 }
13733
13734 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
13735 NAME,
13736 List.of(Attribute.values()),
13737 List.of(TypeConstraint.values()),
13738 List.of(InputParameter.values()),
13739 List.of(OutputParameter.values())
13740 );
13741
13742 public LayerNormalization(ExternalizedOp def) {
13743 super(SCHEMA, def);
13744 }
13745
13746 LayerNormalization(LayerNormalization that, CodeContext cc) {
13747 super(that, cc);
13748 }
13749
13750 @Override
13751 public LayerNormalization transform(CodeContext cc, CodeTransformer ot) {
13752 return new LayerNormalization(this, cc);
13753 }
13754
13755 LayerNormalization(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value X, Value Scale, java.util.Optional<Value> B, java.util.Optional<Float> epsilon, java.util.Optional<Long> stash_type, java.util.Optional<Long> axis) {
13756 super(SCHEMA, resultType, optionalOutputs, List.of(X, Scale, B), List.of(epsilon, stash_type, axis));
13757 }
13758
13759 @Override
13760 public SequencedSet<OnnxParameter> onnxOutputs() {
13761 return onnxOutputs(SCHEMA);
13762 }
13763
13764 @Override
13765 public SequencedMap<OnnxParameter, Object> onnxInputs() {
13766 return onnxInputs(SCHEMA, List.of(X(), Scale(), B()));
13767 }
13768
13769 public Value X() {
13770 return operands().get(0);
13771 }
13772
13773 public Value Scale() {
13774 return operands().get(1);
13775 }
13776
13777 public java.util.Optional<Value> B() {
13778 int i = optionalInputArguments.indexOf(InputParameter.B);
13779 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
13780 }
13781
13782 public java.util.Optional<Float> epsilon() {
13783 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes);
13784 return java.util.Optional.ofNullable(epsilon);
13785 }
13786
13787 public java.util.Optional<Long> stash_type() {
13788 Long stash_type = Attribute.stash_type.access(Long.class, onnxAttributes);
13789 return java.util.Optional.ofNullable(stash_type);
13790 }
13791
13792 public java.util.Optional<Long> axis() {
13793 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
13794 return java.util.Optional.ofNullable(axis);
13795 }
13796
13797 }
13798
13799 public static LayerNormalization LayerNormalization(TypeElement resultType, Set<LayerNormalization.OutputParameter> optionalOutputs, Value X, Value Scale, java.util.Optional<Value> B, java.util.Optional<Float> epsilon, java.util.Optional<Long> stash_type, java.util.Optional<Long> axis) {
13800 return new LayerNormalization(resultType, optionalOutputs, X, Scale, B, epsilon, stash_type, axis);
13801 }
13802
13803 @OpFactoryHelper.OpDeclaration(LeakyRelu.NAME)
13804 public static final class LeakyRelu extends OnnxOp {
13805 public static final String NAME = "LeakyRelu";
13806
13807 public enum Attribute implements OnnxAttribute {
13808 alpha(Float.class, true, 0.01f),
13809 ;
13810
13811 final Class<?> t;
13812 final boolean optional;
13813 final Object defaultValue;
13814
13815 Attribute(Class<?> type, boolean optional, Object defaultValue) {
13816 this.t = type;
13817 this.optional = optional;
13818 this.defaultValue = defaultValue;
13819 assert optional || defaultValue == null;
13820 }
13821
13822 public Class<?> type() {
13823 return t;
13824 }
13825
13826 public boolean isOptional() {
13827 return optional;
13828 }
13829
13830 public Object defaultValue() {
13831 return defaultValue;
13832 }
13833 }
13834
13835 public enum TypeConstraint implements OnnxTypeConstraint {
13836 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
13837 ;
13838
13839 final OnnxType.TypeVariable typeVariable;
13840
13841 TypeConstraint(OnnxType.TypeVariable typeVariable) {
13842 assert typeVariable.name().equals(name());
13843 this.typeVariable = typeVariable;
13844 }
13845
13846 @Override
13847 public OnnxType.TypeVariable typeVariable() {
13848 return typeVariable;
13849 }
13850 }
13851
13852 public enum InputParameter implements OnnxParameter {
13853 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13854 ;
13855
13856 final OnnxType type;
13857 final Quantifier quantifier;
13858
13859 InputParameter(OnnxType type, Quantifier quantifier) {
13860 this.type = type;
13861 this.quantifier = quantifier;
13862 }
13863
13864 @Override
13865 public OnnxType type() {
13866 return type;
13867 }
13868
13869 @Override
13870 public Quantifier quantifier() {
13871 return quantifier;
13872 }
13873 }
13874
13875 public enum OutputParameter implements OnnxParameter {
13876 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13877 ;
13878
13879 final OnnxType type;
13880 final Quantifier quantifier;
13881
13882 OutputParameter(OnnxType type, Quantifier quantifier) {
13883 this.type = type;
13884 this.quantifier = quantifier;
13885 }
13886
13887 @Override
13888 public OnnxType type() {
13889 return type;
13890 }
13891
13892 @Override
13893 public Quantifier quantifier() {
13894 return quantifier;
13895 }
13896 }
13897
13898 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
13899 NAME,
13900 List.of(Attribute.values()),
13901 List.of(TypeConstraint.values()),
13902 List.of(InputParameter.values()),
13903 List.of(OutputParameter.values())
13904 );
13905
13906 public LeakyRelu(ExternalizedOp def) {
13907 super(SCHEMA, def);
13908 }
13909
13910 LeakyRelu(LeakyRelu that, CodeContext cc) {
13911 super(that, cc);
13912 }
13913
13914 @Override
13915 public LeakyRelu transform(CodeContext cc, CodeTransformer ot) {
13916 return new LeakyRelu(this, cc);
13917 }
13918
13919 LeakyRelu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
13920 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha));
13921 }
13922
13923 @Override
13924 public SequencedSet<OnnxParameter> onnxOutputs() {
13925 return onnxOutputs(SCHEMA);
13926 }
13927
13928 @Override
13929 public SequencedMap<OnnxParameter, Object> onnxInputs() {
13930 return onnxInputs(SCHEMA, List.of(X()));
13931 }
13932
13933 public Value X() {
13934 return operands().get(0);
13935 }
13936
13937 public java.util.Optional<Float> alpha() {
13938 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
13939 return java.util.Optional.ofNullable(alpha);
13940 }
13941
13942 }
13943
13944 public static LeakyRelu LeakyRelu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
13945 return new LeakyRelu(resultType, X, alpha);
13946 }
13947
13948 @OpFactoryHelper.OpDeclaration(Less.NAME)
13949 public static final class Less extends OnnxOp {
13950 public static final String NAME = "Less";
13951
13952 public enum Attribute implements OnnxAttribute.None { }
13953
13954 public enum TypeConstraint implements OnnxTypeConstraint {
13955 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
13956 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
13957 ;
13958
13959 final OnnxType.TypeVariable typeVariable;
13960
13961 TypeConstraint(OnnxType.TypeVariable typeVariable) {
13962 assert typeVariable.name().equals(name());
13963 this.typeVariable = typeVariable;
13964 }
13965
13966 @Override
13967 public OnnxType.TypeVariable typeVariable() {
13968 return typeVariable;
13969 }
13970 }
13971
13972 public enum InputParameter implements OnnxParameter {
13973 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13974 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
13975 ;
13976
13977 final OnnxType type;
13978 final Quantifier quantifier;
13979
13980 InputParameter(OnnxType type, Quantifier quantifier) {
13981 this.type = type;
13982 this.quantifier = quantifier;
13983 }
13984
13985 @Override
13986 public OnnxType type() {
13987 return type;
13988 }
13989
13990 @Override
13991 public Quantifier quantifier() {
13992 return quantifier;
13993 }
13994 }
13995
13996 public enum OutputParameter implements OnnxParameter {
13997 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
13998 ;
13999
14000 final OnnxType type;
14001 final Quantifier quantifier;
14002
14003 OutputParameter(OnnxType type, Quantifier quantifier) {
14004 this.type = type;
14005 this.quantifier = quantifier;
14006 }
14007
14008 @Override
14009 public OnnxType type() {
14010 return type;
14011 }
14012
14013 @Override
14014 public Quantifier quantifier() {
14015 return quantifier;
14016 }
14017 }
14018
14019 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
14020 NAME,
14021 List.of(Attribute.values()),
14022 List.of(TypeConstraint.values()),
14023 List.of(InputParameter.values()),
14024 List.of(OutputParameter.values())
14025 );
14026
14027 public Less(ExternalizedOp def) {
14028 super(SCHEMA, def);
14029 }
14030
14031 Less(Less that, CodeContext cc) {
14032 super(that, cc);
14033 }
14034
14035 @Override
14036 public Less transform(CodeContext cc, CodeTransformer ot) {
14037 return new Less(this, cc);
14038 }
14039
14040 Less(TypeElement resultType, Value A, Value B) {
14041 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
14042 }
14043
14044 @Override
14045 public SequencedSet<OnnxParameter> onnxOutputs() {
14046 return onnxOutputs(SCHEMA);
14047 }
14048
14049 @Override
14050 public SequencedMap<OnnxParameter, Object> onnxInputs() {
14051 return onnxInputs(SCHEMA, List.of(A(), B()));
14052 }
14053
14054 public Value A() {
14055 return operands().get(0);
14056 }
14057
14058 public Value B() {
14059 return operands().get(1);
14060 }
14061
14062 }
14063
14064 public static Less Less(TypeElement resultType, Value A, Value B) {
14065 return new Less(resultType, A, B);
14066 }
14067
14068 @OpFactoryHelper.OpDeclaration(LessOrEqual.NAME)
14069 public static final class LessOrEqual extends OnnxOp {
14070 public static final String NAME = "LessOrEqual";
14071
14072 public enum Attribute implements OnnxAttribute.None { }
14073
14074 public enum TypeConstraint implements OnnxTypeConstraint {
14075 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
14076 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
14077 ;
14078
14079 final OnnxType.TypeVariable typeVariable;
14080
14081 TypeConstraint(OnnxType.TypeVariable typeVariable) {
14082 assert typeVariable.name().equals(name());
14083 this.typeVariable = typeVariable;
14084 }
14085
14086 @Override
14087 public OnnxType.TypeVariable typeVariable() {
14088 return typeVariable;
14089 }
14090 }
14091
14092 public enum InputParameter implements OnnxParameter {
14093 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14094 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14095 ;
14096
14097 final OnnxType type;
14098 final Quantifier quantifier;
14099
14100 InputParameter(OnnxType type, Quantifier quantifier) {
14101 this.type = type;
14102 this.quantifier = quantifier;
14103 }
14104
14105 @Override
14106 public OnnxType type() {
14107 return type;
14108 }
14109
14110 @Override
14111 public Quantifier quantifier() {
14112 return quantifier;
14113 }
14114 }
14115
14116 public enum OutputParameter implements OnnxParameter {
14117 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
14118 ;
14119
14120 final OnnxType type;
14121 final Quantifier quantifier;
14122
14123 OutputParameter(OnnxType type, Quantifier quantifier) {
14124 this.type = type;
14125 this.quantifier = quantifier;
14126 }
14127
14128 @Override
14129 public OnnxType type() {
14130 return type;
14131 }
14132
14133 @Override
14134 public Quantifier quantifier() {
14135 return quantifier;
14136 }
14137 }
14138
14139 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
14140 NAME,
14141 List.of(Attribute.values()),
14142 List.of(TypeConstraint.values()),
14143 List.of(InputParameter.values()),
14144 List.of(OutputParameter.values())
14145 );
14146
14147 public LessOrEqual(ExternalizedOp def) {
14148 super(SCHEMA, def);
14149 }
14150
14151 LessOrEqual(LessOrEqual that, CodeContext cc) {
14152 super(that, cc);
14153 }
14154
14155 @Override
14156 public LessOrEqual transform(CodeContext cc, CodeTransformer ot) {
14157 return new LessOrEqual(this, cc);
14158 }
14159
14160 LessOrEqual(TypeElement resultType, Value A, Value B) {
14161 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
14162 }
14163
14164 @Override
14165 public SequencedSet<OnnxParameter> onnxOutputs() {
14166 return onnxOutputs(SCHEMA);
14167 }
14168
14169 @Override
14170 public SequencedMap<OnnxParameter, Object> onnxInputs() {
14171 return onnxInputs(SCHEMA, List.of(A(), B()));
14172 }
14173
14174 public Value A() {
14175 return operands().get(0);
14176 }
14177
14178 public Value B() {
14179 return operands().get(1);
14180 }
14181
14182 }
14183
14184 public static LessOrEqual LessOrEqual(TypeElement resultType, Value A, Value B) {
14185 return new LessOrEqual(resultType, A, B);
14186 }
14187
14188 @OpFactoryHelper.OpDeclaration(LinearClassifier.NAME)
14189 public static final class LinearClassifier extends OnnxOp {
14190 public static final String NAME = "LinearClassifier";
14191
14192 public enum Attribute implements OnnxAttribute {
14193 classlabels_ints(long[].class, true, null),
14194 post_transform(String.class, true, "NONE"),
14195 coefficients(float[].class, false, null),
14196 multi_class(Long.class, true, 0),
14197 intercepts(float[].class, true, null),
14198 classlabels_strings(String[].class, true, null),
14199 ;
14200
14201 final Class<?> t;
14202 final boolean optional;
14203 final Object defaultValue;
14204
14205 Attribute(Class<?> type, boolean optional, Object defaultValue) {
14206 this.t = type;
14207 this.optional = optional;
14208 this.defaultValue = defaultValue;
14209 assert optional || defaultValue == null;
14210 }
14211
14212 public Class<?> type() {
14213 return t;
14214 }
14215
14216 public boolean isOptional() {
14217 return optional;
14218 }
14219
14220 public Object defaultValue() {
14221 return defaultValue;
14222 }
14223 }
14224
14225 public enum TypeConstraint implements OnnxTypeConstraint {
14226 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
14227 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))),
14228 ;
14229
14230 final OnnxType.TypeVariable typeVariable;
14231
14232 TypeConstraint(OnnxType.TypeVariable typeVariable) {
14233 assert typeVariable.name().equals(name());
14234 this.typeVariable = typeVariable;
14235 }
14236
14237 @Override
14238 public OnnxType.TypeVariable typeVariable() {
14239 return typeVariable;
14240 }
14241 }
14242
14243 public enum InputParameter implements OnnxParameter {
14244 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
14245 ;
14246
14247 final OnnxType type;
14248 final Quantifier quantifier;
14249
14250 InputParameter(OnnxType type, Quantifier quantifier) {
14251 this.type = type;
14252 this.quantifier = quantifier;
14253 }
14254
14255 @Override
14256 public OnnxType type() {
14257 return type;
14258 }
14259
14260 @Override
14261 public Quantifier quantifier() {
14262 return quantifier;
14263 }
14264 }
14265
14266 public enum OutputParameter implements OnnxParameter {
14267 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
14268 Z(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
14269 ;
14270
14271 final OnnxType type;
14272 final Quantifier quantifier;
14273
14274 OutputParameter(OnnxType type, Quantifier quantifier) {
14275 this.type = type;
14276 this.quantifier = quantifier;
14277 }
14278
14279 @Override
14280 public OnnxType type() {
14281 return type;
14282 }
14283
14284 @Override
14285 public Quantifier quantifier() {
14286 return quantifier;
14287 }
14288 }
14289
14290 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
14291 NAME,
14292 List.of(Attribute.values()),
14293 List.of(TypeConstraint.values()),
14294 List.of(InputParameter.values()),
14295 List.of(OutputParameter.values())
14296 );
14297
14298 public LinearClassifier(ExternalizedOp def) {
14299 super(SCHEMA, def);
14300 }
14301
14302 LinearClassifier(LinearClassifier that, CodeContext cc) {
14303 super(that, cc);
14304 }
14305
14306 @Override
14307 public LinearClassifier transform(CodeContext cc, CodeTransformer ot) {
14308 return new LinearClassifier(this, cc);
14309 }
14310
14311 LinearClassifier(TypeElement resultType, Value X, java.util.Optional<long[]> classlabels_ints, java.util.Optional<String> post_transform, float[] coefficients, java.util.Optional<Long> multi_class, java.util.Optional<float[]> intercepts, java.util.Optional<String[]> classlabels_strings) {
14312 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(classlabels_ints, post_transform, coefficients, multi_class, intercepts, classlabels_strings));
14313 }
14314
14315 @Override
14316 public SequencedSet<OnnxParameter> onnxOutputs() {
14317 return onnxOutputs(SCHEMA);
14318 }
14319
14320 @Override
14321 public SequencedMap<OnnxParameter, Object> onnxInputs() {
14322 return onnxInputs(SCHEMA, List.of(X()));
14323 }
14324
14325 public Value X() {
14326 return operands().get(0);
14327 }
14328
14329 public java.util.Optional<long[]> classlabels_ints() {
14330 long[] classlabels_ints = Attribute.classlabels_ints.access(long[].class, onnxAttributes);
14331 return java.util.Optional.ofNullable(classlabels_ints).map(long[]::clone);
14332 }
14333
14334 public java.util.Optional<String> post_transform() {
14335 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes);
14336 return java.util.Optional.ofNullable(post_transform);
14337 }
14338
14339 public float[] coefficients() {
14340 float[] coefficients = Attribute.coefficients.access(float[].class, onnxAttributes);
14341 return coefficients.clone();
14342 }
14343
14344 public java.util.Optional<Long> multi_class() {
14345 Long multi_class = Attribute.multi_class.access(Long.class, onnxAttributes);
14346 return java.util.Optional.ofNullable(multi_class);
14347 }
14348
14349 public java.util.Optional<float[]> intercepts() {
14350 float[] intercepts = Attribute.intercepts.access(float[].class, onnxAttributes);
14351 return java.util.Optional.ofNullable(intercepts).map(float[]::clone);
14352 }
14353
14354 public java.util.Optional<String[]> classlabels_strings() {
14355 String[] classlabels_strings = Attribute.classlabels_strings.access(String[].class, onnxAttributes);
14356 return java.util.Optional.ofNullable(classlabels_strings).map(String[]::clone);
14357 }
14358
14359 }
14360
14361 public static LinearClassifier LinearClassifier(TypeElement resultType, Value X, java.util.Optional<long[]> classlabels_ints, java.util.Optional<String> post_transform, float[] coefficients, java.util.Optional<Long> multi_class, java.util.Optional<float[]> intercepts, java.util.Optional<String[]> classlabels_strings) {
14362 return new LinearClassifier(resultType, X, classlabels_ints, post_transform, coefficients, multi_class, intercepts, classlabels_strings);
14363 }
14364
14365 @OpFactoryHelper.OpDeclaration(LinearRegressor.NAME)
14366 public static final class LinearRegressor extends OnnxOp {
14367 public static final String NAME = "LinearRegressor";
14368
14369 public enum Attribute implements OnnxAttribute {
14370 post_transform(String.class, true, "NONE"),
14371 coefficients(float[].class, true, null),
14372 targets(Long.class, true, 1),
14373 intercepts(float[].class, true, null),
14374 ;
14375
14376 final Class<?> t;
14377 final boolean optional;
14378 final Object defaultValue;
14379
14380 Attribute(Class<?> type, boolean optional, Object defaultValue) {
14381 this.t = type;
14382 this.optional = optional;
14383 this.defaultValue = defaultValue;
14384 assert optional || defaultValue == null;
14385 }
14386
14387 public Class<?> type() {
14388 return t;
14389 }
14390
14391 public boolean isOptional() {
14392 return optional;
14393 }
14394
14395 public Object defaultValue() {
14396 return defaultValue;
14397 }
14398 }
14399
14400 public enum TypeConstraint implements OnnxTypeConstraint {
14401 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
14402 ;
14403
14404 final OnnxType.TypeVariable typeVariable;
14405
14406 TypeConstraint(OnnxType.TypeVariable typeVariable) {
14407 assert typeVariable.name().equals(name());
14408 this.typeVariable = typeVariable;
14409 }
14410
14411 @Override
14412 public OnnxType.TypeVariable typeVariable() {
14413 return typeVariable;
14414 }
14415 }
14416
14417 public enum InputParameter implements OnnxParameter {
14418 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14419 ;
14420
14421 final OnnxType type;
14422 final Quantifier quantifier;
14423
14424 InputParameter(OnnxType type, Quantifier quantifier) {
14425 this.type = type;
14426 this.quantifier = quantifier;
14427 }
14428
14429 @Override
14430 public OnnxType type() {
14431 return type;
14432 }
14433
14434 @Override
14435 public Quantifier quantifier() {
14436 return quantifier;
14437 }
14438 }
14439
14440 public enum OutputParameter implements OnnxParameter {
14441 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
14442 ;
14443
14444 final OnnxType type;
14445 final Quantifier quantifier;
14446
14447 OutputParameter(OnnxType type, Quantifier quantifier) {
14448 this.type = type;
14449 this.quantifier = quantifier;
14450 }
14451
14452 @Override
14453 public OnnxType type() {
14454 return type;
14455 }
14456
14457 @Override
14458 public Quantifier quantifier() {
14459 return quantifier;
14460 }
14461 }
14462
14463 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
14464 NAME,
14465 List.of(Attribute.values()),
14466 List.of(TypeConstraint.values()),
14467 List.of(InputParameter.values()),
14468 List.of(OutputParameter.values())
14469 );
14470
14471 public LinearRegressor(ExternalizedOp def) {
14472 super(SCHEMA, def);
14473 }
14474
14475 LinearRegressor(LinearRegressor that, CodeContext cc) {
14476 super(that, cc);
14477 }
14478
14479 @Override
14480 public LinearRegressor transform(CodeContext cc, CodeTransformer ot) {
14481 return new LinearRegressor(this, cc);
14482 }
14483
14484 LinearRegressor(TypeElement resultType, Value X, java.util.Optional<String> post_transform, java.util.Optional<float[]> coefficients, java.util.Optional<Long> targets, java.util.Optional<float[]> intercepts) {
14485 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(post_transform, coefficients, targets, intercepts));
14486 }
14487
14488 @Override
14489 public SequencedSet<OnnxParameter> onnxOutputs() {
14490 return onnxOutputs(SCHEMA);
14491 }
14492
14493 @Override
14494 public SequencedMap<OnnxParameter, Object> onnxInputs() {
14495 return onnxInputs(SCHEMA, List.of(X()));
14496 }
14497
14498 public Value X() {
14499 return operands().get(0);
14500 }
14501
14502 public java.util.Optional<String> post_transform() {
14503 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes);
14504 return java.util.Optional.ofNullable(post_transform);
14505 }
14506
14507 public java.util.Optional<float[]> coefficients() {
14508 float[] coefficients = Attribute.coefficients.access(float[].class, onnxAttributes);
14509 return java.util.Optional.ofNullable(coefficients).map(float[]::clone);
14510 }
14511
14512 public java.util.Optional<Long> targets() {
14513 Long targets = Attribute.targets.access(Long.class, onnxAttributes);
14514 return java.util.Optional.ofNullable(targets);
14515 }
14516
14517 public java.util.Optional<float[]> intercepts() {
14518 float[] intercepts = Attribute.intercepts.access(float[].class, onnxAttributes);
14519 return java.util.Optional.ofNullable(intercepts).map(float[]::clone);
14520 }
14521
14522 }
14523
14524 public static LinearRegressor LinearRegressor(TypeElement resultType, Value X, java.util.Optional<String> post_transform, java.util.Optional<float[]> coefficients, java.util.Optional<Long> targets, java.util.Optional<float[]> intercepts) {
14525 return new LinearRegressor(resultType, X, post_transform, coefficients, targets, intercepts);
14526 }
14527
14528 @OpFactoryHelper.OpDeclaration(Log.NAME)
14529 public static final class Log extends OnnxOp {
14530 public static final String NAME = "Log";
14531
14532 public enum Attribute implements OnnxAttribute.None { }
14533
14534 public enum TypeConstraint implements OnnxTypeConstraint {
14535 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
14536 ;
14537
14538 final OnnxType.TypeVariable typeVariable;
14539
14540 TypeConstraint(OnnxType.TypeVariable typeVariable) {
14541 assert typeVariable.name().equals(name());
14542 this.typeVariable = typeVariable;
14543 }
14544
14545 @Override
14546 public OnnxType.TypeVariable typeVariable() {
14547 return typeVariable;
14548 }
14549 }
14550
14551 public enum InputParameter implements OnnxParameter {
14552 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14553 ;
14554
14555 final OnnxType type;
14556 final Quantifier quantifier;
14557
14558 InputParameter(OnnxType type, Quantifier quantifier) {
14559 this.type = type;
14560 this.quantifier = quantifier;
14561 }
14562
14563 @Override
14564 public OnnxType type() {
14565 return type;
14566 }
14567
14568 @Override
14569 public Quantifier quantifier() {
14570 return quantifier;
14571 }
14572 }
14573
14574 public enum OutputParameter implements OnnxParameter {
14575 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14576 ;
14577
14578 final OnnxType type;
14579 final Quantifier quantifier;
14580
14581 OutputParameter(OnnxType type, Quantifier quantifier) {
14582 this.type = type;
14583 this.quantifier = quantifier;
14584 }
14585
14586 @Override
14587 public OnnxType type() {
14588 return type;
14589 }
14590
14591 @Override
14592 public Quantifier quantifier() {
14593 return quantifier;
14594 }
14595 }
14596
14597 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
14598 NAME,
14599 List.of(Attribute.values()),
14600 List.of(TypeConstraint.values()),
14601 List.of(InputParameter.values()),
14602 List.of(OutputParameter.values())
14603 );
14604
14605 public Log(ExternalizedOp def) {
14606 super(SCHEMA, def);
14607 }
14608
14609 Log(Log that, CodeContext cc) {
14610 super(that, cc);
14611 }
14612
14613 @Override
14614 public Log transform(CodeContext cc, CodeTransformer ot) {
14615 return new Log(this, cc);
14616 }
14617
14618 Log(TypeElement resultType, Value input) {
14619 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
14620 }
14621
14622 @Override
14623 public SequencedSet<OnnxParameter> onnxOutputs() {
14624 return onnxOutputs(SCHEMA);
14625 }
14626
14627 @Override
14628 public SequencedMap<OnnxParameter, Object> onnxInputs() {
14629 return onnxInputs(SCHEMA, List.of(input()));
14630 }
14631
14632 public Value input() {
14633 return operands().get(0);
14634 }
14635
14636 }
14637
14638 public static Log Log(TypeElement resultType, Value input) {
14639 return new Log(resultType, input);
14640 }
14641
14642 @OpFactoryHelper.OpDeclaration(LogSoftmax.NAME)
14643 public static final class LogSoftmax extends OnnxOp {
14644 public static final String NAME = "LogSoftmax";
14645
14646 public enum Attribute implements OnnxAttribute {
14647 axis(Long.class, true, -1),
14648 ;
14649
14650 final Class<?> t;
14651 final boolean optional;
14652 final Object defaultValue;
14653
14654 Attribute(Class<?> type, boolean optional, Object defaultValue) {
14655 this.t = type;
14656 this.optional = optional;
14657 this.defaultValue = defaultValue;
14658 assert optional || defaultValue == null;
14659 }
14660
14661 public Class<?> type() {
14662 return t;
14663 }
14664
14665 public boolean isOptional() {
14666 return optional;
14667 }
14668
14669 public Object defaultValue() {
14670 return defaultValue;
14671 }
14672 }
14673
14674 public enum TypeConstraint implements OnnxTypeConstraint {
14675 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
14676 ;
14677
14678 final OnnxType.TypeVariable typeVariable;
14679
14680 TypeConstraint(OnnxType.TypeVariable typeVariable) {
14681 assert typeVariable.name().equals(name());
14682 this.typeVariable = typeVariable;
14683 }
14684
14685 @Override
14686 public OnnxType.TypeVariable typeVariable() {
14687 return typeVariable;
14688 }
14689 }
14690
14691 public enum InputParameter implements OnnxParameter {
14692 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14693 ;
14694
14695 final OnnxType type;
14696 final Quantifier quantifier;
14697
14698 InputParameter(OnnxType type, Quantifier quantifier) {
14699 this.type = type;
14700 this.quantifier = quantifier;
14701 }
14702
14703 @Override
14704 public OnnxType type() {
14705 return type;
14706 }
14707
14708 @Override
14709 public Quantifier quantifier() {
14710 return quantifier;
14711 }
14712 }
14713
14714 public enum OutputParameter implements OnnxParameter {
14715 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14716 ;
14717
14718 final OnnxType type;
14719 final Quantifier quantifier;
14720
14721 OutputParameter(OnnxType type, Quantifier quantifier) {
14722 this.type = type;
14723 this.quantifier = quantifier;
14724 }
14725
14726 @Override
14727 public OnnxType type() {
14728 return type;
14729 }
14730
14731 @Override
14732 public Quantifier quantifier() {
14733 return quantifier;
14734 }
14735 }
14736
14737 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
14738 NAME,
14739 List.of(Attribute.values()),
14740 List.of(TypeConstraint.values()),
14741 List.of(InputParameter.values()),
14742 List.of(OutputParameter.values())
14743 );
14744
14745 public LogSoftmax(ExternalizedOp def) {
14746 super(SCHEMA, def);
14747 }
14748
14749 LogSoftmax(LogSoftmax that, CodeContext cc) {
14750 super(that, cc);
14751 }
14752
14753 @Override
14754 public LogSoftmax transform(CodeContext cc, CodeTransformer ot) {
14755 return new LogSoftmax(this, cc);
14756 }
14757
14758 LogSoftmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) {
14759 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(axis));
14760 }
14761
14762 @Override
14763 public SequencedSet<OnnxParameter> onnxOutputs() {
14764 return onnxOutputs(SCHEMA);
14765 }
14766
14767 @Override
14768 public SequencedMap<OnnxParameter, Object> onnxInputs() {
14769 return onnxInputs(SCHEMA, List.of(input()));
14770 }
14771
14772 public Value input() {
14773 return operands().get(0);
14774 }
14775
14776 public java.util.Optional<Long> axis() {
14777 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
14778 return java.util.Optional.ofNullable(axis);
14779 }
14780
14781 }
14782
14783 public static LogSoftmax LogSoftmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) {
14784 return new LogSoftmax(resultType, input, axis);
14785 }
14786
14787 @OpFactoryHelper.OpDeclaration(LpNormalization.NAME)
14788 public static final class LpNormalization extends OnnxOp {
14789 public static final String NAME = "LpNormalization";
14790
14791 public enum Attribute implements OnnxAttribute {
14792 p(Long.class, true, 2),
14793 axis(Long.class, true, -1),
14794 ;
14795
14796 final Class<?> t;
14797 final boolean optional;
14798 final Object defaultValue;
14799
14800 Attribute(Class<?> type, boolean optional, Object defaultValue) {
14801 this.t = type;
14802 this.optional = optional;
14803 this.defaultValue = defaultValue;
14804 assert optional || defaultValue == null;
14805 }
14806
14807 public Class<?> type() {
14808 return t;
14809 }
14810
14811 public boolean isOptional() {
14812 return optional;
14813 }
14814
14815 public Object defaultValue() {
14816 return defaultValue;
14817 }
14818 }
14819
14820 public enum TypeConstraint implements OnnxTypeConstraint {
14821 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
14822 ;
14823
14824 final OnnxType.TypeVariable typeVariable;
14825
14826 TypeConstraint(OnnxType.TypeVariable typeVariable) {
14827 assert typeVariable.name().equals(name());
14828 this.typeVariable = typeVariable;
14829 }
14830
14831 @Override
14832 public OnnxType.TypeVariable typeVariable() {
14833 return typeVariable;
14834 }
14835 }
14836
14837 public enum InputParameter implements OnnxParameter {
14838 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14839 ;
14840
14841 final OnnxType type;
14842 final Quantifier quantifier;
14843
14844 InputParameter(OnnxType type, Quantifier quantifier) {
14845 this.type = type;
14846 this.quantifier = quantifier;
14847 }
14848
14849 @Override
14850 public OnnxType type() {
14851 return type;
14852 }
14853
14854 @Override
14855 public Quantifier quantifier() {
14856 return quantifier;
14857 }
14858 }
14859
14860 public enum OutputParameter implements OnnxParameter {
14861 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14862 ;
14863
14864 final OnnxType type;
14865 final Quantifier quantifier;
14866
14867 OutputParameter(OnnxType type, Quantifier quantifier) {
14868 this.type = type;
14869 this.quantifier = quantifier;
14870 }
14871
14872 @Override
14873 public OnnxType type() {
14874 return type;
14875 }
14876
14877 @Override
14878 public Quantifier quantifier() {
14879 return quantifier;
14880 }
14881 }
14882
14883 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
14884 NAME,
14885 List.of(Attribute.values()),
14886 List.of(TypeConstraint.values()),
14887 List.of(InputParameter.values()),
14888 List.of(OutputParameter.values())
14889 );
14890
14891 public LpNormalization(ExternalizedOp def) {
14892 super(SCHEMA, def);
14893 }
14894
14895 LpNormalization(LpNormalization that, CodeContext cc) {
14896 super(that, cc);
14897 }
14898
14899 @Override
14900 public LpNormalization transform(CodeContext cc, CodeTransformer ot) {
14901 return new LpNormalization(this, cc);
14902 }
14903
14904 LpNormalization(TypeElement resultType, Value input, java.util.Optional<Long> p, java.util.Optional<Long> axis) {
14905 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(p, axis));
14906 }
14907
14908 @Override
14909 public SequencedSet<OnnxParameter> onnxOutputs() {
14910 return onnxOutputs(SCHEMA);
14911 }
14912
14913 @Override
14914 public SequencedMap<OnnxParameter, Object> onnxInputs() {
14915 return onnxInputs(SCHEMA, List.of(input()));
14916 }
14917
14918 public Value input() {
14919 return operands().get(0);
14920 }
14921
14922 public java.util.Optional<Long> p() {
14923 Long p = Attribute.p.access(Long.class, onnxAttributes);
14924 return java.util.Optional.ofNullable(p);
14925 }
14926
14927 public java.util.Optional<Long> axis() {
14928 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
14929 return java.util.Optional.ofNullable(axis);
14930 }
14931
14932 }
14933
14934 public static LpNormalization LpNormalization(TypeElement resultType, Value input, java.util.Optional<Long> p, java.util.Optional<Long> axis) {
14935 return new LpNormalization(resultType, input, p, axis);
14936 }
14937
14938 @OpFactoryHelper.OpDeclaration(LpPool.NAME)
14939 public static final class LpPool extends OnnxOp {
14940 public static final String NAME = "LpPool";
14941
14942 public enum Attribute implements OnnxAttribute {
14943 p(Long.class, true, 2),
14944 pads(long[].class, true, null),
14945 dilations(long[].class, true, null),
14946 auto_pad(String.class, true, "NOTSET"),
14947 ceil_mode(Long.class, true, 0),
14948 strides(long[].class, true, null),
14949 kernel_shape(long[].class, false, null),
14950 ;
14951
14952 final Class<?> t;
14953 final boolean optional;
14954 final Object defaultValue;
14955
14956 Attribute(Class<?> type, boolean optional, Object defaultValue) {
14957 this.t = type;
14958 this.optional = optional;
14959 this.defaultValue = defaultValue;
14960 assert optional || defaultValue == null;
14961 }
14962
14963 public Class<?> type() {
14964 return t;
14965 }
14966
14967 public boolean isOptional() {
14968 return optional;
14969 }
14970
14971 public Object defaultValue() {
14972 return defaultValue;
14973 }
14974 }
14975
14976 public enum TypeConstraint implements OnnxTypeConstraint {
14977 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
14978 ;
14979
14980 final OnnxType.TypeVariable typeVariable;
14981
14982 TypeConstraint(OnnxType.TypeVariable typeVariable) {
14983 assert typeVariable.name().equals(name());
14984 this.typeVariable = typeVariable;
14985 }
14986
14987 @Override
14988 public OnnxType.TypeVariable typeVariable() {
14989 return typeVariable;
14990 }
14991 }
14992
14993 public enum InputParameter implements OnnxParameter {
14994 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
14995 ;
14996
14997 final OnnxType type;
14998 final Quantifier quantifier;
14999
15000 InputParameter(OnnxType type, Quantifier quantifier) {
15001 this.type = type;
15002 this.quantifier = quantifier;
15003 }
15004
15005 @Override
15006 public OnnxType type() {
15007 return type;
15008 }
15009
15010 @Override
15011 public Quantifier quantifier() {
15012 return quantifier;
15013 }
15014 }
15015
15016 public enum OutputParameter implements OnnxParameter {
15017 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15018 ;
15019
15020 final OnnxType type;
15021 final Quantifier quantifier;
15022
15023 OutputParameter(OnnxType type, Quantifier quantifier) {
15024 this.type = type;
15025 this.quantifier = quantifier;
15026 }
15027
15028 @Override
15029 public OnnxType type() {
15030 return type;
15031 }
15032
15033 @Override
15034 public Quantifier quantifier() {
15035 return quantifier;
15036 }
15037 }
15038
15039 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
15040 NAME,
15041 List.of(Attribute.values()),
15042 List.of(TypeConstraint.values()),
15043 List.of(InputParameter.values()),
15044 List.of(OutputParameter.values())
15045 );
15046
15047 public LpPool(ExternalizedOp def) {
15048 super(SCHEMA, def);
15049 }
15050
15051 LpPool(LpPool that, CodeContext cc) {
15052 super(that, cc);
15053 }
15054
15055 @Override
15056 public LpPool transform(CodeContext cc, CodeTransformer ot) {
15057 return new LpPool(this, cc);
15058 }
15059
15060 LpPool(TypeElement resultType, Value X, java.util.Optional<Long> p, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<Long> ceil_mode, java.util.Optional<long[]> strides, long[] kernel_shape) {
15061 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(p, pads, dilations, auto_pad, ceil_mode, strides, kernel_shape));
15062 }
15063
15064 @Override
15065 public SequencedSet<OnnxParameter> onnxOutputs() {
15066 return onnxOutputs(SCHEMA);
15067 }
15068
15069 @Override
15070 public SequencedMap<OnnxParameter, Object> onnxInputs() {
15071 return onnxInputs(SCHEMA, List.of(X()));
15072 }
15073
15074 public Value X() {
15075 return operands().get(0);
15076 }
15077
15078 public java.util.Optional<Long> p() {
15079 Long p = Attribute.p.access(Long.class, onnxAttributes);
15080 return java.util.Optional.ofNullable(p);
15081 }
15082
15083 public java.util.Optional<long[]> pads() {
15084 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
15085 return java.util.Optional.ofNullable(pads).map(long[]::clone);
15086 }
15087
15088 public java.util.Optional<long[]> dilations() {
15089 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
15090 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
15091 }
15092
15093 public java.util.Optional<String> auto_pad() {
15094 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes);
15095 return java.util.Optional.ofNullable(auto_pad);
15096 }
15097
15098 public java.util.Optional<Long> ceil_mode() {
15099 Long ceil_mode = Attribute.ceil_mode.access(Long.class, onnxAttributes);
15100 return java.util.Optional.ofNullable(ceil_mode);
15101 }
15102
15103 public java.util.Optional<long[]> strides() {
15104 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
15105 return java.util.Optional.ofNullable(strides).map(long[]::clone);
15106 }
15107
15108 public long[] kernel_shape() {
15109 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
15110 return kernel_shape.clone();
15111 }
15112
15113 }
15114
15115 public static LpPool LpPool(TypeElement resultType, Value X, java.util.Optional<Long> p, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<Long> ceil_mode, java.util.Optional<long[]> strides, long[] kernel_shape) {
15116 return new LpPool(resultType, X, p, pads, dilations, auto_pad, ceil_mode, strides, kernel_shape);
15117 }
15118
15119 @OpFactoryHelper.OpDeclaration(MatMul.NAME)
15120 public static final class MatMul extends OnnxOp {
15121 public static final String NAME = "MatMul";
15122
15123 public enum Attribute implements OnnxAttribute.None { }
15124
15125 public enum TypeConstraint implements OnnxTypeConstraint {
15126 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16())))),
15127 ;
15128
15129 final OnnxType.TypeVariable typeVariable;
15130
15131 TypeConstraint(OnnxType.TypeVariable typeVariable) {
15132 assert typeVariable.name().equals(name());
15133 this.typeVariable = typeVariable;
15134 }
15135
15136 @Override
15137 public OnnxType.TypeVariable typeVariable() {
15138 return typeVariable;
15139 }
15140 }
15141
15142 public enum InputParameter implements OnnxParameter {
15143 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15144 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15145 ;
15146
15147 final OnnxType type;
15148 final Quantifier quantifier;
15149
15150 InputParameter(OnnxType type, Quantifier quantifier) {
15151 this.type = type;
15152 this.quantifier = quantifier;
15153 }
15154
15155 @Override
15156 public OnnxType type() {
15157 return type;
15158 }
15159
15160 @Override
15161 public Quantifier quantifier() {
15162 return quantifier;
15163 }
15164 }
15165
15166 public enum OutputParameter implements OnnxParameter {
15167 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15168 ;
15169
15170 final OnnxType type;
15171 final Quantifier quantifier;
15172
15173 OutputParameter(OnnxType type, Quantifier quantifier) {
15174 this.type = type;
15175 this.quantifier = quantifier;
15176 }
15177
15178 @Override
15179 public OnnxType type() {
15180 return type;
15181 }
15182
15183 @Override
15184 public Quantifier quantifier() {
15185 return quantifier;
15186 }
15187 }
15188
15189 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
15190 NAME,
15191 List.of(Attribute.values()),
15192 List.of(TypeConstraint.values()),
15193 List.of(InputParameter.values()),
15194 List.of(OutputParameter.values())
15195 );
15196
15197 public MatMul(ExternalizedOp def) {
15198 super(SCHEMA, def);
15199 }
15200
15201 MatMul(MatMul that, CodeContext cc) {
15202 super(that, cc);
15203 }
15204
15205 @Override
15206 public MatMul transform(CodeContext cc, CodeTransformer ot) {
15207 return new MatMul(this, cc);
15208 }
15209
15210 MatMul(TypeElement resultType, Value A, Value B) {
15211 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
15212 }
15213
15214 @Override
15215 public SequencedSet<OnnxParameter> onnxOutputs() {
15216 return onnxOutputs(SCHEMA);
15217 }
15218
15219 @Override
15220 public SequencedMap<OnnxParameter, Object> onnxInputs() {
15221 return onnxInputs(SCHEMA, List.of(A(), B()));
15222 }
15223
15224 public Value A() {
15225 return operands().get(0);
15226 }
15227
15228 public Value B() {
15229 return operands().get(1);
15230 }
15231
15232 }
15233
15234 public static MatMul MatMul(TypeElement resultType, Value A, Value B) {
15235 return new MatMul(resultType, A, B);
15236 }
15237
15238 @OpFactoryHelper.OpDeclaration(MatMulInteger.NAME)
15239 public static final class MatMulInteger extends OnnxOp {
15240 public static final String NAME = "MatMulInteger";
15241
15242 public enum Attribute implements OnnxAttribute.None { }
15243
15244 public enum TypeConstraint implements OnnxTypeConstraint {
15245 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))),
15246 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))),
15247 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int32())))),
15248 ;
15249
15250 final OnnxType.TypeVariable typeVariable;
15251
15252 TypeConstraint(OnnxType.TypeVariable typeVariable) {
15253 assert typeVariable.name().equals(name());
15254 this.typeVariable = typeVariable;
15255 }
15256
15257 @Override
15258 public OnnxType.TypeVariable typeVariable() {
15259 return typeVariable;
15260 }
15261 }
15262
15263 public enum InputParameter implements OnnxParameter {
15264 A(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
15265 B(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
15266 a_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
15267 b_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
15268 ;
15269
15270 final OnnxType type;
15271 final Quantifier quantifier;
15272
15273 InputParameter(OnnxType type, Quantifier quantifier) {
15274 this.type = type;
15275 this.quantifier = quantifier;
15276 }
15277
15278 @Override
15279 public OnnxType type() {
15280 return type;
15281 }
15282
15283 @Override
15284 public Quantifier quantifier() {
15285 return quantifier;
15286 }
15287 }
15288
15289 public enum OutputParameter implements OnnxParameter {
15290 Y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
15291 ;
15292
15293 final OnnxType type;
15294 final Quantifier quantifier;
15295
15296 OutputParameter(OnnxType type, Quantifier quantifier) {
15297 this.type = type;
15298 this.quantifier = quantifier;
15299 }
15300
15301 @Override
15302 public OnnxType type() {
15303 return type;
15304 }
15305
15306 @Override
15307 public Quantifier quantifier() {
15308 return quantifier;
15309 }
15310 }
15311
15312 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
15313 NAME,
15314 List.of(Attribute.values()),
15315 List.of(TypeConstraint.values()),
15316 List.of(InputParameter.values()),
15317 List.of(OutputParameter.values())
15318 );
15319
15320 public MatMulInteger(ExternalizedOp def) {
15321 super(SCHEMA, def);
15322 }
15323
15324 MatMulInteger(MatMulInteger that, CodeContext cc) {
15325 super(that, cc);
15326 }
15327
15328 @Override
15329 public MatMulInteger transform(CodeContext cc, CodeTransformer ot) {
15330 return new MatMulInteger(this, cc);
15331 }
15332
15333 MatMulInteger(TypeElement resultType, Value A, Value B, java.util.Optional<Value> a_zero_point, java.util.Optional<Value> b_zero_point) {
15334 super(SCHEMA, resultType, Set.of(), List.of(A, B, a_zero_point, b_zero_point), List.of());
15335 }
15336
15337 @Override
15338 public SequencedSet<OnnxParameter> onnxOutputs() {
15339 return onnxOutputs(SCHEMA);
15340 }
15341
15342 @Override
15343 public SequencedMap<OnnxParameter, Object> onnxInputs() {
15344 return onnxInputs(SCHEMA, List.of(A(), B(), a_zero_point(), b_zero_point()));
15345 }
15346
15347 public Value A() {
15348 return operands().get(0);
15349 }
15350
15351 public Value B() {
15352 return operands().get(1);
15353 }
15354
15355 public java.util.Optional<Value> a_zero_point() {
15356 int i = optionalInputArguments.indexOf(InputParameter.a_zero_point);
15357 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
15358 }
15359
15360 public java.util.Optional<Value> b_zero_point() {
15361 int i = optionalInputArguments.indexOf(InputParameter.b_zero_point);
15362 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
15363 }
15364
15365 }
15366
15367 public static MatMulInteger MatMulInteger(TypeElement resultType, Value A, Value B, java.util.Optional<Value> a_zero_point, java.util.Optional<Value> b_zero_point) {
15368 return new MatMulInteger(resultType, A, B, a_zero_point, b_zero_point);
15369 }
15370
15371 @OpFactoryHelper.OpDeclaration(Max.NAME)
15372 public static final class Max extends OnnxOp {
15373 public static final String NAME = "Max";
15374
15375 public enum Attribute implements OnnxAttribute.None { }
15376
15377 public enum TypeConstraint implements OnnxTypeConstraint {
15378 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
15379 ;
15380
15381 final OnnxType.TypeVariable typeVariable;
15382
15383 TypeConstraint(OnnxType.TypeVariable typeVariable) {
15384 assert typeVariable.name().equals(name());
15385 this.typeVariable = typeVariable;
15386 }
15387
15388 @Override
15389 public OnnxType.TypeVariable typeVariable() {
15390 return typeVariable;
15391 }
15392 }
15393
15394 public enum InputParameter implements OnnxParameter {
15395 data_0(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC),
15396 ;
15397
15398 final OnnxType type;
15399 final Quantifier quantifier;
15400
15401 InputParameter(OnnxType type, Quantifier quantifier) {
15402 this.type = type;
15403 this.quantifier = quantifier;
15404 }
15405
15406 @Override
15407 public OnnxType type() {
15408 return type;
15409 }
15410
15411 @Override
15412 public Quantifier quantifier() {
15413 return quantifier;
15414 }
15415 }
15416
15417 public enum OutputParameter implements OnnxParameter {
15418 max(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15419 ;
15420
15421 final OnnxType type;
15422 final Quantifier quantifier;
15423
15424 OutputParameter(OnnxType type, Quantifier quantifier) {
15425 this.type = type;
15426 this.quantifier = quantifier;
15427 }
15428
15429 @Override
15430 public OnnxType type() {
15431 return type;
15432 }
15433
15434 @Override
15435 public Quantifier quantifier() {
15436 return quantifier;
15437 }
15438 }
15439
15440 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
15441 NAME,
15442 List.of(Attribute.values()),
15443 List.of(TypeConstraint.values()),
15444 List.of(InputParameter.values()),
15445 List.of(OutputParameter.values())
15446 );
15447
15448 public Max(ExternalizedOp def) {
15449 super(SCHEMA, def);
15450 }
15451
15452 Max(Max that, CodeContext cc) {
15453 super(that, cc);
15454 }
15455
15456 @Override
15457 public Max transform(CodeContext cc, CodeTransformer ot) {
15458 return new Max(this, cc);
15459 }
15460
15461 Max(TypeElement resultType, List<Value> data_0) {
15462 super(SCHEMA, resultType, Set.of(), List.of(data_0), List.of());
15463 }
15464
15465 @Override
15466 public SequencedSet<OnnxParameter> onnxOutputs() {
15467 return onnxOutputs(SCHEMA);
15468 }
15469
15470 @Override
15471 public SequencedMap<OnnxParameter, Object> onnxInputs() {
15472 return onnxInputs(SCHEMA, List.of(data_0()));
15473 }
15474
15475 public List<Value> data_0() {
15476 return operands();
15477 }
15478
15479 }
15480
15481 public static Max Max(TypeElement resultType, List<Value> data_0) {
15482 return new Max(resultType, data_0);
15483 }
15484
15485 @OpFactoryHelper.OpDeclaration(MaxPool.NAME)
15486 public static final class MaxPool extends OnnxOp {
15487 public static final String NAME = "MaxPool";
15488
15489 public enum Attribute implements OnnxAttribute {
15490 pads(long[].class, true, null),
15491 dilations(long[].class, true, null),
15492 auto_pad(String.class, true, "NOTSET"),
15493 ceil_mode(Long.class, true, 0),
15494 storage_order(Long.class, true, 0),
15495 strides(long[].class, true, null),
15496 kernel_shape(long[].class, false, null),
15497 ;
15498
15499 final Class<?> t;
15500 final boolean optional;
15501 final Object defaultValue;
15502
15503 Attribute(Class<?> type, boolean optional, Object defaultValue) {
15504 this.t = type;
15505 this.optional = optional;
15506 this.defaultValue = defaultValue;
15507 assert optional || defaultValue == null;
15508 }
15509
15510 public Class<?> type() {
15511 return t;
15512 }
15513
15514 public boolean isOptional() {
15515 return optional;
15516 }
15517
15518 public Object defaultValue() {
15519 return defaultValue;
15520 }
15521 }
15522
15523 public enum TypeConstraint implements OnnxTypeConstraint {
15524 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))),
15525 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int64())))),
15526 ;
15527
15528 final OnnxType.TypeVariable typeVariable;
15529
15530 TypeConstraint(OnnxType.TypeVariable typeVariable) {
15531 assert typeVariable.name().equals(name());
15532 this.typeVariable = typeVariable;
15533 }
15534
15535 @Override
15536 public OnnxType.TypeVariable typeVariable() {
15537 return typeVariable;
15538 }
15539 }
15540
15541 public enum InputParameter implements OnnxParameter {
15542 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15543 ;
15544
15545 final OnnxType type;
15546 final Quantifier quantifier;
15547
15548 InputParameter(OnnxType type, Quantifier quantifier) {
15549 this.type = type;
15550 this.quantifier = quantifier;
15551 }
15552
15553 @Override
15554 public OnnxType type() {
15555 return type;
15556 }
15557
15558 @Override
15559 public Quantifier quantifier() {
15560 return quantifier;
15561 }
15562 }
15563
15564 public enum OutputParameter implements OnnxParameter {
15565 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15566 Indices(TypeConstraint.I.typeVariable(), Quantifier.OPTIONAL),
15567 ;
15568
15569 final OnnxType type;
15570 final Quantifier quantifier;
15571
15572 OutputParameter(OnnxType type, Quantifier quantifier) {
15573 this.type = type;
15574 this.quantifier = quantifier;
15575 }
15576
15577 @Override
15578 public OnnxType type() {
15579 return type;
15580 }
15581
15582 @Override
15583 public Quantifier quantifier() {
15584 return quantifier;
15585 }
15586 }
15587
15588 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
15589 NAME,
15590 List.of(Attribute.values()),
15591 List.of(TypeConstraint.values()),
15592 List.of(InputParameter.values()),
15593 List.of(OutputParameter.values())
15594 );
15595
15596 public MaxPool(ExternalizedOp def) {
15597 super(SCHEMA, def);
15598 }
15599
15600 MaxPool(MaxPool that, CodeContext cc) {
15601 super(that, cc);
15602 }
15603
15604 @Override
15605 public MaxPool transform(CodeContext cc, CodeTransformer ot) {
15606 return new MaxPool(this, cc);
15607 }
15608
15609 MaxPool(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value X, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<Long> ceil_mode, java.util.Optional<Long> storage_order, java.util.Optional<long[]> strides, long[] kernel_shape) {
15610 super(SCHEMA, resultType, optionalOutputs, List.of(X), List.of(pads, dilations, auto_pad, ceil_mode, storage_order, strides, kernel_shape));
15611 }
15612
15613 @Override
15614 public SequencedSet<OnnxParameter> onnxOutputs() {
15615 return onnxOutputs(SCHEMA);
15616 }
15617
15618 @Override
15619 public SequencedMap<OnnxParameter, Object> onnxInputs() {
15620 return onnxInputs(SCHEMA, List.of(X()));
15621 }
15622
15623 public Value X() {
15624 return operands().get(0);
15625 }
15626
15627 public java.util.Optional<long[]> pads() {
15628 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
15629 return java.util.Optional.ofNullable(pads).map(long[]::clone);
15630 }
15631
15632 public java.util.Optional<long[]> dilations() {
15633 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
15634 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
15635 }
15636
15637 public java.util.Optional<String> auto_pad() {
15638 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes);
15639 return java.util.Optional.ofNullable(auto_pad);
15640 }
15641
15642 public java.util.Optional<Long> ceil_mode() {
15643 Long ceil_mode = Attribute.ceil_mode.access(Long.class, onnxAttributes);
15644 return java.util.Optional.ofNullable(ceil_mode);
15645 }
15646
15647 public java.util.Optional<Long> storage_order() {
15648 Long storage_order = Attribute.storage_order.access(Long.class, onnxAttributes);
15649 return java.util.Optional.ofNullable(storage_order);
15650 }
15651
15652 public java.util.Optional<long[]> strides() {
15653 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
15654 return java.util.Optional.ofNullable(strides).map(long[]::clone);
15655 }
15656
15657 public long[] kernel_shape() {
15658 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
15659 return kernel_shape.clone();
15660 }
15661
15662 }
15663
15664 public static MaxPool MaxPool(TypeElement resultType, Set<MaxPool.OutputParameter> optionalOutputs, Value X, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<Long> ceil_mode, java.util.Optional<Long> storage_order, java.util.Optional<long[]> strides, long[] kernel_shape) {
15665 return new MaxPool(resultType, optionalOutputs, X, pads, dilations, auto_pad, ceil_mode, storage_order, strides, kernel_shape);
15666 }
15667
15668 @OpFactoryHelper.OpDeclaration(MaxRoiPool.NAME)
15669 public static final class MaxRoiPool extends OnnxOp {
15670 public static final String NAME = "MaxRoiPool";
15671
15672 public enum Attribute implements OnnxAttribute {
15673 spatial_scale(Float.class, true, 1.0f),
15674 pooled_shape(long[].class, false, null),
15675 ;
15676
15677 final Class<?> t;
15678 final boolean optional;
15679 final Object defaultValue;
15680
15681 Attribute(Class<?> type, boolean optional, Object defaultValue) {
15682 this.t = type;
15683 this.optional = optional;
15684 this.defaultValue = defaultValue;
15685 assert optional || defaultValue == null;
15686 }
15687
15688 public Class<?> type() {
15689 return t;
15690 }
15691
15692 public boolean isOptional() {
15693 return optional;
15694 }
15695
15696 public Object defaultValue() {
15697 return defaultValue;
15698 }
15699 }
15700
15701 public enum TypeConstraint implements OnnxTypeConstraint {
15702 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
15703 ;
15704
15705 final OnnxType.TypeVariable typeVariable;
15706
15707 TypeConstraint(OnnxType.TypeVariable typeVariable) {
15708 assert typeVariable.name().equals(name());
15709 this.typeVariable = typeVariable;
15710 }
15711
15712 @Override
15713 public OnnxType.TypeVariable typeVariable() {
15714 return typeVariable;
15715 }
15716 }
15717
15718 public enum InputParameter implements OnnxParameter {
15719 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15720 rois(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15721 ;
15722
15723 final OnnxType type;
15724 final Quantifier quantifier;
15725
15726 InputParameter(OnnxType type, Quantifier quantifier) {
15727 this.type = type;
15728 this.quantifier = quantifier;
15729 }
15730
15731 @Override
15732 public OnnxType type() {
15733 return type;
15734 }
15735
15736 @Override
15737 public Quantifier quantifier() {
15738 return quantifier;
15739 }
15740 }
15741
15742 public enum OutputParameter implements OnnxParameter {
15743 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
15744 ;
15745
15746 final OnnxType type;
15747 final Quantifier quantifier;
15748
15749 OutputParameter(OnnxType type, Quantifier quantifier) {
15750 this.type = type;
15751 this.quantifier = quantifier;
15752 }
15753
15754 @Override
15755 public OnnxType type() {
15756 return type;
15757 }
15758
15759 @Override
15760 public Quantifier quantifier() {
15761 return quantifier;
15762 }
15763 }
15764
15765 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
15766 NAME,
15767 List.of(Attribute.values()),
15768 List.of(TypeConstraint.values()),
15769 List.of(InputParameter.values()),
15770 List.of(OutputParameter.values())
15771 );
15772
15773 public MaxRoiPool(ExternalizedOp def) {
15774 super(SCHEMA, def);
15775 }
15776
15777 MaxRoiPool(MaxRoiPool that, CodeContext cc) {
15778 super(that, cc);
15779 }
15780
15781 @Override
15782 public MaxRoiPool transform(CodeContext cc, CodeTransformer ot) {
15783 return new MaxRoiPool(this, cc);
15784 }
15785
15786 MaxRoiPool(TypeElement resultType, Value X, Value rois, java.util.Optional<Float> spatial_scale, long[] pooled_shape) {
15787 super(SCHEMA, resultType, Set.of(), List.of(X, rois), List.of(spatial_scale, pooled_shape));
15788 }
15789
15790 @Override
15791 public SequencedSet<OnnxParameter> onnxOutputs() {
15792 return onnxOutputs(SCHEMA);
15793 }
15794
15795 @Override
15796 public SequencedMap<OnnxParameter, Object> onnxInputs() {
15797 return onnxInputs(SCHEMA, List.of(X(), rois()));
15798 }
15799
15800 public Value X() {
15801 return operands().get(0);
15802 }
15803
15804 public Value rois() {
15805 return operands().get(1);
15806 }
15807
15808 public java.util.Optional<Float> spatial_scale() {
15809 Float spatial_scale = Attribute.spatial_scale.access(Float.class, onnxAttributes);
15810 return java.util.Optional.ofNullable(spatial_scale);
15811 }
15812
15813 public long[] pooled_shape() {
15814 long[] pooled_shape = Attribute.pooled_shape.access(long[].class, onnxAttributes);
15815 return pooled_shape.clone();
15816 }
15817
15818 }
15819
15820 public static MaxRoiPool MaxRoiPool(TypeElement resultType, Value X, Value rois, java.util.Optional<Float> spatial_scale, long[] pooled_shape) {
15821 return new MaxRoiPool(resultType, X, rois, spatial_scale, pooled_shape);
15822 }
15823
15824 @OpFactoryHelper.OpDeclaration(MaxUnpool.NAME)
15825 public static final class MaxUnpool extends OnnxOp {
15826 public static final String NAME = "MaxUnpool";
15827
15828 public enum Attribute implements OnnxAttribute {
15829 pads(long[].class, true, null),
15830 strides(long[].class, true, null),
15831 kernel_shape(long[].class, false, null),
15832 ;
15833
15834 final Class<?> t;
15835 final boolean optional;
15836 final Object defaultValue;
15837
15838 Attribute(Class<?> type, boolean optional, Object defaultValue) {
15839 this.t = type;
15840 this.optional = optional;
15841 this.defaultValue = defaultValue;
15842 assert optional || defaultValue == null;
15843 }
15844
15845 public Class<?> type() {
15846 return t;
15847 }
15848
15849 public boolean isOptional() {
15850 return optional;
15851 }
15852
15853 public Object defaultValue() {
15854 return defaultValue;
15855 }
15856 }
15857
15858 public enum TypeConstraint implements OnnxTypeConstraint {
15859 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
15860 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))),
15861 ;
15862
15863 final OnnxType.TypeVariable typeVariable;
15864
15865 TypeConstraint(OnnxType.TypeVariable typeVariable) {
15866 assert typeVariable.name().equals(name());
15867 this.typeVariable = typeVariable;
15868 }
15869
15870 @Override
15871 public OnnxType.TypeVariable typeVariable() {
15872 return typeVariable;
15873 }
15874 }
15875
15876 public enum InputParameter implements OnnxParameter {
15877 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
15878 I(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
15879 output_shape(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
15880 ;
15881
15882 final OnnxType type;
15883 final Quantifier quantifier;
15884
15885 InputParameter(OnnxType type, Quantifier quantifier) {
15886 this.type = type;
15887 this.quantifier = quantifier;
15888 }
15889
15890 @Override
15891 public OnnxType type() {
15892 return type;
15893 }
15894
15895 @Override
15896 public Quantifier quantifier() {
15897 return quantifier;
15898 }
15899 }
15900
15901 public enum OutputParameter implements OnnxParameter {
15902 output(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
15903 ;
15904
15905 final OnnxType type;
15906 final Quantifier quantifier;
15907
15908 OutputParameter(OnnxType type, Quantifier quantifier) {
15909 this.type = type;
15910 this.quantifier = quantifier;
15911 }
15912
15913 @Override
15914 public OnnxType type() {
15915 return type;
15916 }
15917
15918 @Override
15919 public Quantifier quantifier() {
15920 return quantifier;
15921 }
15922 }
15923
15924 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
15925 NAME,
15926 List.of(Attribute.values()),
15927 List.of(TypeConstraint.values()),
15928 List.of(InputParameter.values()),
15929 List.of(OutputParameter.values())
15930 );
15931
15932 public MaxUnpool(ExternalizedOp def) {
15933 super(SCHEMA, def);
15934 }
15935
15936 MaxUnpool(MaxUnpool that, CodeContext cc) {
15937 super(that, cc);
15938 }
15939
15940 @Override
15941 public MaxUnpool transform(CodeContext cc, CodeTransformer ot) {
15942 return new MaxUnpool(this, cc);
15943 }
15944
15945 MaxUnpool(TypeElement resultType, Value X, Value I, java.util.Optional<Value> output_shape, java.util.Optional<long[]> pads, java.util.Optional<long[]> strides, long[] kernel_shape) {
15946 super(SCHEMA, resultType, Set.of(), List.of(X, I, output_shape), List.of(pads, strides, kernel_shape));
15947 }
15948
15949 @Override
15950 public SequencedSet<OnnxParameter> onnxOutputs() {
15951 return onnxOutputs(SCHEMA);
15952 }
15953
15954 @Override
15955 public SequencedMap<OnnxParameter, Object> onnxInputs() {
15956 return onnxInputs(SCHEMA, List.of(X(), I(), output_shape()));
15957 }
15958
15959 public Value X() {
15960 return operands().get(0);
15961 }
15962
15963 public Value I() {
15964 return operands().get(1);
15965 }
15966
15967 public java.util.Optional<Value> output_shape() {
15968 int i = optionalInputArguments.indexOf(InputParameter.output_shape);
15969 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
15970 }
15971
15972 public java.util.Optional<long[]> pads() {
15973 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
15974 return java.util.Optional.ofNullable(pads).map(long[]::clone);
15975 }
15976
15977 public java.util.Optional<long[]> strides() {
15978 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
15979 return java.util.Optional.ofNullable(strides).map(long[]::clone);
15980 }
15981
15982 public long[] kernel_shape() {
15983 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
15984 return kernel_shape.clone();
15985 }
15986
15987 }
15988
15989 public static MaxUnpool MaxUnpool(TypeElement resultType, Value X, Value I, java.util.Optional<Value> output_shape, java.util.Optional<long[]> pads, java.util.Optional<long[]> strides, long[] kernel_shape) {
15990 return new MaxUnpool(resultType, X, I, output_shape, pads, strides, kernel_shape);
15991 }
15992
15993 @OpFactoryHelper.OpDeclaration(Mean.NAME)
15994 public static final class Mean extends OnnxOp {
15995 public static final String NAME = "Mean";
15996
15997 public enum Attribute implements OnnxAttribute.None { }
15998
15999 public enum TypeConstraint implements OnnxTypeConstraint {
16000 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
16001 ;
16002
16003 final OnnxType.TypeVariable typeVariable;
16004
16005 TypeConstraint(OnnxType.TypeVariable typeVariable) {
16006 assert typeVariable.name().equals(name());
16007 this.typeVariable = typeVariable;
16008 }
16009
16010 @Override
16011 public OnnxType.TypeVariable typeVariable() {
16012 return typeVariable;
16013 }
16014 }
16015
16016 public enum InputParameter implements OnnxParameter {
16017 data_0(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC),
16018 ;
16019
16020 final OnnxType type;
16021 final Quantifier quantifier;
16022
16023 InputParameter(OnnxType type, Quantifier quantifier) {
16024 this.type = type;
16025 this.quantifier = quantifier;
16026 }
16027
16028 @Override
16029 public OnnxType type() {
16030 return type;
16031 }
16032
16033 @Override
16034 public Quantifier quantifier() {
16035 return quantifier;
16036 }
16037 }
16038
16039 public enum OutputParameter implements OnnxParameter {
16040 mean(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16041 ;
16042
16043 final OnnxType type;
16044 final Quantifier quantifier;
16045
16046 OutputParameter(OnnxType type, Quantifier quantifier) {
16047 this.type = type;
16048 this.quantifier = quantifier;
16049 }
16050
16051 @Override
16052 public OnnxType type() {
16053 return type;
16054 }
16055
16056 @Override
16057 public Quantifier quantifier() {
16058 return quantifier;
16059 }
16060 }
16061
16062 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
16063 NAME,
16064 List.of(Attribute.values()),
16065 List.of(TypeConstraint.values()),
16066 List.of(InputParameter.values()),
16067 List.of(OutputParameter.values())
16068 );
16069
16070 public Mean(ExternalizedOp def) {
16071 super(SCHEMA, def);
16072 }
16073
16074 Mean(Mean that, CodeContext cc) {
16075 super(that, cc);
16076 }
16077
16078 @Override
16079 public Mean transform(CodeContext cc, CodeTransformer ot) {
16080 return new Mean(this, cc);
16081 }
16082
16083 Mean(TypeElement resultType, List<Value> data_0) {
16084 super(SCHEMA, resultType, Set.of(), List.of(data_0), List.of());
16085 }
16086
16087 @Override
16088 public SequencedSet<OnnxParameter> onnxOutputs() {
16089 return onnxOutputs(SCHEMA);
16090 }
16091
16092 @Override
16093 public SequencedMap<OnnxParameter, Object> onnxInputs() {
16094 return onnxInputs(SCHEMA, List.of(data_0()));
16095 }
16096
16097 public List<Value> data_0() {
16098 return operands();
16099 }
16100
16101 }
16102
16103 public static Mean Mean(TypeElement resultType, List<Value> data_0) {
16104 return new Mean(resultType, data_0);
16105 }
16106
16107 @OpFactoryHelper.OpDeclaration(MeanVarianceNormalization.NAME)
16108 public static final class MeanVarianceNormalization extends OnnxOp {
16109 public static final String NAME = "MeanVarianceNormalization";
16110
16111 public enum Attribute implements OnnxAttribute {
16112 axes(long[].class, true, null),
16113 ;
16114
16115 final Class<?> t;
16116 final boolean optional;
16117 final Object defaultValue;
16118
16119 Attribute(Class<?> type, boolean optional, Object defaultValue) {
16120 this.t = type;
16121 this.optional = optional;
16122 this.defaultValue = defaultValue;
16123 assert optional || defaultValue == null;
16124 }
16125
16126 public Class<?> type() {
16127 return t;
16128 }
16129
16130 public boolean isOptional() {
16131 return optional;
16132 }
16133
16134 public Object defaultValue() {
16135 return defaultValue;
16136 }
16137 }
16138
16139 public enum TypeConstraint implements OnnxTypeConstraint {
16140 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
16141 ;
16142
16143 final OnnxType.TypeVariable typeVariable;
16144
16145 TypeConstraint(OnnxType.TypeVariable typeVariable) {
16146 assert typeVariable.name().equals(name());
16147 this.typeVariable = typeVariable;
16148 }
16149
16150 @Override
16151 public OnnxType.TypeVariable typeVariable() {
16152 return typeVariable;
16153 }
16154 }
16155
16156 public enum InputParameter implements OnnxParameter {
16157 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16158 ;
16159
16160 final OnnxType type;
16161 final Quantifier quantifier;
16162
16163 InputParameter(OnnxType type, Quantifier quantifier) {
16164 this.type = type;
16165 this.quantifier = quantifier;
16166 }
16167
16168 @Override
16169 public OnnxType type() {
16170 return type;
16171 }
16172
16173 @Override
16174 public Quantifier quantifier() {
16175 return quantifier;
16176 }
16177 }
16178
16179 public enum OutputParameter implements OnnxParameter {
16180 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16181 ;
16182
16183 final OnnxType type;
16184 final Quantifier quantifier;
16185
16186 OutputParameter(OnnxType type, Quantifier quantifier) {
16187 this.type = type;
16188 this.quantifier = quantifier;
16189 }
16190
16191 @Override
16192 public OnnxType type() {
16193 return type;
16194 }
16195
16196 @Override
16197 public Quantifier quantifier() {
16198 return quantifier;
16199 }
16200 }
16201
16202 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
16203 NAME,
16204 List.of(Attribute.values()),
16205 List.of(TypeConstraint.values()),
16206 List.of(InputParameter.values()),
16207 List.of(OutputParameter.values())
16208 );
16209
16210 public MeanVarianceNormalization(ExternalizedOp def) {
16211 super(SCHEMA, def);
16212 }
16213
16214 MeanVarianceNormalization(MeanVarianceNormalization that, CodeContext cc) {
16215 super(that, cc);
16216 }
16217
16218 @Override
16219 public MeanVarianceNormalization transform(CodeContext cc, CodeTransformer ot) {
16220 return new MeanVarianceNormalization(this, cc);
16221 }
16222
16223 MeanVarianceNormalization(TypeElement resultType, Value X, java.util.Optional<long[]> axes) {
16224 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(axes));
16225 }
16226
16227 @Override
16228 public SequencedSet<OnnxParameter> onnxOutputs() {
16229 return onnxOutputs(SCHEMA);
16230 }
16231
16232 @Override
16233 public SequencedMap<OnnxParameter, Object> onnxInputs() {
16234 return onnxInputs(SCHEMA, List.of(X()));
16235 }
16236
16237 public Value X() {
16238 return operands().get(0);
16239 }
16240
16241 public java.util.Optional<long[]> axes() {
16242 long[] axes = Attribute.axes.access(long[].class, onnxAttributes);
16243 return java.util.Optional.ofNullable(axes).map(long[]::clone);
16244 }
16245
16246 }
16247
16248 public static MeanVarianceNormalization MeanVarianceNormalization(TypeElement resultType, Value X, java.util.Optional<long[]> axes) {
16249 return new MeanVarianceNormalization(resultType, X, axes);
16250 }
16251
16252 @OpFactoryHelper.OpDeclaration(MelWeightMatrix.NAME)
16253 public static final class MelWeightMatrix extends OnnxOp {
16254 public static final String NAME = "MelWeightMatrix";
16255
16256 public enum Attribute implements OnnxAttribute {
16257 output_datatype(Long.class, true, 1),
16258 ;
16259
16260 final Class<?> t;
16261 final boolean optional;
16262 final Object defaultValue;
16263
16264 Attribute(Class<?> type, boolean optional, Object defaultValue) {
16265 this.t = type;
16266 this.optional = optional;
16267 this.defaultValue = defaultValue;
16268 assert optional || defaultValue == null;
16269 }
16270
16271 public Class<?> type() {
16272 return t;
16273 }
16274
16275 public boolean isOptional() {
16276 return optional;
16277 }
16278
16279 public Object defaultValue() {
16280 return defaultValue;
16281 }
16282 }
16283
16284 public enum TypeConstraint implements OnnxTypeConstraint {
16285 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
16286 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
16287 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
16288 ;
16289
16290 final OnnxType.TypeVariable typeVariable;
16291
16292 TypeConstraint(OnnxType.TypeVariable typeVariable) {
16293 assert typeVariable.name().equals(name());
16294 this.typeVariable = typeVariable;
16295 }
16296
16297 @Override
16298 public OnnxType.TypeVariable typeVariable() {
16299 return typeVariable;
16300 }
16301 }
16302
16303 public enum InputParameter implements OnnxParameter {
16304 num_mel_bins(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
16305 dft_length(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
16306 sample_rate(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
16307 lower_edge_hertz(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
16308 upper_edge_hertz(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
16309 ;
16310
16311 final OnnxType type;
16312 final Quantifier quantifier;
16313
16314 InputParameter(OnnxType type, Quantifier quantifier) {
16315 this.type = type;
16316 this.quantifier = quantifier;
16317 }
16318
16319 @Override
16320 public OnnxType type() {
16321 return type;
16322 }
16323
16324 @Override
16325 public Quantifier quantifier() {
16326 return quantifier;
16327 }
16328 }
16329
16330 public enum OutputParameter implements OnnxParameter {
16331 output(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
16332 ;
16333
16334 final OnnxType type;
16335 final Quantifier quantifier;
16336
16337 OutputParameter(OnnxType type, Quantifier quantifier) {
16338 this.type = type;
16339 this.quantifier = quantifier;
16340 }
16341
16342 @Override
16343 public OnnxType type() {
16344 return type;
16345 }
16346
16347 @Override
16348 public Quantifier quantifier() {
16349 return quantifier;
16350 }
16351 }
16352
16353 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
16354 NAME,
16355 List.of(Attribute.values()),
16356 List.of(TypeConstraint.values()),
16357 List.of(InputParameter.values()),
16358 List.of(OutputParameter.values())
16359 );
16360
16361 public MelWeightMatrix(ExternalizedOp def) {
16362 super(SCHEMA, def);
16363 }
16364
16365 MelWeightMatrix(MelWeightMatrix that, CodeContext cc) {
16366 super(that, cc);
16367 }
16368
16369 @Override
16370 public MelWeightMatrix transform(CodeContext cc, CodeTransformer ot) {
16371 return new MelWeightMatrix(this, cc);
16372 }
16373
16374 MelWeightMatrix(TypeElement resultType, Value num_mel_bins, Value dft_length, Value sample_rate, Value lower_edge_hertz, Value upper_edge_hertz, java.util.Optional<Long> output_datatype) {
16375 super(SCHEMA, resultType, Set.of(), List.of(num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz), List.of(output_datatype));
16376 }
16377
16378 @Override
16379 public SequencedSet<OnnxParameter> onnxOutputs() {
16380 return onnxOutputs(SCHEMA);
16381 }
16382
16383 @Override
16384 public SequencedMap<OnnxParameter, Object> onnxInputs() {
16385 return onnxInputs(SCHEMA, List.of(num_mel_bins(), dft_length(), sample_rate(), lower_edge_hertz(), upper_edge_hertz()));
16386 }
16387
16388 public Value num_mel_bins() {
16389 return operands().get(0);
16390 }
16391
16392 public Value dft_length() {
16393 return operands().get(1);
16394 }
16395
16396 public Value sample_rate() {
16397 return operands().get(2);
16398 }
16399
16400 public Value lower_edge_hertz() {
16401 return operands().get(3);
16402 }
16403
16404 public Value upper_edge_hertz() {
16405 return operands().get(4);
16406 }
16407
16408 public java.util.Optional<Long> output_datatype() {
16409 Long output_datatype = Attribute.output_datatype.access(Long.class, onnxAttributes);
16410 return java.util.Optional.ofNullable(output_datatype);
16411 }
16412
16413 }
16414
16415 public static MelWeightMatrix MelWeightMatrix(TypeElement resultType, Value num_mel_bins, Value dft_length, Value sample_rate, Value lower_edge_hertz, Value upper_edge_hertz, java.util.Optional<Long> output_datatype) {
16416 return new MelWeightMatrix(resultType, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz, output_datatype);
16417 }
16418
16419 @OpFactoryHelper.OpDeclaration(Min.NAME)
16420 public static final class Min extends OnnxOp {
16421 public static final String NAME = "Min";
16422
16423 public enum Attribute implements OnnxAttribute.None { }
16424
16425 public enum TypeConstraint implements OnnxTypeConstraint {
16426 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
16427 ;
16428
16429 final OnnxType.TypeVariable typeVariable;
16430
16431 TypeConstraint(OnnxType.TypeVariable typeVariable) {
16432 assert typeVariable.name().equals(name());
16433 this.typeVariable = typeVariable;
16434 }
16435
16436 @Override
16437 public OnnxType.TypeVariable typeVariable() {
16438 return typeVariable;
16439 }
16440 }
16441
16442 public enum InputParameter implements OnnxParameter {
16443 data_0(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC),
16444 ;
16445
16446 final OnnxType type;
16447 final Quantifier quantifier;
16448
16449 InputParameter(OnnxType type, Quantifier quantifier) {
16450 this.type = type;
16451 this.quantifier = quantifier;
16452 }
16453
16454 @Override
16455 public OnnxType type() {
16456 return type;
16457 }
16458
16459 @Override
16460 public Quantifier quantifier() {
16461 return quantifier;
16462 }
16463 }
16464
16465 public enum OutputParameter implements OnnxParameter {
16466 min(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16467 ;
16468
16469 final OnnxType type;
16470 final Quantifier quantifier;
16471
16472 OutputParameter(OnnxType type, Quantifier quantifier) {
16473 this.type = type;
16474 this.quantifier = quantifier;
16475 }
16476
16477 @Override
16478 public OnnxType type() {
16479 return type;
16480 }
16481
16482 @Override
16483 public Quantifier quantifier() {
16484 return quantifier;
16485 }
16486 }
16487
16488 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
16489 NAME,
16490 List.of(Attribute.values()),
16491 List.of(TypeConstraint.values()),
16492 List.of(InputParameter.values()),
16493 List.of(OutputParameter.values())
16494 );
16495
16496 public Min(ExternalizedOp def) {
16497 super(SCHEMA, def);
16498 }
16499
16500 Min(Min that, CodeContext cc) {
16501 super(that, cc);
16502 }
16503
16504 @Override
16505 public Min transform(CodeContext cc, CodeTransformer ot) {
16506 return new Min(this, cc);
16507 }
16508
16509 Min(TypeElement resultType, List<Value> data_0) {
16510 super(SCHEMA, resultType, Set.of(), List.of(data_0), List.of());
16511 }
16512
16513 @Override
16514 public SequencedSet<OnnxParameter> onnxOutputs() {
16515 return onnxOutputs(SCHEMA);
16516 }
16517
16518 @Override
16519 public SequencedMap<OnnxParameter, Object> onnxInputs() {
16520 return onnxInputs(SCHEMA, List.of(data_0()));
16521 }
16522
16523 public List<Value> data_0() {
16524 return operands();
16525 }
16526
16527 }
16528
16529 public static Min Min(TypeElement resultType, List<Value> data_0) {
16530 return new Min(resultType, data_0);
16531 }
16532
16533 @OpFactoryHelper.OpDeclaration(Mish.NAME)
16534 public static final class Mish extends OnnxOp {
16535 public static final String NAME = "Mish";
16536
16537 public enum Attribute implements OnnxAttribute.None { }
16538
16539 public enum TypeConstraint implements OnnxTypeConstraint {
16540 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
16541 ;
16542
16543 final OnnxType.TypeVariable typeVariable;
16544
16545 TypeConstraint(OnnxType.TypeVariable typeVariable) {
16546 assert typeVariable.name().equals(name());
16547 this.typeVariable = typeVariable;
16548 }
16549
16550 @Override
16551 public OnnxType.TypeVariable typeVariable() {
16552 return typeVariable;
16553 }
16554 }
16555
16556 public enum InputParameter implements OnnxParameter {
16557 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16558 ;
16559
16560 final OnnxType type;
16561 final Quantifier quantifier;
16562
16563 InputParameter(OnnxType type, Quantifier quantifier) {
16564 this.type = type;
16565 this.quantifier = quantifier;
16566 }
16567
16568 @Override
16569 public OnnxType type() {
16570 return type;
16571 }
16572
16573 @Override
16574 public Quantifier quantifier() {
16575 return quantifier;
16576 }
16577 }
16578
16579 public enum OutputParameter implements OnnxParameter {
16580 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16581 ;
16582
16583 final OnnxType type;
16584 final Quantifier quantifier;
16585
16586 OutputParameter(OnnxType type, Quantifier quantifier) {
16587 this.type = type;
16588 this.quantifier = quantifier;
16589 }
16590
16591 @Override
16592 public OnnxType type() {
16593 return type;
16594 }
16595
16596 @Override
16597 public Quantifier quantifier() {
16598 return quantifier;
16599 }
16600 }
16601
16602 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
16603 NAME,
16604 List.of(Attribute.values()),
16605 List.of(TypeConstraint.values()),
16606 List.of(InputParameter.values()),
16607 List.of(OutputParameter.values())
16608 );
16609
16610 public Mish(ExternalizedOp def) {
16611 super(SCHEMA, def);
16612 }
16613
16614 Mish(Mish that, CodeContext cc) {
16615 super(that, cc);
16616 }
16617
16618 @Override
16619 public Mish transform(CodeContext cc, CodeTransformer ot) {
16620 return new Mish(this, cc);
16621 }
16622
16623 Mish(TypeElement resultType, Value X) {
16624 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
16625 }
16626
16627 @Override
16628 public SequencedSet<OnnxParameter> onnxOutputs() {
16629 return onnxOutputs(SCHEMA);
16630 }
16631
16632 @Override
16633 public SequencedMap<OnnxParameter, Object> onnxInputs() {
16634 return onnxInputs(SCHEMA, List.of(X()));
16635 }
16636
16637 public Value X() {
16638 return operands().get(0);
16639 }
16640
16641 }
16642
16643 public static Mish Mish(TypeElement resultType, Value X) {
16644 return new Mish(resultType, X);
16645 }
16646
16647 @OpFactoryHelper.OpDeclaration(Mod.NAME)
16648 public static final class Mod extends OnnxOp {
16649 public static final String NAME = "Mod";
16650
16651 public enum Attribute implements OnnxAttribute {
16652 fmod(Long.class, true, 0),
16653 ;
16654
16655 final Class<?> t;
16656 final boolean optional;
16657 final Object defaultValue;
16658
16659 Attribute(Class<?> type, boolean optional, Object defaultValue) {
16660 this.t = type;
16661 this.optional = optional;
16662 this.defaultValue = defaultValue;
16663 assert optional || defaultValue == null;
16664 }
16665
16666 public Class<?> type() {
16667 return t;
16668 }
16669
16670 public boolean isOptional() {
16671 return optional;
16672 }
16673
16674 public Object defaultValue() {
16675 return defaultValue;
16676 }
16677 }
16678
16679 public enum TypeConstraint implements OnnxTypeConstraint {
16680 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
16681 ;
16682
16683 final OnnxType.TypeVariable typeVariable;
16684
16685 TypeConstraint(OnnxType.TypeVariable typeVariable) {
16686 assert typeVariable.name().equals(name());
16687 this.typeVariable = typeVariable;
16688 }
16689
16690 @Override
16691 public OnnxType.TypeVariable typeVariable() {
16692 return typeVariable;
16693 }
16694 }
16695
16696 public enum InputParameter implements OnnxParameter {
16697 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16698 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16699 ;
16700
16701 final OnnxType type;
16702 final Quantifier quantifier;
16703
16704 InputParameter(OnnxType type, Quantifier quantifier) {
16705 this.type = type;
16706 this.quantifier = quantifier;
16707 }
16708
16709 @Override
16710 public OnnxType type() {
16711 return type;
16712 }
16713
16714 @Override
16715 public Quantifier quantifier() {
16716 return quantifier;
16717 }
16718 }
16719
16720 public enum OutputParameter implements OnnxParameter {
16721 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16722 ;
16723
16724 final OnnxType type;
16725 final Quantifier quantifier;
16726
16727 OutputParameter(OnnxType type, Quantifier quantifier) {
16728 this.type = type;
16729 this.quantifier = quantifier;
16730 }
16731
16732 @Override
16733 public OnnxType type() {
16734 return type;
16735 }
16736
16737 @Override
16738 public Quantifier quantifier() {
16739 return quantifier;
16740 }
16741 }
16742
16743 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
16744 NAME,
16745 List.of(Attribute.values()),
16746 List.of(TypeConstraint.values()),
16747 List.of(InputParameter.values()),
16748 List.of(OutputParameter.values())
16749 );
16750
16751 public Mod(ExternalizedOp def) {
16752 super(SCHEMA, def);
16753 }
16754
16755 Mod(Mod that, CodeContext cc) {
16756 super(that, cc);
16757 }
16758
16759 @Override
16760 public Mod transform(CodeContext cc, CodeTransformer ot) {
16761 return new Mod(this, cc);
16762 }
16763
16764 Mod(TypeElement resultType, Value A, Value B, java.util.Optional<Long> fmod) {
16765 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of(fmod));
16766 }
16767
16768 @Override
16769 public SequencedSet<OnnxParameter> onnxOutputs() {
16770 return onnxOutputs(SCHEMA);
16771 }
16772
16773 @Override
16774 public SequencedMap<OnnxParameter, Object> onnxInputs() {
16775 return onnxInputs(SCHEMA, List.of(A(), B()));
16776 }
16777
16778 public Value A() {
16779 return operands().get(0);
16780 }
16781
16782 public Value B() {
16783 return operands().get(1);
16784 }
16785
16786 public java.util.Optional<Long> fmod() {
16787 Long fmod = Attribute.fmod.access(Long.class, onnxAttributes);
16788 return java.util.Optional.ofNullable(fmod);
16789 }
16790
16791 }
16792
16793 public static Mod Mod(TypeElement resultType, Value A, Value B, java.util.Optional<Long> fmod) {
16794 return new Mod(resultType, A, B, fmod);
16795 }
16796
16797 @OpFactoryHelper.OpDeclaration(Momentum.NAME)
16798 public static final class Momentum extends OnnxOp {
16799 public static final String NAME = "Momentum";
16800
16801 public enum Attribute implements OnnxAttribute {
16802 mode(String.class, false, null),
16803 norm_coefficient(Float.class, false, null),
16804 alpha(Float.class, false, null),
16805 beta(Float.class, false, null),
16806 ;
16807
16808 final Class<?> t;
16809 final boolean optional;
16810 final Object defaultValue;
16811
16812 Attribute(Class<?> type, boolean optional, Object defaultValue) {
16813 this.t = type;
16814 this.optional = optional;
16815 this.defaultValue = defaultValue;
16816 assert optional || defaultValue == null;
16817 }
16818
16819 public Class<?> type() {
16820 return t;
16821 }
16822
16823 public boolean isOptional() {
16824 return optional;
16825 }
16826
16827 public Object defaultValue() {
16828 return defaultValue;
16829 }
16830 }
16831
16832 public enum TypeConstraint implements OnnxTypeConstraint {
16833 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
16834 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))),
16835 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
16836 ;
16837
16838 final OnnxType.TypeVariable typeVariable;
16839
16840 TypeConstraint(OnnxType.TypeVariable typeVariable) {
16841 assert typeVariable.name().equals(name());
16842 this.typeVariable = typeVariable;
16843 }
16844
16845 @Override
16846 public OnnxType.TypeVariable typeVariable() {
16847 return typeVariable;
16848 }
16849 }
16850
16851 public enum InputParameter implements OnnxParameter {
16852 R(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
16853 T(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
16854 inputs(TypeConstraint.T3.typeVariable(), Quantifier.VARIADIC),
16855 ;
16856
16857 final OnnxType type;
16858 final Quantifier quantifier;
16859
16860 InputParameter(OnnxType type, Quantifier quantifier) {
16861 this.type = type;
16862 this.quantifier = quantifier;
16863 }
16864
16865 @Override
16866 public OnnxType type() {
16867 return type;
16868 }
16869
16870 @Override
16871 public Quantifier quantifier() {
16872 return quantifier;
16873 }
16874 }
16875
16876 public enum OutputParameter implements OnnxParameter {
16877 outputs(TypeConstraint.T3.typeVariable(), Quantifier.VARIADIC),
16878 ;
16879
16880 final OnnxType type;
16881 final Quantifier quantifier;
16882
16883 OutputParameter(OnnxType type, Quantifier quantifier) {
16884 this.type = type;
16885 this.quantifier = quantifier;
16886 }
16887
16888 @Override
16889 public OnnxType type() {
16890 return type;
16891 }
16892
16893 @Override
16894 public Quantifier quantifier() {
16895 return quantifier;
16896 }
16897 }
16898
16899 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
16900 NAME,
16901 List.of(Attribute.values()),
16902 List.of(TypeConstraint.values()),
16903 List.of(InputParameter.values()),
16904 List.of(OutputParameter.values())
16905 );
16906
16907 public Momentum(ExternalizedOp def) {
16908 super(SCHEMA, def);
16909 }
16910
16911 Momentum(Momentum that, CodeContext cc) {
16912 super(that, cc);
16913 }
16914
16915 @Override
16916 public Momentum transform(CodeContext cc, CodeTransformer ot) {
16917 return new Momentum(this, cc);
16918 }
16919
16920 Momentum(TypeElement resultType, Value R, Value T, List<Value> inputs, String mode, float norm_coefficient, float alpha, float beta) {
16921 super(SCHEMA, resultType, Set.of(), List.of(R, T, inputs), List.of(mode, norm_coefficient, alpha, beta));
16922 }
16923
16924 @Override
16925 public SequencedSet<OnnxParameter> onnxOutputs() {
16926 return onnxOutputs(SCHEMA);
16927 }
16928
16929 @Override
16930 public SequencedMap<OnnxParameter, Object> onnxInputs() {
16931 return onnxInputs(SCHEMA, List.of(R(), T(), inputs()));
16932 }
16933
16934 public Value R() {
16935 return operands().get(0);
16936 }
16937
16938 public Value T() {
16939 return operands().get(1);
16940 }
16941
16942 public List<Value> inputs() {
16943 return operands().subList(2, operands().size());
16944 }
16945
16946 public String mode() {
16947 String mode = Attribute.mode.access(String.class, onnxAttributes);
16948 return mode;
16949 }
16950
16951 public float norm_coefficient() {
16952 float norm_coefficient = Attribute.norm_coefficient.access(Float.class, onnxAttributes);
16953 return norm_coefficient;
16954 }
16955
16956 public float alpha() {
16957 float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
16958 return alpha;
16959 }
16960
16961 public float beta() {
16962 float beta = Attribute.beta.access(Float.class, onnxAttributes);
16963 return beta;
16964 }
16965
16966 }
16967
16968 public static Momentum Momentum(TypeElement resultType, Value R, Value T, List<Value> inputs, String mode, float norm_coefficient, float alpha, float beta) {
16969 return new Momentum(resultType, R, T, inputs, mode, norm_coefficient, alpha, beta);
16970 }
16971
16972 @OpFactoryHelper.OpDeclaration(Mul.NAME)
16973 public static final class Mul extends OnnxOp {
16974 public static final String NAME = "Mul";
16975
16976 public enum Attribute implements OnnxAttribute.None { }
16977
16978 public enum TypeConstraint implements OnnxTypeConstraint {
16979 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
16980 ;
16981
16982 final OnnxType.TypeVariable typeVariable;
16983
16984 TypeConstraint(OnnxType.TypeVariable typeVariable) {
16985 assert typeVariable.name().equals(name());
16986 this.typeVariable = typeVariable;
16987 }
16988
16989 @Override
16990 public OnnxType.TypeVariable typeVariable() {
16991 return typeVariable;
16992 }
16993 }
16994
16995 public enum InputParameter implements OnnxParameter {
16996 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16997 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
16998 ;
16999
17000 final OnnxType type;
17001 final Quantifier quantifier;
17002
17003 InputParameter(OnnxType type, Quantifier quantifier) {
17004 this.type = type;
17005 this.quantifier = quantifier;
17006 }
17007
17008 @Override
17009 public OnnxType type() {
17010 return type;
17011 }
17012
17013 @Override
17014 public Quantifier quantifier() {
17015 return quantifier;
17016 }
17017 }
17018
17019 public enum OutputParameter implements OnnxParameter {
17020 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17021 ;
17022
17023 final OnnxType type;
17024 final Quantifier quantifier;
17025
17026 OutputParameter(OnnxType type, Quantifier quantifier) {
17027 this.type = type;
17028 this.quantifier = quantifier;
17029 }
17030
17031 @Override
17032 public OnnxType type() {
17033 return type;
17034 }
17035
17036 @Override
17037 public Quantifier quantifier() {
17038 return quantifier;
17039 }
17040 }
17041
17042 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
17043 NAME,
17044 List.of(Attribute.values()),
17045 List.of(TypeConstraint.values()),
17046 List.of(InputParameter.values()),
17047 List.of(OutputParameter.values())
17048 );
17049
17050 public Mul(ExternalizedOp def) {
17051 super(SCHEMA, def);
17052 }
17053
17054 Mul(Mul that, CodeContext cc) {
17055 super(that, cc);
17056 }
17057
17058 @Override
17059 public Mul transform(CodeContext cc, CodeTransformer ot) {
17060 return new Mul(this, cc);
17061 }
17062
17063 Mul(TypeElement resultType, Value A, Value B) {
17064 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
17065 }
17066
17067 @Override
17068 public SequencedSet<OnnxParameter> onnxOutputs() {
17069 return onnxOutputs(SCHEMA);
17070 }
17071
17072 @Override
17073 public SequencedMap<OnnxParameter, Object> onnxInputs() {
17074 return onnxInputs(SCHEMA, List.of(A(), B()));
17075 }
17076
17077 public Value A() {
17078 return operands().get(0);
17079 }
17080
17081 public Value B() {
17082 return operands().get(1);
17083 }
17084
17085 }
17086
17087 public static Mul Mul(TypeElement resultType, Value A, Value B) {
17088 return new Mul(resultType, A, B);
17089 }
17090
17091 @OpFactoryHelper.OpDeclaration(Multinomial.NAME)
17092 public static final class Multinomial extends OnnxOp {
17093 public static final String NAME = "Multinomial";
17094
17095 public enum Attribute implements OnnxAttribute {
17096 seed(Float.class, true, null),
17097 sample_size(Long.class, true, 1),
17098 dtype(Long.class, true, 6),
17099 ;
17100
17101 final Class<?> t;
17102 final boolean optional;
17103 final Object defaultValue;
17104
17105 Attribute(Class<?> type, boolean optional, Object defaultValue) {
17106 this.t = type;
17107 this.optional = optional;
17108 this.defaultValue = defaultValue;
17109 assert optional || defaultValue == null;
17110 }
17111
17112 public Class<?> type() {
17113 return t;
17114 }
17115
17116 public boolean isOptional() {
17117 return optional;
17118 }
17119
17120 public Object defaultValue() {
17121 return defaultValue;
17122 }
17123 }
17124
17125 public enum TypeConstraint implements OnnxTypeConstraint {
17126 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
17127 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
17128 ;
17129
17130 final OnnxType.TypeVariable typeVariable;
17131
17132 TypeConstraint(OnnxType.TypeVariable typeVariable) {
17133 assert typeVariable.name().equals(name());
17134 this.typeVariable = typeVariable;
17135 }
17136
17137 @Override
17138 public OnnxType.TypeVariable typeVariable() {
17139 return typeVariable;
17140 }
17141 }
17142
17143 public enum InputParameter implements OnnxParameter {
17144 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
17145 ;
17146
17147 final OnnxType type;
17148 final Quantifier quantifier;
17149
17150 InputParameter(OnnxType type, Quantifier quantifier) {
17151 this.type = type;
17152 this.quantifier = quantifier;
17153 }
17154
17155 @Override
17156 public OnnxType type() {
17157 return type;
17158 }
17159
17160 @Override
17161 public Quantifier quantifier() {
17162 return quantifier;
17163 }
17164 }
17165
17166 public enum OutputParameter implements OnnxParameter {
17167 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
17168 ;
17169
17170 final OnnxType type;
17171 final Quantifier quantifier;
17172
17173 OutputParameter(OnnxType type, Quantifier quantifier) {
17174 this.type = type;
17175 this.quantifier = quantifier;
17176 }
17177
17178 @Override
17179 public OnnxType type() {
17180 return type;
17181 }
17182
17183 @Override
17184 public Quantifier quantifier() {
17185 return quantifier;
17186 }
17187 }
17188
17189 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
17190 NAME,
17191 List.of(Attribute.values()),
17192 List.of(TypeConstraint.values()),
17193 List.of(InputParameter.values()),
17194 List.of(OutputParameter.values())
17195 );
17196
17197 public Multinomial(ExternalizedOp def) {
17198 super(SCHEMA, def);
17199 }
17200
17201 Multinomial(Multinomial that, CodeContext cc) {
17202 super(that, cc);
17203 }
17204
17205 @Override
17206 public Multinomial transform(CodeContext cc, CodeTransformer ot) {
17207 return new Multinomial(this, cc);
17208 }
17209
17210 Multinomial(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Long> sample_size, java.util.Optional<Long> dtype) {
17211 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(seed, sample_size, dtype));
17212 }
17213
17214 @Override
17215 public SequencedSet<OnnxParameter> onnxOutputs() {
17216 return onnxOutputs(SCHEMA);
17217 }
17218
17219 @Override
17220 public SequencedMap<OnnxParameter, Object> onnxInputs() {
17221 return onnxInputs(SCHEMA, List.of(input()));
17222 }
17223
17224 public Value input() {
17225 return operands().get(0);
17226 }
17227
17228 public java.util.Optional<Float> seed() {
17229 Float seed = Attribute.seed.access(Float.class, onnxAttributes);
17230 return java.util.Optional.ofNullable(seed);
17231 }
17232
17233 public java.util.Optional<Long> sample_size() {
17234 Long sample_size = Attribute.sample_size.access(Long.class, onnxAttributes);
17235 return java.util.Optional.ofNullable(sample_size);
17236 }
17237
17238 public java.util.Optional<Long> dtype() {
17239 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes);
17240 return java.util.Optional.ofNullable(dtype);
17241 }
17242
17243 }
17244
17245 public static Multinomial Multinomial(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Long> sample_size, java.util.Optional<Long> dtype) {
17246 return new Multinomial(resultType, input, seed, sample_size, dtype);
17247 }
17248
17249 @OpFactoryHelper.OpDeclaration(Neg.NAME)
17250 public static final class Neg extends OnnxOp {
17251 public static final String NAME = "Neg";
17252
17253 public enum Attribute implements OnnxAttribute.None { }
17254
17255 public enum TypeConstraint implements OnnxTypeConstraint {
17256 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
17257 ;
17258
17259 final OnnxType.TypeVariable typeVariable;
17260
17261 TypeConstraint(OnnxType.TypeVariable typeVariable) {
17262 assert typeVariable.name().equals(name());
17263 this.typeVariable = typeVariable;
17264 }
17265
17266 @Override
17267 public OnnxType.TypeVariable typeVariable() {
17268 return typeVariable;
17269 }
17270 }
17271
17272 public enum InputParameter implements OnnxParameter {
17273 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17274 ;
17275
17276 final OnnxType type;
17277 final Quantifier quantifier;
17278
17279 InputParameter(OnnxType type, Quantifier quantifier) {
17280 this.type = type;
17281 this.quantifier = quantifier;
17282 }
17283
17284 @Override
17285 public OnnxType type() {
17286 return type;
17287 }
17288
17289 @Override
17290 public Quantifier quantifier() {
17291 return quantifier;
17292 }
17293 }
17294
17295 public enum OutputParameter implements OnnxParameter {
17296 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17297 ;
17298
17299 final OnnxType type;
17300 final Quantifier quantifier;
17301
17302 OutputParameter(OnnxType type, Quantifier quantifier) {
17303 this.type = type;
17304 this.quantifier = quantifier;
17305 }
17306
17307 @Override
17308 public OnnxType type() {
17309 return type;
17310 }
17311
17312 @Override
17313 public Quantifier quantifier() {
17314 return quantifier;
17315 }
17316 }
17317
17318 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
17319 NAME,
17320 List.of(Attribute.values()),
17321 List.of(TypeConstraint.values()),
17322 List.of(InputParameter.values()),
17323 List.of(OutputParameter.values())
17324 );
17325
17326 public Neg(ExternalizedOp def) {
17327 super(SCHEMA, def);
17328 }
17329
17330 Neg(Neg that, CodeContext cc) {
17331 super(that, cc);
17332 }
17333
17334 @Override
17335 public Neg transform(CodeContext cc, CodeTransformer ot) {
17336 return new Neg(this, cc);
17337 }
17338
17339 Neg(TypeElement resultType, Value X) {
17340 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
17341 }
17342
17343 @Override
17344 public SequencedSet<OnnxParameter> onnxOutputs() {
17345 return onnxOutputs(SCHEMA);
17346 }
17347
17348 @Override
17349 public SequencedMap<OnnxParameter, Object> onnxInputs() {
17350 return onnxInputs(SCHEMA, List.of(X()));
17351 }
17352
17353 public Value X() {
17354 return operands().get(0);
17355 }
17356
17357 }
17358
17359 public static Neg Neg(TypeElement resultType, Value X) {
17360 return new Neg(resultType, X);
17361 }
17362
17363 @OpFactoryHelper.OpDeclaration(NegativeLogLikelihoodLoss.NAME)
17364 public static final class NegativeLogLikelihoodLoss extends OnnxOp {
17365 public static final String NAME = "NegativeLogLikelihoodLoss";
17366
17367 public enum Attribute implements OnnxAttribute {
17368 ignore_index(Long.class, true, null),
17369 reduction(String.class, true, "mean"),
17370 ;
17371
17372 final Class<?> t;
17373 final boolean optional;
17374 final Object defaultValue;
17375
17376 Attribute(Class<?> type, boolean optional, Object defaultValue) {
17377 this.t = type;
17378 this.optional = optional;
17379 this.defaultValue = defaultValue;
17380 assert optional || defaultValue == null;
17381 }
17382
17383 public Class<?> type() {
17384 return t;
17385 }
17386
17387 public boolean isOptional() {
17388 return optional;
17389 }
17390
17391 public Object defaultValue() {
17392 return defaultValue;
17393 }
17394 }
17395
17396 public enum TypeConstraint implements OnnxTypeConstraint {
17397 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
17398 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
17399 ;
17400
17401 final OnnxType.TypeVariable typeVariable;
17402
17403 TypeConstraint(OnnxType.TypeVariable typeVariable) {
17404 assert typeVariable.name().equals(name());
17405 this.typeVariable = typeVariable;
17406 }
17407
17408 @Override
17409 public OnnxType.TypeVariable typeVariable() {
17410 return typeVariable;
17411 }
17412 }
17413
17414 public enum InputParameter implements OnnxParameter {
17415 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17416 target(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
17417 weight(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
17418 ;
17419
17420 final OnnxType type;
17421 final Quantifier quantifier;
17422
17423 InputParameter(OnnxType type, Quantifier quantifier) {
17424 this.type = type;
17425 this.quantifier = quantifier;
17426 }
17427
17428 @Override
17429 public OnnxType type() {
17430 return type;
17431 }
17432
17433 @Override
17434 public Quantifier quantifier() {
17435 return quantifier;
17436 }
17437 }
17438
17439 public enum OutputParameter implements OnnxParameter {
17440 loss(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17441 ;
17442
17443 final OnnxType type;
17444 final Quantifier quantifier;
17445
17446 OutputParameter(OnnxType type, Quantifier quantifier) {
17447 this.type = type;
17448 this.quantifier = quantifier;
17449 }
17450
17451 @Override
17452 public OnnxType type() {
17453 return type;
17454 }
17455
17456 @Override
17457 public Quantifier quantifier() {
17458 return quantifier;
17459 }
17460 }
17461
17462 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
17463 NAME,
17464 List.of(Attribute.values()),
17465 List.of(TypeConstraint.values()),
17466 List.of(InputParameter.values()),
17467 List.of(OutputParameter.values())
17468 );
17469
17470 public NegativeLogLikelihoodLoss(ExternalizedOp def) {
17471 super(SCHEMA, def);
17472 }
17473
17474 NegativeLogLikelihoodLoss(NegativeLogLikelihoodLoss that, CodeContext cc) {
17475 super(that, cc);
17476 }
17477
17478 @Override
17479 public NegativeLogLikelihoodLoss transform(CodeContext cc, CodeTransformer ot) {
17480 return new NegativeLogLikelihoodLoss(this, cc);
17481 }
17482
17483 NegativeLogLikelihoodLoss(TypeElement resultType, Value input, Value target, java.util.Optional<Value> weight, java.util.Optional<Long> ignore_index, java.util.Optional<String> reduction) {
17484 super(SCHEMA, resultType, Set.of(), List.of(input, target, weight), List.of(ignore_index, reduction));
17485 }
17486
17487 @Override
17488 public SequencedSet<OnnxParameter> onnxOutputs() {
17489 return onnxOutputs(SCHEMA);
17490 }
17491
17492 @Override
17493 public SequencedMap<OnnxParameter, Object> onnxInputs() {
17494 return onnxInputs(SCHEMA, List.of(input(), target(), weight()));
17495 }
17496
17497 public Value input() {
17498 return operands().get(0);
17499 }
17500
17501 public Value target() {
17502 return operands().get(1);
17503 }
17504
17505 public java.util.Optional<Value> weight() {
17506 int i = optionalInputArguments.indexOf(InputParameter.weight);
17507 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
17508 }
17509
17510 public java.util.Optional<Long> ignore_index() {
17511 Long ignore_index = Attribute.ignore_index.access(Long.class, onnxAttributes);
17512 return java.util.Optional.ofNullable(ignore_index);
17513 }
17514
17515 public java.util.Optional<String> reduction() {
17516 String reduction = Attribute.reduction.access(String.class, onnxAttributes);
17517 return java.util.Optional.ofNullable(reduction);
17518 }
17519
17520 }
17521
17522 public static NegativeLogLikelihoodLoss NegativeLogLikelihoodLoss(TypeElement resultType, Value input, Value target, java.util.Optional<Value> weight, java.util.Optional<Long> ignore_index, java.util.Optional<String> reduction) {
17523 return new NegativeLogLikelihoodLoss(resultType, input, target, weight, ignore_index, reduction);
17524 }
17525
17526 @OpFactoryHelper.OpDeclaration(NonMaxSuppression.NAME)
17527 public static final class NonMaxSuppression extends OnnxOp {
17528 public static final String NAME = "NonMaxSuppression";
17529
17530 public enum Attribute implements OnnxAttribute {
17531 center_point_box(Long.class, true, 0),
17532 ;
17533
17534 final Class<?> t;
17535 final boolean optional;
17536 final Object defaultValue;
17537
17538 Attribute(Class<?> type, boolean optional, Object defaultValue) {
17539 this.t = type;
17540 this.optional = optional;
17541 this.defaultValue = defaultValue;
17542 assert optional || defaultValue == null;
17543 }
17544
17545 public Class<?> type() {
17546 return t;
17547 }
17548
17549 public boolean isOptional() {
17550 return optional;
17551 }
17552
17553 public Object defaultValue() {
17554 return defaultValue;
17555 }
17556 }
17557
17558 public enum TypeConstraint implements OnnxTypeConstraint.None { }
17559
17560 public enum InputParameter implements OnnxParameter {
17561 boxes(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
17562 scores(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
17563 max_output_boxes_per_class(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
17564 iou_threshold(OnnxType.tensor(OnnxType.float32()), Quantifier.OPTIONAL),
17565 score_threshold(OnnxType.tensor(OnnxType.float32()), Quantifier.OPTIONAL),
17566 ;
17567
17568 final OnnxType type;
17569 final Quantifier quantifier;
17570
17571 InputParameter(OnnxType type, Quantifier quantifier) {
17572 this.type = type;
17573 this.quantifier = quantifier;
17574 }
17575
17576 @Override
17577 public OnnxType type() {
17578 return type;
17579 }
17580
17581 @Override
17582 public Quantifier quantifier() {
17583 return quantifier;
17584 }
17585 }
17586
17587 public enum OutputParameter implements OnnxParameter {
17588 selected_indices(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
17589 ;
17590
17591 final OnnxType type;
17592 final Quantifier quantifier;
17593
17594 OutputParameter(OnnxType type, Quantifier quantifier) {
17595 this.type = type;
17596 this.quantifier = quantifier;
17597 }
17598
17599 @Override
17600 public OnnxType type() {
17601 return type;
17602 }
17603
17604 @Override
17605 public Quantifier quantifier() {
17606 return quantifier;
17607 }
17608 }
17609
17610 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
17611 NAME,
17612 List.of(Attribute.values()),
17613 List.of(TypeConstraint.values()),
17614 List.of(InputParameter.values()),
17615 List.of(OutputParameter.values())
17616 );
17617
17618 public NonMaxSuppression(ExternalizedOp def) {
17619 super(SCHEMA, def);
17620 }
17621
17622 NonMaxSuppression(NonMaxSuppression that, CodeContext cc) {
17623 super(that, cc);
17624 }
17625
17626 @Override
17627 public NonMaxSuppression transform(CodeContext cc, CodeTransformer ot) {
17628 return new NonMaxSuppression(this, cc);
17629 }
17630
17631 NonMaxSuppression(TypeElement resultType, Value boxes, Value scores, java.util.Optional<Value> max_output_boxes_per_class, java.util.Optional<Value> iou_threshold, java.util.Optional<Value> score_threshold, java.util.Optional<Long> center_point_box) {
17632 super(SCHEMA, resultType, Set.of(), List.of(boxes, scores, max_output_boxes_per_class, iou_threshold, score_threshold), List.of(center_point_box));
17633 }
17634
17635 @Override
17636 public SequencedSet<OnnxParameter> onnxOutputs() {
17637 return onnxOutputs(SCHEMA);
17638 }
17639
17640 @Override
17641 public SequencedMap<OnnxParameter, Object> onnxInputs() {
17642 return onnxInputs(SCHEMA, List.of(boxes(), scores(), max_output_boxes_per_class(), iou_threshold(), score_threshold()));
17643 }
17644
17645 public Value boxes() {
17646 return operands().get(0);
17647 }
17648
17649 public Value scores() {
17650 return operands().get(1);
17651 }
17652
17653 public java.util.Optional<Value> max_output_boxes_per_class() {
17654 int i = optionalInputArguments.indexOf(InputParameter.max_output_boxes_per_class);
17655 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
17656 }
17657
17658 public java.util.Optional<Value> iou_threshold() {
17659 int i = optionalInputArguments.indexOf(InputParameter.iou_threshold);
17660 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
17661 }
17662
17663 public java.util.Optional<Value> score_threshold() {
17664 int i = optionalInputArguments.indexOf(InputParameter.score_threshold);
17665 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
17666 }
17667
17668 public java.util.Optional<Long> center_point_box() {
17669 Long center_point_box = Attribute.center_point_box.access(Long.class, onnxAttributes);
17670 return java.util.Optional.ofNullable(center_point_box);
17671 }
17672
17673 }
17674
17675 public static NonMaxSuppression NonMaxSuppression(TypeElement resultType, Value boxes, Value scores, java.util.Optional<Value> max_output_boxes_per_class, java.util.Optional<Value> iou_threshold, java.util.Optional<Value> score_threshold, java.util.Optional<Long> center_point_box) {
17676 return new NonMaxSuppression(resultType, boxes, scores, max_output_boxes_per_class, iou_threshold, score_threshold, center_point_box);
17677 }
17678
17679 @OpFactoryHelper.OpDeclaration(NonZero.NAME)
17680 public static final class NonZero extends OnnxOp {
17681 public static final String NAME = "NonZero";
17682
17683 public enum Attribute implements OnnxAttribute.None { }
17684
17685 public enum TypeConstraint implements OnnxTypeConstraint {
17686 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
17687 ;
17688
17689 final OnnxType.TypeVariable typeVariable;
17690
17691 TypeConstraint(OnnxType.TypeVariable typeVariable) {
17692 assert typeVariable.name().equals(name());
17693 this.typeVariable = typeVariable;
17694 }
17695
17696 @Override
17697 public OnnxType.TypeVariable typeVariable() {
17698 return typeVariable;
17699 }
17700 }
17701
17702 public enum InputParameter implements OnnxParameter {
17703 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17704 ;
17705
17706 final OnnxType type;
17707 final Quantifier quantifier;
17708
17709 InputParameter(OnnxType type, Quantifier quantifier) {
17710 this.type = type;
17711 this.quantifier = quantifier;
17712 }
17713
17714 @Override
17715 public OnnxType type() {
17716 return type;
17717 }
17718
17719 @Override
17720 public Quantifier quantifier() {
17721 return quantifier;
17722 }
17723 }
17724
17725 public enum OutputParameter implements OnnxParameter {
17726 Y(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
17727 ;
17728
17729 final OnnxType type;
17730 final Quantifier quantifier;
17731
17732 OutputParameter(OnnxType type, Quantifier quantifier) {
17733 this.type = type;
17734 this.quantifier = quantifier;
17735 }
17736
17737 @Override
17738 public OnnxType type() {
17739 return type;
17740 }
17741
17742 @Override
17743 public Quantifier quantifier() {
17744 return quantifier;
17745 }
17746 }
17747
17748 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
17749 NAME,
17750 List.of(Attribute.values()),
17751 List.of(TypeConstraint.values()),
17752 List.of(InputParameter.values()),
17753 List.of(OutputParameter.values())
17754 );
17755
17756 public NonZero(ExternalizedOp def) {
17757 super(SCHEMA, def);
17758 }
17759
17760 NonZero(NonZero that, CodeContext cc) {
17761 super(that, cc);
17762 }
17763
17764 @Override
17765 public NonZero transform(CodeContext cc, CodeTransformer ot) {
17766 return new NonZero(this, cc);
17767 }
17768
17769 NonZero(TypeElement resultType, Value X) {
17770 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
17771 }
17772
17773 @Override
17774 public SequencedSet<OnnxParameter> onnxOutputs() {
17775 return onnxOutputs(SCHEMA);
17776 }
17777
17778 @Override
17779 public SequencedMap<OnnxParameter, Object> onnxInputs() {
17780 return onnxInputs(SCHEMA, List.of(X()));
17781 }
17782
17783 public Value X() {
17784 return operands().get(0);
17785 }
17786
17787 }
17788
17789 public static NonZero NonZero(TypeElement resultType, Value X) {
17790 return new NonZero(resultType, X);
17791 }
17792
17793 @OpFactoryHelper.OpDeclaration(Normalizer.NAME)
17794 public static final class Normalizer extends OnnxOp {
17795 public static final String NAME = "Normalizer";
17796
17797 public enum Attribute implements OnnxAttribute {
17798 norm(String.class, true, "MAX"),
17799 ;
17800
17801 final Class<?> t;
17802 final boolean optional;
17803 final Object defaultValue;
17804
17805 Attribute(Class<?> type, boolean optional, Object defaultValue) {
17806 this.t = type;
17807 this.optional = optional;
17808 this.defaultValue = defaultValue;
17809 assert optional || defaultValue == null;
17810 }
17811
17812 public Class<?> type() {
17813 return t;
17814 }
17815
17816 public boolean isOptional() {
17817 return optional;
17818 }
17819
17820 public Object defaultValue() {
17821 return defaultValue;
17822 }
17823 }
17824
17825 public enum TypeConstraint implements OnnxTypeConstraint {
17826 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
17827 ;
17828
17829 final OnnxType.TypeVariable typeVariable;
17830
17831 TypeConstraint(OnnxType.TypeVariable typeVariable) {
17832 assert typeVariable.name().equals(name());
17833 this.typeVariable = typeVariable;
17834 }
17835
17836 @Override
17837 public OnnxType.TypeVariable typeVariable() {
17838 return typeVariable;
17839 }
17840 }
17841
17842 public enum InputParameter implements OnnxParameter {
17843 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17844 ;
17845
17846 final OnnxType type;
17847 final Quantifier quantifier;
17848
17849 InputParameter(OnnxType type, Quantifier quantifier) {
17850 this.type = type;
17851 this.quantifier = quantifier;
17852 }
17853
17854 @Override
17855 public OnnxType type() {
17856 return type;
17857 }
17858
17859 @Override
17860 public Quantifier quantifier() {
17861 return quantifier;
17862 }
17863 }
17864
17865 public enum OutputParameter implements OnnxParameter {
17866 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
17867 ;
17868
17869 final OnnxType type;
17870 final Quantifier quantifier;
17871
17872 OutputParameter(OnnxType type, Quantifier quantifier) {
17873 this.type = type;
17874 this.quantifier = quantifier;
17875 }
17876
17877 @Override
17878 public OnnxType type() {
17879 return type;
17880 }
17881
17882 @Override
17883 public Quantifier quantifier() {
17884 return quantifier;
17885 }
17886 }
17887
17888 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
17889 NAME,
17890 List.of(Attribute.values()),
17891 List.of(TypeConstraint.values()),
17892 List.of(InputParameter.values()),
17893 List.of(OutputParameter.values())
17894 );
17895
17896 public Normalizer(ExternalizedOp def) {
17897 super(SCHEMA, def);
17898 }
17899
17900 Normalizer(Normalizer that, CodeContext cc) {
17901 super(that, cc);
17902 }
17903
17904 @Override
17905 public Normalizer transform(CodeContext cc, CodeTransformer ot) {
17906 return new Normalizer(this, cc);
17907 }
17908
17909 Normalizer(TypeElement resultType, Value X, java.util.Optional<String> norm) {
17910 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(norm));
17911 }
17912
17913 @Override
17914 public SequencedSet<OnnxParameter> onnxOutputs() {
17915 return onnxOutputs(SCHEMA);
17916 }
17917
17918 @Override
17919 public SequencedMap<OnnxParameter, Object> onnxInputs() {
17920 return onnxInputs(SCHEMA, List.of(X()));
17921 }
17922
17923 public Value X() {
17924 return operands().get(0);
17925 }
17926
17927 public java.util.Optional<String> norm() {
17928 String norm = Attribute.norm.access(String.class, onnxAttributes);
17929 return java.util.Optional.ofNullable(norm);
17930 }
17931
17932 }
17933
17934 public static Normalizer Normalizer(TypeElement resultType, Value X, java.util.Optional<String> norm) {
17935 return new Normalizer(resultType, X, norm);
17936 }
17937
17938 @OpFactoryHelper.OpDeclaration(Not.NAME)
17939 public static final class Not extends OnnxOp {
17940 public static final String NAME = "Not";
17941
17942 public enum Attribute implements OnnxAttribute.None { }
17943
17944 public enum TypeConstraint implements OnnxTypeConstraint {
17945 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bool())))),
17946 ;
17947
17948 final OnnxType.TypeVariable typeVariable;
17949
17950 TypeConstraint(OnnxType.TypeVariable typeVariable) {
17951 assert typeVariable.name().equals(name());
17952 this.typeVariable = typeVariable;
17953 }
17954
17955 @Override
17956 public OnnxType.TypeVariable typeVariable() {
17957 return typeVariable;
17958 }
17959 }
17960
17961 public enum InputParameter implements OnnxParameter {
17962 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17963 ;
17964
17965 final OnnxType type;
17966 final Quantifier quantifier;
17967
17968 InputParameter(OnnxType type, Quantifier quantifier) {
17969 this.type = type;
17970 this.quantifier = quantifier;
17971 }
17972
17973 @Override
17974 public OnnxType type() {
17975 return type;
17976 }
17977
17978 @Override
17979 public Quantifier quantifier() {
17980 return quantifier;
17981 }
17982 }
17983
17984 public enum OutputParameter implements OnnxParameter {
17985 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
17986 ;
17987
17988 final OnnxType type;
17989 final Quantifier quantifier;
17990
17991 OutputParameter(OnnxType type, Quantifier quantifier) {
17992 this.type = type;
17993 this.quantifier = quantifier;
17994 }
17995
17996 @Override
17997 public OnnxType type() {
17998 return type;
17999 }
18000
18001 @Override
18002 public Quantifier quantifier() {
18003 return quantifier;
18004 }
18005 }
18006
18007 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
18008 NAME,
18009 List.of(Attribute.values()),
18010 List.of(TypeConstraint.values()),
18011 List.of(InputParameter.values()),
18012 List.of(OutputParameter.values())
18013 );
18014
18015 public Not(ExternalizedOp def) {
18016 super(SCHEMA, def);
18017 }
18018
18019 Not(Not that, CodeContext cc) {
18020 super(that, cc);
18021 }
18022
18023 @Override
18024 public Not transform(CodeContext cc, CodeTransformer ot) {
18025 return new Not(this, cc);
18026 }
18027
18028 Not(TypeElement resultType, Value X) {
18029 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
18030 }
18031
18032 @Override
18033 public SequencedSet<OnnxParameter> onnxOutputs() {
18034 return onnxOutputs(SCHEMA);
18035 }
18036
18037 @Override
18038 public SequencedMap<OnnxParameter, Object> onnxInputs() {
18039 return onnxInputs(SCHEMA, List.of(X()));
18040 }
18041
18042 public Value X() {
18043 return operands().get(0);
18044 }
18045
18046 }
18047
18048 public static Not Not(TypeElement resultType, Value X) {
18049 return new Not(resultType, X);
18050 }
18051
18052 @OpFactoryHelper.OpDeclaration(OneHot.NAME)
18053 public static final class OneHot extends OnnxOp {
18054 public static final String NAME = "OneHot";
18055
18056 public enum Attribute implements OnnxAttribute {
18057 axis(Long.class, true, -1),
18058 ;
18059
18060 final Class<?> t;
18061 final boolean optional;
18062 final Object defaultValue;
18063
18064 Attribute(Class<?> type, boolean optional, Object defaultValue) {
18065 this.t = type;
18066 this.optional = optional;
18067 this.defaultValue = defaultValue;
18068 assert optional || defaultValue == null;
18069 }
18070
18071 public Class<?> type() {
18072 return t;
18073 }
18074
18075 public boolean isOptional() {
18076 return optional;
18077 }
18078
18079 public Object defaultValue() {
18080 return defaultValue;
18081 }
18082 }
18083
18084 public enum TypeConstraint implements OnnxTypeConstraint {
18085 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
18086 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
18087 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
18088 ;
18089
18090 final OnnxType.TypeVariable typeVariable;
18091
18092 TypeConstraint(OnnxType.TypeVariable typeVariable) {
18093 assert typeVariable.name().equals(name());
18094 this.typeVariable = typeVariable;
18095 }
18096
18097 @Override
18098 public OnnxType.TypeVariable typeVariable() {
18099 return typeVariable;
18100 }
18101 }
18102
18103 public enum InputParameter implements OnnxParameter {
18104 indices(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
18105 depth(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
18106 values(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
18107 ;
18108
18109 final OnnxType type;
18110 final Quantifier quantifier;
18111
18112 InputParameter(OnnxType type, Quantifier quantifier) {
18113 this.type = type;
18114 this.quantifier = quantifier;
18115 }
18116
18117 @Override
18118 public OnnxType type() {
18119 return type;
18120 }
18121
18122 @Override
18123 public Quantifier quantifier() {
18124 return quantifier;
18125 }
18126 }
18127
18128 public enum OutputParameter implements OnnxParameter {
18129 output(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
18130 ;
18131
18132 final OnnxType type;
18133 final Quantifier quantifier;
18134
18135 OutputParameter(OnnxType type, Quantifier quantifier) {
18136 this.type = type;
18137 this.quantifier = quantifier;
18138 }
18139
18140 @Override
18141 public OnnxType type() {
18142 return type;
18143 }
18144
18145 @Override
18146 public Quantifier quantifier() {
18147 return quantifier;
18148 }
18149 }
18150
18151 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
18152 NAME,
18153 List.of(Attribute.values()),
18154 List.of(TypeConstraint.values()),
18155 List.of(InputParameter.values()),
18156 List.of(OutputParameter.values())
18157 );
18158
18159 public OneHot(ExternalizedOp def) {
18160 super(SCHEMA, def);
18161 }
18162
18163 OneHot(OneHot that, CodeContext cc) {
18164 super(that, cc);
18165 }
18166
18167 @Override
18168 public OneHot transform(CodeContext cc, CodeTransformer ot) {
18169 return new OneHot(this, cc);
18170 }
18171
18172 OneHot(TypeElement resultType, Value indices, Value depth, Value values, java.util.Optional<Long> axis) {
18173 super(SCHEMA, resultType, Set.of(), List.of(indices, depth, values), List.of(axis));
18174 }
18175
18176 @Override
18177 public SequencedSet<OnnxParameter> onnxOutputs() {
18178 return onnxOutputs(SCHEMA);
18179 }
18180
18181 @Override
18182 public SequencedMap<OnnxParameter, Object> onnxInputs() {
18183 return onnxInputs(SCHEMA, List.of(indices(), depth(), values()));
18184 }
18185
18186 public Value indices() {
18187 return operands().get(0);
18188 }
18189
18190 public Value depth() {
18191 return operands().get(1);
18192 }
18193
18194 public Value values() {
18195 return operands().get(2);
18196 }
18197
18198 public java.util.Optional<Long> axis() {
18199 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
18200 return java.util.Optional.ofNullable(axis);
18201 }
18202
18203 }
18204
18205 public static OneHot OneHot(TypeElement resultType, Value indices, Value depth, Value values, java.util.Optional<Long> axis) {
18206 return new OneHot(resultType, indices, depth, values, axis);
18207 }
18208
18209 @OpFactoryHelper.OpDeclaration(OneHotEncoder.NAME)
18210 public static final class OneHotEncoder extends OnnxOp {
18211 public static final String NAME = "OneHotEncoder";
18212
18213 public enum Attribute implements OnnxAttribute {
18214 cats_strings(String[].class, true, null),
18215 cats_int64s(long[].class, true, null),
18216 zeros(Long.class, true, 1),
18217 ;
18218
18219 final Class<?> t;
18220 final boolean optional;
18221 final Object defaultValue;
18222
18223 Attribute(Class<?> type, boolean optional, Object defaultValue) {
18224 this.t = type;
18225 this.optional = optional;
18226 this.defaultValue = defaultValue;
18227 assert optional || defaultValue == null;
18228 }
18229
18230 public Class<?> type() {
18231 return t;
18232 }
18233
18234 public boolean isOptional() {
18235 return optional;
18236 }
18237
18238 public Object defaultValue() {
18239 return defaultValue;
18240 }
18241 }
18242
18243 public enum TypeConstraint implements OnnxTypeConstraint {
18244 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
18245 ;
18246
18247 final OnnxType.TypeVariable typeVariable;
18248
18249 TypeConstraint(OnnxType.TypeVariable typeVariable) {
18250 assert typeVariable.name().equals(name());
18251 this.typeVariable = typeVariable;
18252 }
18253
18254 @Override
18255 public OnnxType.TypeVariable typeVariable() {
18256 return typeVariable;
18257 }
18258 }
18259
18260 public enum InputParameter implements OnnxParameter {
18261 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
18262 ;
18263
18264 final OnnxType type;
18265 final Quantifier quantifier;
18266
18267 InputParameter(OnnxType type, Quantifier quantifier) {
18268 this.type = type;
18269 this.quantifier = quantifier;
18270 }
18271
18272 @Override
18273 public OnnxType type() {
18274 return type;
18275 }
18276
18277 @Override
18278 public Quantifier quantifier() {
18279 return quantifier;
18280 }
18281 }
18282
18283 public enum OutputParameter implements OnnxParameter {
18284 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
18285 ;
18286
18287 final OnnxType type;
18288 final Quantifier quantifier;
18289
18290 OutputParameter(OnnxType type, Quantifier quantifier) {
18291 this.type = type;
18292 this.quantifier = quantifier;
18293 }
18294
18295 @Override
18296 public OnnxType type() {
18297 return type;
18298 }
18299
18300 @Override
18301 public Quantifier quantifier() {
18302 return quantifier;
18303 }
18304 }
18305
18306 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
18307 NAME,
18308 List.of(Attribute.values()),
18309 List.of(TypeConstraint.values()),
18310 List.of(InputParameter.values()),
18311 List.of(OutputParameter.values())
18312 );
18313
18314 public OneHotEncoder(ExternalizedOp def) {
18315 super(SCHEMA, def);
18316 }
18317
18318 OneHotEncoder(OneHotEncoder that, CodeContext cc) {
18319 super(that, cc);
18320 }
18321
18322 @Override
18323 public OneHotEncoder transform(CodeContext cc, CodeTransformer ot) {
18324 return new OneHotEncoder(this, cc);
18325 }
18326
18327 OneHotEncoder(TypeElement resultType, Value X, java.util.Optional<String[]> cats_strings, java.util.Optional<long[]> cats_int64s, java.util.Optional<Long> zeros) {
18328 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(cats_strings, cats_int64s, zeros));
18329 }
18330
18331 @Override
18332 public SequencedSet<OnnxParameter> onnxOutputs() {
18333 return onnxOutputs(SCHEMA);
18334 }
18335
18336 @Override
18337 public SequencedMap<OnnxParameter, Object> onnxInputs() {
18338 return onnxInputs(SCHEMA, List.of(X()));
18339 }
18340
18341 public Value X() {
18342 return operands().get(0);
18343 }
18344
18345 public java.util.Optional<String[]> cats_strings() {
18346 String[] cats_strings = Attribute.cats_strings.access(String[].class, onnxAttributes);
18347 return java.util.Optional.ofNullable(cats_strings).map(String[]::clone);
18348 }
18349
18350 public java.util.Optional<long[]> cats_int64s() {
18351 long[] cats_int64s = Attribute.cats_int64s.access(long[].class, onnxAttributes);
18352 return java.util.Optional.ofNullable(cats_int64s).map(long[]::clone);
18353 }
18354
18355 public java.util.Optional<Long> zeros() {
18356 Long zeros = Attribute.zeros.access(Long.class, onnxAttributes);
18357 return java.util.Optional.ofNullable(zeros);
18358 }
18359
18360 }
18361
18362 public static OneHotEncoder OneHotEncoder(TypeElement resultType, Value X, java.util.Optional<String[]> cats_strings, java.util.Optional<long[]> cats_int64s, java.util.Optional<Long> zeros) {
18363 return new OneHotEncoder(resultType, X, cats_strings, cats_int64s, zeros);
18364 }
18365
18366 @OpFactoryHelper.OpDeclaration(Optional.NAME)
18367 public static final class Optional extends OnnxOp {
18368 public static final String NAME = "Optional";
18369
18370 public enum Attribute implements OnnxAttribute {
18371 type(Object.class, true, null),
18372 ;
18373
18374 final Class<?> t;
18375 final boolean optional;
18376 final Object defaultValue;
18377
18378 Attribute(Class<?> type, boolean optional, Object defaultValue) {
18379 this.t = type;
18380 this.optional = optional;
18381 this.defaultValue = defaultValue;
18382 assert optional || defaultValue == null;
18383 }
18384
18385 public Class<?> type() {
18386 return t;
18387 }
18388
18389 public boolean isOptional() {
18390 return optional;
18391 }
18392
18393 public Object defaultValue() {
18394 return defaultValue;
18395 }
18396 }
18397
18398 public enum TypeConstraint implements OnnxTypeConstraint {
18399 V(new OnnxType.TypeVariable("V", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
18400 O(new OnnxType.TypeVariable("O", List.of(OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint8()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int8()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.string()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.bool()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.complex64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))), OnnxType.optional(OnnxType.tensor(OnnxType.uint8())), OnnxType.optional(OnnxType.tensor(OnnxType.uint16())), OnnxType.optional(OnnxType.tensor(OnnxType.uint32())), OnnxType.optional(OnnxType.tensor(OnnxType.uint64())), OnnxType.optional(OnnxType.tensor(OnnxType.int8())), OnnxType.optional(OnnxType.tensor(OnnxType.int16())), OnnxType.optional(OnnxType.tensor(OnnxType.int32())), OnnxType.optional(OnnxType.tensor(OnnxType.int64())), OnnxType.optional(OnnxType.tensor(OnnxType.float16())), OnnxType.optional(OnnxType.tensor(OnnxType.float32())), OnnxType.optional(OnnxType.tensor(OnnxType.float64())), OnnxType.optional(OnnxType.tensor(OnnxType.string())), OnnxType.optional(OnnxType.tensor(OnnxType.bool())), OnnxType.optional(OnnxType.tensor(OnnxType.complex64())), OnnxType.optional(OnnxType.tensor(OnnxType.complex128()))))),
18401 ;
18402
18403 final OnnxType.TypeVariable typeVariable;
18404
18405 TypeConstraint(OnnxType.TypeVariable typeVariable) {
18406 assert typeVariable.name().equals(name());
18407 this.typeVariable = typeVariable;
18408 }
18409
18410 @Override
18411 public OnnxType.TypeVariable typeVariable() {
18412 return typeVariable;
18413 }
18414 }
18415
18416 public enum InputParameter implements OnnxParameter {
18417 input(TypeConstraint.V.typeVariable(), Quantifier.OPTIONAL),
18418 ;
18419
18420 final OnnxType type;
18421 final Quantifier quantifier;
18422
18423 InputParameter(OnnxType type, Quantifier quantifier) {
18424 this.type = type;
18425 this.quantifier = quantifier;
18426 }
18427
18428 @Override
18429 public OnnxType type() {
18430 return type;
18431 }
18432
18433 @Override
18434 public Quantifier quantifier() {
18435 return quantifier;
18436 }
18437 }
18438
18439 public enum OutputParameter implements OnnxParameter {
18440 output(TypeConstraint.O.typeVariable(), Quantifier.REQUIRED),
18441 ;
18442
18443 final OnnxType type;
18444 final Quantifier quantifier;
18445
18446 OutputParameter(OnnxType type, Quantifier quantifier) {
18447 this.type = type;
18448 this.quantifier = quantifier;
18449 }
18450
18451 @Override
18452 public OnnxType type() {
18453 return type;
18454 }
18455
18456 @Override
18457 public Quantifier quantifier() {
18458 return quantifier;
18459 }
18460 }
18461
18462 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
18463 NAME,
18464 List.of(Attribute.values()),
18465 List.of(TypeConstraint.values()),
18466 List.of(InputParameter.values()),
18467 List.of(OutputParameter.values())
18468 );
18469
18470 public Optional(ExternalizedOp def) {
18471 super(SCHEMA, def);
18472 }
18473
18474 Optional(Optional that, CodeContext cc) {
18475 super(that, cc);
18476 }
18477
18478 @Override
18479 public Optional transform(CodeContext cc, CodeTransformer ot) {
18480 return new Optional(this, cc);
18481 }
18482
18483 Optional(TypeElement resultType, java.util.Optional<Value> input, java.util.Optional<Object> type) {
18484 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(type));
18485 }
18486
18487 @Override
18488 public SequencedSet<OnnxParameter> onnxOutputs() {
18489 return onnxOutputs(SCHEMA);
18490 }
18491
18492 @Override
18493 public SequencedMap<OnnxParameter, Object> onnxInputs() {
18494 return onnxInputs(SCHEMA, List.of(input()));
18495 }
18496
18497 public java.util.Optional<Value> input() {
18498 int i = optionalInputArguments.indexOf(InputParameter.input);
18499 return i != -1 ? java.util.Optional.of(operands().get(0 + i)) : java.util.Optional.empty();
18500 }
18501
18502 public java.util.Optional<Object> type() {
18503 Object type = Attribute.type.access(Object.class, onnxAttributes);
18504 return java.util.Optional.ofNullable(type);
18505 }
18506
18507 }
18508
18509 public static Optional Optional(TypeElement resultType, java.util.Optional<Value> input, java.util.Optional<Object> type) {
18510 return new Optional(resultType, input, type);
18511 }
18512
18513 @OpFactoryHelper.OpDeclaration(OptionalGetElement.NAME)
18514 public static final class OptionalGetElement extends OnnxOp {
18515 public static final String NAME = "OptionalGetElement";
18516
18517 public enum Attribute implements OnnxAttribute.None { }
18518
18519 public enum TypeConstraint implements OnnxTypeConstraint {
18520 O(new OnnxType.TypeVariable("O", List.of(OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint8()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int8()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.string()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.bool()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.complex64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))), OnnxType.optional(OnnxType.tensor(OnnxType.uint8())), OnnxType.optional(OnnxType.tensor(OnnxType.uint16())), OnnxType.optional(OnnxType.tensor(OnnxType.uint32())), OnnxType.optional(OnnxType.tensor(OnnxType.uint64())), OnnxType.optional(OnnxType.tensor(OnnxType.int8())), OnnxType.optional(OnnxType.tensor(OnnxType.int16())), OnnxType.optional(OnnxType.tensor(OnnxType.int32())), OnnxType.optional(OnnxType.tensor(OnnxType.int64())), OnnxType.optional(OnnxType.tensor(OnnxType.float16())), OnnxType.optional(OnnxType.tensor(OnnxType.float32())), OnnxType.optional(OnnxType.tensor(OnnxType.float64())), OnnxType.optional(OnnxType.tensor(OnnxType.string())), OnnxType.optional(OnnxType.tensor(OnnxType.bool())), OnnxType.optional(OnnxType.tensor(OnnxType.complex64())), OnnxType.optional(OnnxType.tensor(OnnxType.complex128())), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
18521 V(new OnnxType.TypeVariable("V", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
18522 ;
18523
18524 final OnnxType.TypeVariable typeVariable;
18525
18526 TypeConstraint(OnnxType.TypeVariable typeVariable) {
18527 assert typeVariable.name().equals(name());
18528 this.typeVariable = typeVariable;
18529 }
18530
18531 @Override
18532 public OnnxType.TypeVariable typeVariable() {
18533 return typeVariable;
18534 }
18535 }
18536
18537 public enum InputParameter implements OnnxParameter {
18538 input(TypeConstraint.O.typeVariable(), Quantifier.REQUIRED),
18539 ;
18540
18541 final OnnxType type;
18542 final Quantifier quantifier;
18543
18544 InputParameter(OnnxType type, Quantifier quantifier) {
18545 this.type = type;
18546 this.quantifier = quantifier;
18547 }
18548
18549 @Override
18550 public OnnxType type() {
18551 return type;
18552 }
18553
18554 @Override
18555 public Quantifier quantifier() {
18556 return quantifier;
18557 }
18558 }
18559
18560 public enum OutputParameter implements OnnxParameter {
18561 output(TypeConstraint.V.typeVariable(), Quantifier.REQUIRED),
18562 ;
18563
18564 final OnnxType type;
18565 final Quantifier quantifier;
18566
18567 OutputParameter(OnnxType type, Quantifier quantifier) {
18568 this.type = type;
18569 this.quantifier = quantifier;
18570 }
18571
18572 @Override
18573 public OnnxType type() {
18574 return type;
18575 }
18576
18577 @Override
18578 public Quantifier quantifier() {
18579 return quantifier;
18580 }
18581 }
18582
18583 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
18584 NAME,
18585 List.of(Attribute.values()),
18586 List.of(TypeConstraint.values()),
18587 List.of(InputParameter.values()),
18588 List.of(OutputParameter.values())
18589 );
18590
18591 public OptionalGetElement(ExternalizedOp def) {
18592 super(SCHEMA, def);
18593 }
18594
18595 OptionalGetElement(OptionalGetElement that, CodeContext cc) {
18596 super(that, cc);
18597 }
18598
18599 @Override
18600 public OptionalGetElement transform(CodeContext cc, CodeTransformer ot) {
18601 return new OptionalGetElement(this, cc);
18602 }
18603
18604 OptionalGetElement(TypeElement resultType, Value input) {
18605 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
18606 }
18607
18608 @Override
18609 public SequencedSet<OnnxParameter> onnxOutputs() {
18610 return onnxOutputs(SCHEMA);
18611 }
18612
18613 @Override
18614 public SequencedMap<OnnxParameter, Object> onnxInputs() {
18615 return onnxInputs(SCHEMA, List.of(input()));
18616 }
18617
18618 public Value input() {
18619 return operands().get(0);
18620 }
18621
18622 }
18623
18624 public static OptionalGetElement OptionalGetElement(TypeElement resultType, Value input) {
18625 return new OptionalGetElement(resultType, input);
18626 }
18627
18628 @OpFactoryHelper.OpDeclaration(OptionalHasElement.NAME)
18629 public static final class OptionalHasElement extends OnnxOp {
18630 public static final String NAME = "OptionalHasElement";
18631
18632 public enum Attribute implements OnnxAttribute.None { }
18633
18634 public enum TypeConstraint implements OnnxTypeConstraint {
18635 O(new OnnxType.TypeVariable("O", List.of(OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint8()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.uint64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int8()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.int64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float16()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float32()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.float64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.string()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.bool()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.complex64()))), OnnxType.optional(OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))), OnnxType.optional(OnnxType.tensor(OnnxType.uint8())), OnnxType.optional(OnnxType.tensor(OnnxType.uint16())), OnnxType.optional(OnnxType.tensor(OnnxType.uint32())), OnnxType.optional(OnnxType.tensor(OnnxType.uint64())), OnnxType.optional(OnnxType.tensor(OnnxType.int8())), OnnxType.optional(OnnxType.tensor(OnnxType.int16())), OnnxType.optional(OnnxType.tensor(OnnxType.int32())), OnnxType.optional(OnnxType.tensor(OnnxType.int64())), OnnxType.optional(OnnxType.tensor(OnnxType.float16())), OnnxType.optional(OnnxType.tensor(OnnxType.float32())), OnnxType.optional(OnnxType.tensor(OnnxType.float64())), OnnxType.optional(OnnxType.tensor(OnnxType.string())), OnnxType.optional(OnnxType.tensor(OnnxType.bool())), OnnxType.optional(OnnxType.tensor(OnnxType.complex64())), OnnxType.optional(OnnxType.tensor(OnnxType.complex128())), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
18636 B(new OnnxType.TypeVariable("B", List.of(OnnxType.tensor(OnnxType.bool())))),
18637 ;
18638
18639 final OnnxType.TypeVariable typeVariable;
18640
18641 TypeConstraint(OnnxType.TypeVariable typeVariable) {
18642 assert typeVariable.name().equals(name());
18643 this.typeVariable = typeVariable;
18644 }
18645
18646 @Override
18647 public OnnxType.TypeVariable typeVariable() {
18648 return typeVariable;
18649 }
18650 }
18651
18652 public enum InputParameter implements OnnxParameter {
18653 input(TypeConstraint.O.typeVariable(), Quantifier.OPTIONAL),
18654 ;
18655
18656 final OnnxType type;
18657 final Quantifier quantifier;
18658
18659 InputParameter(OnnxType type, Quantifier quantifier) {
18660 this.type = type;
18661 this.quantifier = quantifier;
18662 }
18663
18664 @Override
18665 public OnnxType type() {
18666 return type;
18667 }
18668
18669 @Override
18670 public Quantifier quantifier() {
18671 return quantifier;
18672 }
18673 }
18674
18675 public enum OutputParameter implements OnnxParameter {
18676 output(TypeConstraint.B.typeVariable(), Quantifier.REQUIRED),
18677 ;
18678
18679 final OnnxType type;
18680 final Quantifier quantifier;
18681
18682 OutputParameter(OnnxType type, Quantifier quantifier) {
18683 this.type = type;
18684 this.quantifier = quantifier;
18685 }
18686
18687 @Override
18688 public OnnxType type() {
18689 return type;
18690 }
18691
18692 @Override
18693 public Quantifier quantifier() {
18694 return quantifier;
18695 }
18696 }
18697
18698 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
18699 NAME,
18700 List.of(Attribute.values()),
18701 List.of(TypeConstraint.values()),
18702 List.of(InputParameter.values()),
18703 List.of(OutputParameter.values())
18704 );
18705
18706 public OptionalHasElement(ExternalizedOp def) {
18707 super(SCHEMA, def);
18708 }
18709
18710 OptionalHasElement(OptionalHasElement that, CodeContext cc) {
18711 super(that, cc);
18712 }
18713
18714 @Override
18715 public OptionalHasElement transform(CodeContext cc, CodeTransformer ot) {
18716 return new OptionalHasElement(this, cc);
18717 }
18718
18719 OptionalHasElement(TypeElement resultType, java.util.Optional<Value> input) {
18720 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
18721 }
18722
18723 @Override
18724 public SequencedSet<OnnxParameter> onnxOutputs() {
18725 return onnxOutputs(SCHEMA);
18726 }
18727
18728 @Override
18729 public SequencedMap<OnnxParameter, Object> onnxInputs() {
18730 return onnxInputs(SCHEMA, List.of(input()));
18731 }
18732
18733 public java.util.Optional<Value> input() {
18734 int i = optionalInputArguments.indexOf(InputParameter.input);
18735 return i != -1 ? java.util.Optional.of(operands().get(0 + i)) : java.util.Optional.empty();
18736 }
18737
18738 }
18739
18740 public static OptionalHasElement OptionalHasElement(TypeElement resultType, java.util.Optional<Value> input) {
18741 return new OptionalHasElement(resultType, input);
18742 }
18743
18744 @OpFactoryHelper.OpDeclaration(Or.NAME)
18745 public static final class Or extends OnnxOp {
18746 public static final String NAME = "Or";
18747
18748 public enum Attribute implements OnnxAttribute.None { }
18749
18750 public enum TypeConstraint implements OnnxTypeConstraint {
18751 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bool())))),
18752 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
18753 ;
18754
18755 final OnnxType.TypeVariable typeVariable;
18756
18757 TypeConstraint(OnnxType.TypeVariable typeVariable) {
18758 assert typeVariable.name().equals(name());
18759 this.typeVariable = typeVariable;
18760 }
18761
18762 @Override
18763 public OnnxType.TypeVariable typeVariable() {
18764 return typeVariable;
18765 }
18766 }
18767
18768 public enum InputParameter implements OnnxParameter {
18769 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
18770 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
18771 ;
18772
18773 final OnnxType type;
18774 final Quantifier quantifier;
18775
18776 InputParameter(OnnxType type, Quantifier quantifier) {
18777 this.type = type;
18778 this.quantifier = quantifier;
18779 }
18780
18781 @Override
18782 public OnnxType type() {
18783 return type;
18784 }
18785
18786 @Override
18787 public Quantifier quantifier() {
18788 return quantifier;
18789 }
18790 }
18791
18792 public enum OutputParameter implements OnnxParameter {
18793 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
18794 ;
18795
18796 final OnnxType type;
18797 final Quantifier quantifier;
18798
18799 OutputParameter(OnnxType type, Quantifier quantifier) {
18800 this.type = type;
18801 this.quantifier = quantifier;
18802 }
18803
18804 @Override
18805 public OnnxType type() {
18806 return type;
18807 }
18808
18809 @Override
18810 public Quantifier quantifier() {
18811 return quantifier;
18812 }
18813 }
18814
18815 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
18816 NAME,
18817 List.of(Attribute.values()),
18818 List.of(TypeConstraint.values()),
18819 List.of(InputParameter.values()),
18820 List.of(OutputParameter.values())
18821 );
18822
18823 public Or(ExternalizedOp def) {
18824 super(SCHEMA, def);
18825 }
18826
18827 Or(Or that, CodeContext cc) {
18828 super(that, cc);
18829 }
18830
18831 @Override
18832 public Or transform(CodeContext cc, CodeTransformer ot) {
18833 return new Or(this, cc);
18834 }
18835
18836 Or(TypeElement resultType, Value A, Value B) {
18837 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
18838 }
18839
18840 @Override
18841 public SequencedSet<OnnxParameter> onnxOutputs() {
18842 return onnxOutputs(SCHEMA);
18843 }
18844
18845 @Override
18846 public SequencedMap<OnnxParameter, Object> onnxInputs() {
18847 return onnxInputs(SCHEMA, List.of(A(), B()));
18848 }
18849
18850 public Value A() {
18851 return operands().get(0);
18852 }
18853
18854 public Value B() {
18855 return operands().get(1);
18856 }
18857
18858 }
18859
18860 public static Or Or(TypeElement resultType, Value A, Value B) {
18861 return new Or(resultType, A, B);
18862 }
18863
18864 @OpFactoryHelper.OpDeclaration(PRelu.NAME)
18865 public static final class PRelu extends OnnxOp {
18866 public static final String NAME = "PRelu";
18867
18868 public enum Attribute implements OnnxAttribute.None { }
18869
18870 public enum TypeConstraint implements OnnxTypeConstraint {
18871 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
18872 ;
18873
18874 final OnnxType.TypeVariable typeVariable;
18875
18876 TypeConstraint(OnnxType.TypeVariable typeVariable) {
18877 assert typeVariable.name().equals(name());
18878 this.typeVariable = typeVariable;
18879 }
18880
18881 @Override
18882 public OnnxType.TypeVariable typeVariable() {
18883 return typeVariable;
18884 }
18885 }
18886
18887 public enum InputParameter implements OnnxParameter {
18888 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
18889 slope(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
18890 ;
18891
18892 final OnnxType type;
18893 final Quantifier quantifier;
18894
18895 InputParameter(OnnxType type, Quantifier quantifier) {
18896 this.type = type;
18897 this.quantifier = quantifier;
18898 }
18899
18900 @Override
18901 public OnnxType type() {
18902 return type;
18903 }
18904
18905 @Override
18906 public Quantifier quantifier() {
18907 return quantifier;
18908 }
18909 }
18910
18911 public enum OutputParameter implements OnnxParameter {
18912 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
18913 ;
18914
18915 final OnnxType type;
18916 final Quantifier quantifier;
18917
18918 OutputParameter(OnnxType type, Quantifier quantifier) {
18919 this.type = type;
18920 this.quantifier = quantifier;
18921 }
18922
18923 @Override
18924 public OnnxType type() {
18925 return type;
18926 }
18927
18928 @Override
18929 public Quantifier quantifier() {
18930 return quantifier;
18931 }
18932 }
18933
18934 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
18935 NAME,
18936 List.of(Attribute.values()),
18937 List.of(TypeConstraint.values()),
18938 List.of(InputParameter.values()),
18939 List.of(OutputParameter.values())
18940 );
18941
18942 public PRelu(ExternalizedOp def) {
18943 super(SCHEMA, def);
18944 }
18945
18946 PRelu(PRelu that, CodeContext cc) {
18947 super(that, cc);
18948 }
18949
18950 @Override
18951 public PRelu transform(CodeContext cc, CodeTransformer ot) {
18952 return new PRelu(this, cc);
18953 }
18954
18955 PRelu(TypeElement resultType, Value X, Value slope) {
18956 super(SCHEMA, resultType, Set.of(), List.of(X, slope), List.of());
18957 }
18958
18959 @Override
18960 public SequencedSet<OnnxParameter> onnxOutputs() {
18961 return onnxOutputs(SCHEMA);
18962 }
18963
18964 @Override
18965 public SequencedMap<OnnxParameter, Object> onnxInputs() {
18966 return onnxInputs(SCHEMA, List.of(X(), slope()));
18967 }
18968
18969 public Value X() {
18970 return operands().get(0);
18971 }
18972
18973 public Value slope() {
18974 return operands().get(1);
18975 }
18976
18977 }
18978
18979 public static PRelu PRelu(TypeElement resultType, Value X, Value slope) {
18980 return new PRelu(resultType, X, slope);
18981 }
18982
18983 @OpFactoryHelper.OpDeclaration(Pad.NAME)
18984 public static final class Pad extends OnnxOp {
18985 public static final String NAME = "Pad";
18986
18987 public enum Attribute implements OnnxAttribute {
18988 mode(String.class, true, "constant"),
18989 ;
18990
18991 final Class<?> t;
18992 final boolean optional;
18993 final Object defaultValue;
18994
18995 Attribute(Class<?> type, boolean optional, Object defaultValue) {
18996 this.t = type;
18997 this.optional = optional;
18998 this.defaultValue = defaultValue;
18999 assert optional || defaultValue == null;
19000 }
19001
19002 public Class<?> type() {
19003 return t;
19004 }
19005
19006 public boolean isOptional() {
19007 return optional;
19008 }
19009
19010 public Object defaultValue() {
19011 return defaultValue;
19012 }
19013 }
19014
19015 public enum TypeConstraint implements OnnxTypeConstraint {
19016 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
19017 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
19018 ;
19019
19020 final OnnxType.TypeVariable typeVariable;
19021
19022 TypeConstraint(OnnxType.TypeVariable typeVariable) {
19023 assert typeVariable.name().equals(name());
19024 this.typeVariable = typeVariable;
19025 }
19026
19027 @Override
19028 public OnnxType.TypeVariable typeVariable() {
19029 return typeVariable;
19030 }
19031 }
19032
19033 public enum InputParameter implements OnnxParameter {
19034 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
19035 pads(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
19036 constant_value(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
19037 axes(TypeConstraint.Tind.typeVariable(), Quantifier.OPTIONAL),
19038 ;
19039
19040 final OnnxType type;
19041 final Quantifier quantifier;
19042
19043 InputParameter(OnnxType type, Quantifier quantifier) {
19044 this.type = type;
19045 this.quantifier = quantifier;
19046 }
19047
19048 @Override
19049 public OnnxType type() {
19050 return type;
19051 }
19052
19053 @Override
19054 public Quantifier quantifier() {
19055 return quantifier;
19056 }
19057 }
19058
19059 public enum OutputParameter implements OnnxParameter {
19060 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
19061 ;
19062
19063 final OnnxType type;
19064 final Quantifier quantifier;
19065
19066 OutputParameter(OnnxType type, Quantifier quantifier) {
19067 this.type = type;
19068 this.quantifier = quantifier;
19069 }
19070
19071 @Override
19072 public OnnxType type() {
19073 return type;
19074 }
19075
19076 @Override
19077 public Quantifier quantifier() {
19078 return quantifier;
19079 }
19080 }
19081
19082 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
19083 NAME,
19084 List.of(Attribute.values()),
19085 List.of(TypeConstraint.values()),
19086 List.of(InputParameter.values()),
19087 List.of(OutputParameter.values())
19088 );
19089
19090 public Pad(ExternalizedOp def) {
19091 super(SCHEMA, def);
19092 }
19093
19094 Pad(Pad that, CodeContext cc) {
19095 super(that, cc);
19096 }
19097
19098 @Override
19099 public Pad transform(CodeContext cc, CodeTransformer ot) {
19100 return new Pad(this, cc);
19101 }
19102
19103 Pad(TypeElement resultType, Value data, Value pads, java.util.Optional<Value> constant_value, java.util.Optional<Value> axes, java.util.Optional<String> mode) {
19104 super(SCHEMA, resultType, Set.of(), List.of(data, pads, constant_value, axes), List.of(mode));
19105 }
19106
19107 @Override
19108 public SequencedSet<OnnxParameter> onnxOutputs() {
19109 return onnxOutputs(SCHEMA);
19110 }
19111
19112 @Override
19113 public SequencedMap<OnnxParameter, Object> onnxInputs() {
19114 return onnxInputs(SCHEMA, List.of(data(), pads(), constant_value(), axes()));
19115 }
19116
19117 public Value data() {
19118 return operands().get(0);
19119 }
19120
19121 public Value pads() {
19122 return operands().get(1);
19123 }
19124
19125 public java.util.Optional<Value> constant_value() {
19126 int i = optionalInputArguments.indexOf(InputParameter.constant_value);
19127 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
19128 }
19129
19130 public java.util.Optional<Value> axes() {
19131 int i = optionalInputArguments.indexOf(InputParameter.axes);
19132 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
19133 }
19134
19135 public java.util.Optional<String> mode() {
19136 String mode = Attribute.mode.access(String.class, onnxAttributes);
19137 return java.util.Optional.ofNullable(mode);
19138 }
19139
19140 }
19141
19142 public static Pad Pad(TypeElement resultType, Value data, Value pads, java.util.Optional<Value> constant_value, java.util.Optional<Value> axes, java.util.Optional<String> mode) {
19143 return new Pad(resultType, data, pads, constant_value, axes, mode);
19144 }
19145
19146 @OpFactoryHelper.OpDeclaration(Pow.NAME)
19147 public static final class Pow extends OnnxOp {
19148 public static final String NAME = "Pow";
19149
19150 public enum Attribute implements OnnxAttribute.None { }
19151
19152 public enum TypeConstraint implements OnnxTypeConstraint {
19153 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
19154 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
19155 ;
19156
19157 final OnnxType.TypeVariable typeVariable;
19158
19159 TypeConstraint(OnnxType.TypeVariable typeVariable) {
19160 assert typeVariable.name().equals(name());
19161 this.typeVariable = typeVariable;
19162 }
19163
19164 @Override
19165 public OnnxType.TypeVariable typeVariable() {
19166 return typeVariable;
19167 }
19168 }
19169
19170 public enum InputParameter implements OnnxParameter {
19171 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
19172 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
19173 ;
19174
19175 final OnnxType type;
19176 final Quantifier quantifier;
19177
19178 InputParameter(OnnxType type, Quantifier quantifier) {
19179 this.type = type;
19180 this.quantifier = quantifier;
19181 }
19182
19183 @Override
19184 public OnnxType type() {
19185 return type;
19186 }
19187
19188 @Override
19189 public Quantifier quantifier() {
19190 return quantifier;
19191 }
19192 }
19193
19194 public enum OutputParameter implements OnnxParameter {
19195 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
19196 ;
19197
19198 final OnnxType type;
19199 final Quantifier quantifier;
19200
19201 OutputParameter(OnnxType type, Quantifier quantifier) {
19202 this.type = type;
19203 this.quantifier = quantifier;
19204 }
19205
19206 @Override
19207 public OnnxType type() {
19208 return type;
19209 }
19210
19211 @Override
19212 public Quantifier quantifier() {
19213 return quantifier;
19214 }
19215 }
19216
19217 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
19218 NAME,
19219 List.of(Attribute.values()),
19220 List.of(TypeConstraint.values()),
19221 List.of(InputParameter.values()),
19222 List.of(OutputParameter.values())
19223 );
19224
19225 public Pow(ExternalizedOp def) {
19226 super(SCHEMA, def);
19227 }
19228
19229 Pow(Pow that, CodeContext cc) {
19230 super(that, cc);
19231 }
19232
19233 @Override
19234 public Pow transform(CodeContext cc, CodeTransformer ot) {
19235 return new Pow(this, cc);
19236 }
19237
19238 Pow(TypeElement resultType, Value X, Value Y) {
19239 super(SCHEMA, resultType, Set.of(), List.of(X, Y), List.of());
19240 }
19241
19242 @Override
19243 public SequencedSet<OnnxParameter> onnxOutputs() {
19244 return onnxOutputs(SCHEMA);
19245 }
19246
19247 @Override
19248 public SequencedMap<OnnxParameter, Object> onnxInputs() {
19249 return onnxInputs(SCHEMA, List.of(X(), Y()));
19250 }
19251
19252 public Value X() {
19253 return operands().get(0);
19254 }
19255
19256 public Value Y() {
19257 return operands().get(1);
19258 }
19259
19260 }
19261
19262 public static Pow Pow(TypeElement resultType, Value X, Value Y) {
19263 return new Pow(resultType, X, Y);
19264 }
19265
19266 @OpFactoryHelper.OpDeclaration(QLinearConv.NAME)
19267 public static final class QLinearConv extends OnnxOp {
19268 public static final String NAME = "QLinearConv";
19269
19270 public enum Attribute implements OnnxAttribute {
19271 pads(long[].class, true, null),
19272 dilations(long[].class, true, null),
19273 auto_pad(String.class, true, "NOTSET"),
19274 strides(long[].class, true, null),
19275 group(Long.class, true, 1),
19276 kernel_shape(long[].class, true, null),
19277 ;
19278
19279 final Class<?> t;
19280 final boolean optional;
19281 final Object defaultValue;
19282
19283 Attribute(Class<?> type, boolean optional, Object defaultValue) {
19284 this.t = type;
19285 this.optional = optional;
19286 this.defaultValue = defaultValue;
19287 assert optional || defaultValue == null;
19288 }
19289
19290 public Class<?> type() {
19291 return t;
19292 }
19293
19294 public boolean isOptional() {
19295 return optional;
19296 }
19297
19298 public Object defaultValue() {
19299 return defaultValue;
19300 }
19301 }
19302
19303 public enum TypeConstraint implements OnnxTypeConstraint {
19304 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))),
19305 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))),
19306 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))),
19307 T4(new OnnxType.TypeVariable("T4", List.of(OnnxType.tensor(OnnxType.int32())))),
19308 ;
19309
19310 final OnnxType.TypeVariable typeVariable;
19311
19312 TypeConstraint(OnnxType.TypeVariable typeVariable) {
19313 assert typeVariable.name().equals(name());
19314 this.typeVariable = typeVariable;
19315 }
19316
19317 @Override
19318 public OnnxType.TypeVariable typeVariable() {
19319 return typeVariable;
19320 }
19321 }
19322
19323 public enum InputParameter implements OnnxParameter {
19324 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
19325 x_scale(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
19326 x_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
19327 w(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
19328 w_scale(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
19329 w_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
19330 y_scale(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
19331 y_zero_point(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
19332 B(TypeConstraint.T4.typeVariable(), Quantifier.OPTIONAL),
19333 ;
19334
19335 final OnnxType type;
19336 final Quantifier quantifier;
19337
19338 InputParameter(OnnxType type, Quantifier quantifier) {
19339 this.type = type;
19340 this.quantifier = quantifier;
19341 }
19342
19343 @Override
19344 public OnnxType type() {
19345 return type;
19346 }
19347
19348 @Override
19349 public Quantifier quantifier() {
19350 return quantifier;
19351 }
19352 }
19353
19354 public enum OutputParameter implements OnnxParameter {
19355 y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
19356 ;
19357
19358 final OnnxType type;
19359 final Quantifier quantifier;
19360
19361 OutputParameter(OnnxType type, Quantifier quantifier) {
19362 this.type = type;
19363 this.quantifier = quantifier;
19364 }
19365
19366 @Override
19367 public OnnxType type() {
19368 return type;
19369 }
19370
19371 @Override
19372 public Quantifier quantifier() {
19373 return quantifier;
19374 }
19375 }
19376
19377 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
19378 NAME,
19379 List.of(Attribute.values()),
19380 List.of(TypeConstraint.values()),
19381 List.of(InputParameter.values()),
19382 List.of(OutputParameter.values())
19383 );
19384
19385 public QLinearConv(ExternalizedOp def) {
19386 super(SCHEMA, def);
19387 }
19388
19389 QLinearConv(QLinearConv that, CodeContext cc) {
19390 super(that, cc);
19391 }
19392
19393 @Override
19394 public QLinearConv transform(CodeContext cc, CodeTransformer ot) {
19395 return new QLinearConv(this, cc);
19396 }
19397
19398 QLinearConv(TypeElement resultType, Value x, Value x_scale, Value x_zero_point, Value w, Value w_scale, Value w_zero_point, Value y_scale, Value y_zero_point, java.util.Optional<Value> B, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<long[]> strides, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape) {
19399 super(SCHEMA, resultType, Set.of(), List.of(x, x_scale, x_zero_point, w, w_scale, w_zero_point, y_scale, y_zero_point, B), List.of(pads, dilations, auto_pad, strides, group, kernel_shape));
19400 }
19401
19402 @Override
19403 public SequencedSet<OnnxParameter> onnxOutputs() {
19404 return onnxOutputs(SCHEMA);
19405 }
19406
19407 @Override
19408 public SequencedMap<OnnxParameter, Object> onnxInputs() {
19409 return onnxInputs(SCHEMA, List.of(x(), x_scale(), x_zero_point(), w(), w_scale(), w_zero_point(), y_scale(), y_zero_point(), B()));
19410 }
19411
19412 public Value x() {
19413 return operands().get(0);
19414 }
19415
19416 public Value x_scale() {
19417 return operands().get(1);
19418 }
19419
19420 public Value x_zero_point() {
19421 return operands().get(2);
19422 }
19423
19424 public Value w() {
19425 return operands().get(3);
19426 }
19427
19428 public Value w_scale() {
19429 return operands().get(4);
19430 }
19431
19432 public Value w_zero_point() {
19433 return operands().get(5);
19434 }
19435
19436 public Value y_scale() {
19437 return operands().get(6);
19438 }
19439
19440 public Value y_zero_point() {
19441 return operands().get(7);
19442 }
19443
19444 public java.util.Optional<Value> B() {
19445 int i = optionalInputArguments.indexOf(InputParameter.B);
19446 return i != -1 ? java.util.Optional.of(operands().get(8 + i)) : java.util.Optional.empty();
19447 }
19448
19449 public java.util.Optional<long[]> pads() {
19450 long[] pads = Attribute.pads.access(long[].class, onnxAttributes);
19451 return java.util.Optional.ofNullable(pads).map(long[]::clone);
19452 }
19453
19454 public java.util.Optional<long[]> dilations() {
19455 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes);
19456 return java.util.Optional.ofNullable(dilations).map(long[]::clone);
19457 }
19458
19459 public java.util.Optional<String> auto_pad() {
19460 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes);
19461 return java.util.Optional.ofNullable(auto_pad);
19462 }
19463
19464 public java.util.Optional<long[]> strides() {
19465 long[] strides = Attribute.strides.access(long[].class, onnxAttributes);
19466 return java.util.Optional.ofNullable(strides).map(long[]::clone);
19467 }
19468
19469 public java.util.Optional<Long> group() {
19470 Long group = Attribute.group.access(Long.class, onnxAttributes);
19471 return java.util.Optional.ofNullable(group);
19472 }
19473
19474 public java.util.Optional<long[]> kernel_shape() {
19475 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes);
19476 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone);
19477 }
19478
19479 }
19480
19481 public static QLinearConv QLinearConv(TypeElement resultType, Value x, Value x_scale, Value x_zero_point, Value w, Value w_scale, Value w_zero_point, Value y_scale, Value y_zero_point, java.util.Optional<Value> B, java.util.Optional<long[]> pads, java.util.Optional<long[]> dilations, java.util.Optional<String> auto_pad, java.util.Optional<long[]> strides, java.util.Optional<Long> group, java.util.Optional<long[]> kernel_shape) {
19482 return new QLinearConv(resultType, x, x_scale, x_zero_point, w, w_scale, w_zero_point, y_scale, y_zero_point, B, pads, dilations, auto_pad, strides, group, kernel_shape);
19483 }
19484
19485 @OpFactoryHelper.OpDeclaration(QLinearMatMul.NAME)
19486 public static final class QLinearMatMul extends OnnxOp {
19487 public static final String NAME = "QLinearMatMul";
19488
19489 public enum Attribute implements OnnxAttribute.None { }
19490
19491 public enum TypeConstraint implements OnnxTypeConstraint {
19492 TS(new OnnxType.TypeVariable("TS", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16())))),
19493 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz())))),
19494 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz())))),
19495 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz())))),
19496 ;
19497
19498 final OnnxType.TypeVariable typeVariable;
19499
19500 TypeConstraint(OnnxType.TypeVariable typeVariable) {
19501 assert typeVariable.name().equals(name());
19502 this.typeVariable = typeVariable;
19503 }
19504
19505 @Override
19506 public OnnxType.TypeVariable typeVariable() {
19507 return typeVariable;
19508 }
19509 }
19510
19511 public enum InputParameter implements OnnxParameter {
19512 a(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
19513 a_scale(TypeConstraint.TS.typeVariable(), Quantifier.REQUIRED),
19514 a_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
19515 b(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
19516 b_scale(TypeConstraint.TS.typeVariable(), Quantifier.REQUIRED),
19517 b_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
19518 y_scale(TypeConstraint.TS.typeVariable(), Quantifier.REQUIRED),
19519 y_zero_point(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
19520 ;
19521
19522 final OnnxType type;
19523 final Quantifier quantifier;
19524
19525 InputParameter(OnnxType type, Quantifier quantifier) {
19526 this.type = type;
19527 this.quantifier = quantifier;
19528 }
19529
19530 @Override
19531 public OnnxType type() {
19532 return type;
19533 }
19534
19535 @Override
19536 public Quantifier quantifier() {
19537 return quantifier;
19538 }
19539 }
19540
19541 public enum OutputParameter implements OnnxParameter {
19542 y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
19543 ;
19544
19545 final OnnxType type;
19546 final Quantifier quantifier;
19547
19548 OutputParameter(OnnxType type, Quantifier quantifier) {
19549 this.type = type;
19550 this.quantifier = quantifier;
19551 }
19552
19553 @Override
19554 public OnnxType type() {
19555 return type;
19556 }
19557
19558 @Override
19559 public Quantifier quantifier() {
19560 return quantifier;
19561 }
19562 }
19563
19564 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
19565 NAME,
19566 List.of(Attribute.values()),
19567 List.of(TypeConstraint.values()),
19568 List.of(InputParameter.values()),
19569 List.of(OutputParameter.values())
19570 );
19571
19572 public QLinearMatMul(ExternalizedOp def) {
19573 super(SCHEMA, def);
19574 }
19575
19576 QLinearMatMul(QLinearMatMul that, CodeContext cc) {
19577 super(that, cc);
19578 }
19579
19580 @Override
19581 public QLinearMatMul transform(CodeContext cc, CodeTransformer ot) {
19582 return new QLinearMatMul(this, cc);
19583 }
19584
19585 QLinearMatMul(TypeElement resultType, Value a, Value a_scale, Value a_zero_point, Value b, Value b_scale, Value b_zero_point, Value y_scale, Value y_zero_point) {
19586 super(SCHEMA, resultType, Set.of(), List.of(a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point), List.of());
19587 }
19588
19589 @Override
19590 public SequencedSet<OnnxParameter> onnxOutputs() {
19591 return onnxOutputs(SCHEMA);
19592 }
19593
19594 @Override
19595 public SequencedMap<OnnxParameter, Object> onnxInputs() {
19596 return onnxInputs(SCHEMA, List.of(a(), a_scale(), a_zero_point(), b(), b_scale(), b_zero_point(), y_scale(), y_zero_point()));
19597 }
19598
19599 public Value a() {
19600 return operands().get(0);
19601 }
19602
19603 public Value a_scale() {
19604 return operands().get(1);
19605 }
19606
19607 public Value a_zero_point() {
19608 return operands().get(2);
19609 }
19610
19611 public Value b() {
19612 return operands().get(3);
19613 }
19614
19615 public Value b_scale() {
19616 return operands().get(4);
19617 }
19618
19619 public Value b_zero_point() {
19620 return operands().get(5);
19621 }
19622
19623 public Value y_scale() {
19624 return operands().get(6);
19625 }
19626
19627 public Value y_zero_point() {
19628 return operands().get(7);
19629 }
19630
19631 }
19632
19633 public static QLinearMatMul QLinearMatMul(TypeElement resultType, Value a, Value a_scale, Value a_zero_point, Value b, Value b_scale, Value b_zero_point, Value y_scale, Value y_zero_point) {
19634 return new QLinearMatMul(resultType, a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point);
19635 }
19636
19637 @OpFactoryHelper.OpDeclaration(QuantizeLinear.NAME)
19638 public static final class QuantizeLinear extends OnnxOp {
19639 public static final String NAME = "QuantizeLinear";
19640
19641 public enum Attribute implements OnnxAttribute {
19642 output_dtype(Long.class, true, 0),
19643 saturate(Long.class, true, 1),
19644 precision(Long.class, true, 0),
19645 axis(Long.class, true, 1),
19646 block_size(Long.class, true, 0),
19647 ;
19648
19649 final Class<?> t;
19650 final boolean optional;
19651 final Object defaultValue;
19652
19653 Attribute(Class<?> type, boolean optional, Object defaultValue) {
19654 this.t = type;
19655 this.optional = optional;
19656 this.defaultValue = defaultValue;
19657 assert optional || defaultValue == null;
19658 }
19659
19660 public Class<?> type() {
19661 return t;
19662 }
19663
19664 public boolean isOptional() {
19665 return optional;
19666 }
19667
19668 public Object defaultValue() {
19669 return defaultValue;
19670 }
19671 }
19672
19673 public enum TypeConstraint implements OnnxTypeConstraint {
19674 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.int32())))),
19675 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.float8e8m0())))),
19676 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1())))),
19677 ;
19678
19679 final OnnxType.TypeVariable typeVariable;
19680
19681 TypeConstraint(OnnxType.TypeVariable typeVariable) {
19682 assert typeVariable.name().equals(name());
19683 this.typeVariable = typeVariable;
19684 }
19685
19686 @Override
19687 public OnnxType.TypeVariable typeVariable() {
19688 return typeVariable;
19689 }
19690 }
19691
19692 public enum InputParameter implements OnnxParameter {
19693 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
19694 y_scale(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
19695 y_zero_point(TypeConstraint.T3.typeVariable(), Quantifier.OPTIONAL),
19696 ;
19697
19698 final OnnxType type;
19699 final Quantifier quantifier;
19700
19701 InputParameter(OnnxType type, Quantifier quantifier) {
19702 this.type = type;
19703 this.quantifier = quantifier;
19704 }
19705
19706 @Override
19707 public OnnxType type() {
19708 return type;
19709 }
19710
19711 @Override
19712 public Quantifier quantifier() {
19713 return quantifier;
19714 }
19715 }
19716
19717 public enum OutputParameter implements OnnxParameter {
19718 y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
19719 ;
19720
19721 final OnnxType type;
19722 final Quantifier quantifier;
19723
19724 OutputParameter(OnnxType type, Quantifier quantifier) {
19725 this.type = type;
19726 this.quantifier = quantifier;
19727 }
19728
19729 @Override
19730 public OnnxType type() {
19731 return type;
19732 }
19733
19734 @Override
19735 public Quantifier quantifier() {
19736 return quantifier;
19737 }
19738 }
19739
19740 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
19741 NAME,
19742 List.of(Attribute.values()),
19743 List.of(TypeConstraint.values()),
19744 List.of(InputParameter.values()),
19745 List.of(OutputParameter.values())
19746 );
19747
19748 public QuantizeLinear(ExternalizedOp def) {
19749 super(SCHEMA, def);
19750 }
19751
19752 QuantizeLinear(QuantizeLinear that, CodeContext cc) {
19753 super(that, cc);
19754 }
19755
19756 @Override
19757 public QuantizeLinear transform(CodeContext cc, CodeTransformer ot) {
19758 return new QuantizeLinear(this, cc);
19759 }
19760
19761 QuantizeLinear(TypeElement resultType, Value x, Value y_scale, java.util.Optional<Value> y_zero_point, java.util.Optional<Long> output_dtype, java.util.Optional<Long> saturate, java.util.Optional<Long> precision, java.util.Optional<Long> axis, java.util.Optional<Long> block_size) {
19762 super(SCHEMA, resultType, Set.of(), List.of(x, y_scale, y_zero_point), List.of(output_dtype, saturate, precision, axis, block_size));
19763 }
19764
19765 @Override
19766 public SequencedSet<OnnxParameter> onnxOutputs() {
19767 return onnxOutputs(SCHEMA);
19768 }
19769
19770 @Override
19771 public SequencedMap<OnnxParameter, Object> onnxInputs() {
19772 return onnxInputs(SCHEMA, List.of(x(), y_scale(), y_zero_point()));
19773 }
19774
19775 public Value x() {
19776 return operands().get(0);
19777 }
19778
19779 public Value y_scale() {
19780 return operands().get(1);
19781 }
19782
19783 public java.util.Optional<Value> y_zero_point() {
19784 int i = optionalInputArguments.indexOf(InputParameter.y_zero_point);
19785 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
19786 }
19787
19788 public java.util.Optional<Long> output_dtype() {
19789 Long output_dtype = Attribute.output_dtype.access(Long.class, onnxAttributes);
19790 return java.util.Optional.ofNullable(output_dtype);
19791 }
19792
19793 public java.util.Optional<Long> saturate() {
19794 Long saturate = Attribute.saturate.access(Long.class, onnxAttributes);
19795 return java.util.Optional.ofNullable(saturate);
19796 }
19797
19798 public java.util.Optional<Long> precision() {
19799 Long precision = Attribute.precision.access(Long.class, onnxAttributes);
19800 return java.util.Optional.ofNullable(precision);
19801 }
19802
19803 public java.util.Optional<Long> axis() {
19804 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
19805 return java.util.Optional.ofNullable(axis);
19806 }
19807
19808 public java.util.Optional<Long> block_size() {
19809 Long block_size = Attribute.block_size.access(Long.class, onnxAttributes);
19810 return java.util.Optional.ofNullable(block_size);
19811 }
19812
19813 }
19814
19815 public static QuantizeLinear QuantizeLinear(TypeElement resultType, Value x, Value y_scale, java.util.Optional<Value> y_zero_point, java.util.Optional<Long> output_dtype, java.util.Optional<Long> saturate, java.util.Optional<Long> precision, java.util.Optional<Long> axis, java.util.Optional<Long> block_size) {
19816 return new QuantizeLinear(resultType, x, y_scale, y_zero_point, output_dtype, saturate, precision, axis, block_size);
19817 }
19818
19819 @OpFactoryHelper.OpDeclaration(RMSNormalization.NAME)
19820 public static final class RMSNormalization extends OnnxOp {
19821 public static final String NAME = "RMSNormalization";
19822
19823 public enum Attribute implements OnnxAttribute {
19824 epsilon(Float.class, true, 1.0E-5f),
19825 stash_type(Long.class, true, 1),
19826 axis(Long.class, true, -1),
19827 ;
19828
19829 final Class<?> t;
19830 final boolean optional;
19831 final Object defaultValue;
19832
19833 Attribute(Class<?> type, boolean optional, Object defaultValue) {
19834 this.t = type;
19835 this.optional = optional;
19836 this.defaultValue = defaultValue;
19837 assert optional || defaultValue == null;
19838 }
19839
19840 public Class<?> type() {
19841 return t;
19842 }
19843
19844 public boolean isOptional() {
19845 return optional;
19846 }
19847
19848 public Object defaultValue() {
19849 return defaultValue;
19850 }
19851 }
19852
19853 public enum TypeConstraint implements OnnxTypeConstraint {
19854 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
19855 V(new OnnxType.TypeVariable("V", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
19856 ;
19857
19858 final OnnxType.TypeVariable typeVariable;
19859
19860 TypeConstraint(OnnxType.TypeVariable typeVariable) {
19861 assert typeVariable.name().equals(name());
19862 this.typeVariable = typeVariable;
19863 }
19864
19865 @Override
19866 public OnnxType.TypeVariable typeVariable() {
19867 return typeVariable;
19868 }
19869 }
19870
19871 public enum InputParameter implements OnnxParameter {
19872 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
19873 scale(TypeConstraint.V.typeVariable(), Quantifier.REQUIRED),
19874 ;
19875
19876 final OnnxType type;
19877 final Quantifier quantifier;
19878
19879 InputParameter(OnnxType type, Quantifier quantifier) {
19880 this.type = type;
19881 this.quantifier = quantifier;
19882 }
19883
19884 @Override
19885 public OnnxType type() {
19886 return type;
19887 }
19888
19889 @Override
19890 public Quantifier quantifier() {
19891 return quantifier;
19892 }
19893 }
19894
19895 public enum OutputParameter implements OnnxParameter {
19896 Y(TypeConstraint.V.typeVariable(), Quantifier.REQUIRED),
19897 ;
19898
19899 final OnnxType type;
19900 final Quantifier quantifier;
19901
19902 OutputParameter(OnnxType type, Quantifier quantifier) {
19903 this.type = type;
19904 this.quantifier = quantifier;
19905 }
19906
19907 @Override
19908 public OnnxType type() {
19909 return type;
19910 }
19911
19912 @Override
19913 public Quantifier quantifier() {
19914 return quantifier;
19915 }
19916 }
19917
19918 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
19919 NAME,
19920 List.of(Attribute.values()),
19921 List.of(TypeConstraint.values()),
19922 List.of(InputParameter.values()),
19923 List.of(OutputParameter.values())
19924 );
19925
19926 public RMSNormalization(ExternalizedOp def) {
19927 super(SCHEMA, def);
19928 }
19929
19930 RMSNormalization(RMSNormalization that, CodeContext cc) {
19931 super(that, cc);
19932 }
19933
19934 @Override
19935 public RMSNormalization transform(CodeContext cc, CodeTransformer ot) {
19936 return new RMSNormalization(this, cc);
19937 }
19938
19939 RMSNormalization(TypeElement resultType, Value X, Value scale, java.util.Optional<Float> epsilon, java.util.Optional<Long> stash_type, java.util.Optional<Long> axis) {
19940 super(SCHEMA, resultType, Set.of(), List.of(X, scale), List.of(epsilon, stash_type, axis));
19941 }
19942
19943 @Override
19944 public SequencedSet<OnnxParameter> onnxOutputs() {
19945 return onnxOutputs(SCHEMA);
19946 }
19947
19948 @Override
19949 public SequencedMap<OnnxParameter, Object> onnxInputs() {
19950 return onnxInputs(SCHEMA, List.of(X(), scale()));
19951 }
19952
19953 public Value X() {
19954 return operands().get(0);
19955 }
19956
19957 public Value scale() {
19958 return operands().get(1);
19959 }
19960
19961 public java.util.Optional<Float> epsilon() {
19962 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes);
19963 return java.util.Optional.ofNullable(epsilon);
19964 }
19965
19966 public java.util.Optional<Long> stash_type() {
19967 Long stash_type = Attribute.stash_type.access(Long.class, onnxAttributes);
19968 return java.util.Optional.ofNullable(stash_type);
19969 }
19970
19971 public java.util.Optional<Long> axis() {
19972 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
19973 return java.util.Optional.ofNullable(axis);
19974 }
19975
19976 }
19977
19978 public static RMSNormalization RMSNormalization(TypeElement resultType, Value X, Value scale, java.util.Optional<Float> epsilon, java.util.Optional<Long> stash_type, java.util.Optional<Long> axis) {
19979 return new RMSNormalization(resultType, X, scale, epsilon, stash_type, axis);
19980 }
19981
19982 @OpFactoryHelper.OpDeclaration(RNN.NAME)
19983 public static final class RNN extends OnnxOp {
19984 public static final String NAME = "RNN";
19985
19986 public enum Attribute implements OnnxAttribute {
19987 layout(Long.class, true, 0),
19988 activation_alpha(float[].class, true, null),
19989 hidden_size(Long.class, true, null),
19990 activation_beta(float[].class, true, null),
19991 activations(String[].class, true, null),
19992 clip(Float.class, true, null),
19993 direction(String.class, true, "forward"),
19994 ;
19995
19996 final Class<?> t;
19997 final boolean optional;
19998 final Object defaultValue;
19999
20000 Attribute(Class<?> type, boolean optional, Object defaultValue) {
20001 this.t = type;
20002 this.optional = optional;
20003 this.defaultValue = defaultValue;
20004 assert optional || defaultValue == null;
20005 }
20006
20007 public Class<?> type() {
20008 return t;
20009 }
20010
20011 public boolean isOptional() {
20012 return optional;
20013 }
20014
20015 public Object defaultValue() {
20016 return defaultValue;
20017 }
20018 }
20019
20020 public enum TypeConstraint implements OnnxTypeConstraint {
20021 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
20022 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32())))),
20023 ;
20024
20025 final OnnxType.TypeVariable typeVariable;
20026
20027 TypeConstraint(OnnxType.TypeVariable typeVariable) {
20028 assert typeVariable.name().equals(name());
20029 this.typeVariable = typeVariable;
20030 }
20031
20032 @Override
20033 public OnnxType.TypeVariable typeVariable() {
20034 return typeVariable;
20035 }
20036 }
20037
20038 public enum InputParameter implements OnnxParameter {
20039 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20040 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20041 R(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20042 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
20043 sequence_lens(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
20044 initial_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
20045 ;
20046
20047 final OnnxType type;
20048 final Quantifier quantifier;
20049
20050 InputParameter(OnnxType type, Quantifier quantifier) {
20051 this.type = type;
20052 this.quantifier = quantifier;
20053 }
20054
20055 @Override
20056 public OnnxType type() {
20057 return type;
20058 }
20059
20060 @Override
20061 public Quantifier quantifier() {
20062 return quantifier;
20063 }
20064 }
20065
20066 public enum OutputParameter implements OnnxParameter {
20067 Y(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
20068 Y_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
20069 ;
20070
20071 final OnnxType type;
20072 final Quantifier quantifier;
20073
20074 OutputParameter(OnnxType type, Quantifier quantifier) {
20075 this.type = type;
20076 this.quantifier = quantifier;
20077 }
20078
20079 @Override
20080 public OnnxType type() {
20081 return type;
20082 }
20083
20084 @Override
20085 public Quantifier quantifier() {
20086 return quantifier;
20087 }
20088 }
20089
20090 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
20091 NAME,
20092 List.of(Attribute.values()),
20093 List.of(TypeConstraint.values()),
20094 List.of(InputParameter.values()),
20095 List.of(OutputParameter.values())
20096 );
20097
20098 public RNN(ExternalizedOp def) {
20099 super(SCHEMA, def);
20100 }
20101
20102 RNN(RNN that, CodeContext cc) {
20103 super(that, cc);
20104 }
20105
20106 @Override
20107 public RNN transform(CodeContext cc, CodeTransformer ot) {
20108 return new RNN(this, cc);
20109 }
20110
20111 RNN(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value X, Value W, Value R, java.util.Optional<Value> B, java.util.Optional<Value> sequence_lens, java.util.Optional<Value> initial_h, java.util.Optional<Long> layout, java.util.Optional<float[]> activation_alpha, java.util.Optional<Long> hidden_size, java.util.Optional<float[]> activation_beta, java.util.Optional<String[]> activations, java.util.Optional<Float> clip, java.util.Optional<String> direction) {
20112 super(SCHEMA, resultType, optionalOutputs, List.of(X, W, R, B, sequence_lens, initial_h), List.of(layout, activation_alpha, hidden_size, activation_beta, activations, clip, direction));
20113 }
20114
20115 @Override
20116 public SequencedSet<OnnxParameter> onnxOutputs() {
20117 return onnxOutputs(SCHEMA);
20118 }
20119
20120 @Override
20121 public SequencedMap<OnnxParameter, Object> onnxInputs() {
20122 return onnxInputs(SCHEMA, List.of(X(), W(), R(), B(), sequence_lens(), initial_h()));
20123 }
20124
20125 public Value X() {
20126 return operands().get(0);
20127 }
20128
20129 public Value W() {
20130 return operands().get(1);
20131 }
20132
20133 public Value R() {
20134 return operands().get(2);
20135 }
20136
20137 public java.util.Optional<Value> B() {
20138 int i = optionalInputArguments.indexOf(InputParameter.B);
20139 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
20140 }
20141
20142 public java.util.Optional<Value> sequence_lens() {
20143 int i = optionalInputArguments.indexOf(InputParameter.sequence_lens);
20144 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
20145 }
20146
20147 public java.util.Optional<Value> initial_h() {
20148 int i = optionalInputArguments.indexOf(InputParameter.initial_h);
20149 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
20150 }
20151
20152 public java.util.Optional<Long> layout() {
20153 Long layout = Attribute.layout.access(Long.class, onnxAttributes);
20154 return java.util.Optional.ofNullable(layout);
20155 }
20156
20157 public java.util.Optional<float[]> activation_alpha() {
20158 float[] activation_alpha = Attribute.activation_alpha.access(float[].class, onnxAttributes);
20159 return java.util.Optional.ofNullable(activation_alpha).map(float[]::clone);
20160 }
20161
20162 public java.util.Optional<Long> hidden_size() {
20163 Long hidden_size = Attribute.hidden_size.access(Long.class, onnxAttributes);
20164 return java.util.Optional.ofNullable(hidden_size);
20165 }
20166
20167 public java.util.Optional<float[]> activation_beta() {
20168 float[] activation_beta = Attribute.activation_beta.access(float[].class, onnxAttributes);
20169 return java.util.Optional.ofNullable(activation_beta).map(float[]::clone);
20170 }
20171
20172 public java.util.Optional<String[]> activations() {
20173 String[] activations = Attribute.activations.access(String[].class, onnxAttributes);
20174 return java.util.Optional.ofNullable(activations).map(String[]::clone);
20175 }
20176
20177 public java.util.Optional<Float> clip() {
20178 Float clip = Attribute.clip.access(Float.class, onnxAttributes);
20179 return java.util.Optional.ofNullable(clip);
20180 }
20181
20182 public java.util.Optional<String> direction() {
20183 String direction = Attribute.direction.access(String.class, onnxAttributes);
20184 return java.util.Optional.ofNullable(direction);
20185 }
20186
20187 }
20188
20189 public static RNN RNN(TypeElement resultType, Set<RNN.OutputParameter> optionalOutputs, Value X, Value W, Value R, java.util.Optional<Value> B, java.util.Optional<Value> sequence_lens, java.util.Optional<Value> initial_h, java.util.Optional<Long> layout, java.util.Optional<float[]> activation_alpha, java.util.Optional<Long> hidden_size, java.util.Optional<float[]> activation_beta, java.util.Optional<String[]> activations, java.util.Optional<Float> clip, java.util.Optional<String> direction) {
20190 return new RNN(resultType, optionalOutputs, X, W, R, B, sequence_lens, initial_h, layout, activation_alpha, hidden_size, activation_beta, activations, clip, direction);
20191 }
20192
20193 @OpFactoryHelper.OpDeclaration(RandomNormal.NAME)
20194 public static final class RandomNormal extends OnnxOp {
20195 public static final String NAME = "RandomNormal";
20196
20197 public enum Attribute implements OnnxAttribute {
20198 shape(long[].class, false, null),
20199 seed(Float.class, true, null),
20200 mean(Float.class, true, 0.0f),
20201 scale(Float.class, true, 1.0f),
20202 dtype(Long.class, true, 1),
20203 ;
20204
20205 final Class<?> t;
20206 final boolean optional;
20207 final Object defaultValue;
20208
20209 Attribute(Class<?> type, boolean optional, Object defaultValue) {
20210 this.t = type;
20211 this.optional = optional;
20212 this.defaultValue = defaultValue;
20213 assert optional || defaultValue == null;
20214 }
20215
20216 public Class<?> type() {
20217 return t;
20218 }
20219
20220 public boolean isOptional() {
20221 return optional;
20222 }
20223
20224 public Object defaultValue() {
20225 return defaultValue;
20226 }
20227 }
20228
20229 public enum TypeConstraint implements OnnxTypeConstraint {
20230 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
20231 ;
20232
20233 final OnnxType.TypeVariable typeVariable;
20234
20235 TypeConstraint(OnnxType.TypeVariable typeVariable) {
20236 assert typeVariable.name().equals(name());
20237 this.typeVariable = typeVariable;
20238 }
20239
20240 @Override
20241 public OnnxType.TypeVariable typeVariable() {
20242 return typeVariable;
20243 }
20244 }
20245
20246 public enum InputParameter implements OnnxParameter.None { }
20247
20248 public enum OutputParameter implements OnnxParameter {
20249 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20250 ;
20251
20252 final OnnxType type;
20253 final Quantifier quantifier;
20254
20255 OutputParameter(OnnxType type, Quantifier quantifier) {
20256 this.type = type;
20257 this.quantifier = quantifier;
20258 }
20259
20260 @Override
20261 public OnnxType type() {
20262 return type;
20263 }
20264
20265 @Override
20266 public Quantifier quantifier() {
20267 return quantifier;
20268 }
20269 }
20270
20271 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
20272 NAME,
20273 List.of(Attribute.values()),
20274 List.of(TypeConstraint.values()),
20275 List.of(InputParameter.values()),
20276 List.of(OutputParameter.values())
20277 );
20278
20279 public RandomNormal(ExternalizedOp def) {
20280 super(SCHEMA, def);
20281 }
20282
20283 RandomNormal(RandomNormal that, CodeContext cc) {
20284 super(that, cc);
20285 }
20286
20287 @Override
20288 public RandomNormal transform(CodeContext cc, CodeTransformer ot) {
20289 return new RandomNormal(this, cc);
20290 }
20291
20292 RandomNormal(TypeElement resultType, long[] shape, java.util.Optional<Float> seed, java.util.Optional<Float> mean, java.util.Optional<Float> scale, java.util.Optional<Long> dtype) {
20293 super(SCHEMA, resultType, Set.of(), List.of(), List.of(shape, seed, mean, scale, dtype));
20294 }
20295
20296 @Override
20297 public SequencedSet<OnnxParameter> onnxOutputs() {
20298 return onnxOutputs(SCHEMA);
20299 }
20300
20301 @Override
20302 public SequencedMap<OnnxParameter, Object> onnxInputs() {
20303 return onnxInputs(SCHEMA, List.of());
20304 }
20305
20306 public long[] shape() {
20307 long[] shape = Attribute.shape.access(long[].class, onnxAttributes);
20308 return shape.clone();
20309 }
20310
20311 public java.util.Optional<Float> seed() {
20312 Float seed = Attribute.seed.access(Float.class, onnxAttributes);
20313 return java.util.Optional.ofNullable(seed);
20314 }
20315
20316 public java.util.Optional<Float> mean() {
20317 Float mean = Attribute.mean.access(Float.class, onnxAttributes);
20318 return java.util.Optional.ofNullable(mean);
20319 }
20320
20321 public java.util.Optional<Float> scale() {
20322 Float scale = Attribute.scale.access(Float.class, onnxAttributes);
20323 return java.util.Optional.ofNullable(scale);
20324 }
20325
20326 public java.util.Optional<Long> dtype() {
20327 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes);
20328 return java.util.Optional.ofNullable(dtype);
20329 }
20330
20331 }
20332
20333 public static RandomNormal RandomNormal(TypeElement resultType, long[] shape, java.util.Optional<Float> seed, java.util.Optional<Float> mean, java.util.Optional<Float> scale, java.util.Optional<Long> dtype) {
20334 return new RandomNormal(resultType, shape, seed, mean, scale, dtype);
20335 }
20336
20337 @OpFactoryHelper.OpDeclaration(RandomNormalLike.NAME)
20338 public static final class RandomNormalLike extends OnnxOp {
20339 public static final String NAME = "RandomNormalLike";
20340
20341 public enum Attribute implements OnnxAttribute {
20342 seed(Float.class, true, null),
20343 mean(Float.class, true, 0.0f),
20344 scale(Float.class, true, 1.0f),
20345 dtype(Long.class, true, null),
20346 ;
20347
20348 final Class<?> t;
20349 final boolean optional;
20350 final Object defaultValue;
20351
20352 Attribute(Class<?> type, boolean optional, Object defaultValue) {
20353 this.t = type;
20354 this.optional = optional;
20355 this.defaultValue = defaultValue;
20356 assert optional || defaultValue == null;
20357 }
20358
20359 public Class<?> type() {
20360 return t;
20361 }
20362
20363 public boolean isOptional() {
20364 return optional;
20365 }
20366
20367 public Object defaultValue() {
20368 return defaultValue;
20369 }
20370 }
20371
20372 public enum TypeConstraint implements OnnxTypeConstraint {
20373 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
20374 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
20375 ;
20376
20377 final OnnxType.TypeVariable typeVariable;
20378
20379 TypeConstraint(OnnxType.TypeVariable typeVariable) {
20380 assert typeVariable.name().equals(name());
20381 this.typeVariable = typeVariable;
20382 }
20383
20384 @Override
20385 public OnnxType.TypeVariable typeVariable() {
20386 return typeVariable;
20387 }
20388 }
20389
20390 public enum InputParameter implements OnnxParameter {
20391 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
20392 ;
20393
20394 final OnnxType type;
20395 final Quantifier quantifier;
20396
20397 InputParameter(OnnxType type, Quantifier quantifier) {
20398 this.type = type;
20399 this.quantifier = quantifier;
20400 }
20401
20402 @Override
20403 public OnnxType type() {
20404 return type;
20405 }
20406
20407 @Override
20408 public Quantifier quantifier() {
20409 return quantifier;
20410 }
20411 }
20412
20413 public enum OutputParameter implements OnnxParameter {
20414 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
20415 ;
20416
20417 final OnnxType type;
20418 final Quantifier quantifier;
20419
20420 OutputParameter(OnnxType type, Quantifier quantifier) {
20421 this.type = type;
20422 this.quantifier = quantifier;
20423 }
20424
20425 @Override
20426 public OnnxType type() {
20427 return type;
20428 }
20429
20430 @Override
20431 public Quantifier quantifier() {
20432 return quantifier;
20433 }
20434 }
20435
20436 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
20437 NAME,
20438 List.of(Attribute.values()),
20439 List.of(TypeConstraint.values()),
20440 List.of(InputParameter.values()),
20441 List.of(OutputParameter.values())
20442 );
20443
20444 public RandomNormalLike(ExternalizedOp def) {
20445 super(SCHEMA, def);
20446 }
20447
20448 RandomNormalLike(RandomNormalLike that, CodeContext cc) {
20449 super(that, cc);
20450 }
20451
20452 @Override
20453 public RandomNormalLike transform(CodeContext cc, CodeTransformer ot) {
20454 return new RandomNormalLike(this, cc);
20455 }
20456
20457 RandomNormalLike(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Float> mean, java.util.Optional<Float> scale, java.util.Optional<Long> dtype) {
20458 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(seed, mean, scale, dtype));
20459 }
20460
20461 @Override
20462 public SequencedSet<OnnxParameter> onnxOutputs() {
20463 return onnxOutputs(SCHEMA);
20464 }
20465
20466 @Override
20467 public SequencedMap<OnnxParameter, Object> onnxInputs() {
20468 return onnxInputs(SCHEMA, List.of(input()));
20469 }
20470
20471 public Value input() {
20472 return operands().get(0);
20473 }
20474
20475 public java.util.Optional<Float> seed() {
20476 Float seed = Attribute.seed.access(Float.class, onnxAttributes);
20477 return java.util.Optional.ofNullable(seed);
20478 }
20479
20480 public java.util.Optional<Float> mean() {
20481 Float mean = Attribute.mean.access(Float.class, onnxAttributes);
20482 return java.util.Optional.ofNullable(mean);
20483 }
20484
20485 public java.util.Optional<Float> scale() {
20486 Float scale = Attribute.scale.access(Float.class, onnxAttributes);
20487 return java.util.Optional.ofNullable(scale);
20488 }
20489
20490 public java.util.Optional<Long> dtype() {
20491 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes);
20492 return java.util.Optional.ofNullable(dtype);
20493 }
20494
20495 }
20496
20497 public static RandomNormalLike RandomNormalLike(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Float> mean, java.util.Optional<Float> scale, java.util.Optional<Long> dtype) {
20498 return new RandomNormalLike(resultType, input, seed, mean, scale, dtype);
20499 }
20500
20501 @OpFactoryHelper.OpDeclaration(RandomUniform.NAME)
20502 public static final class RandomUniform extends OnnxOp {
20503 public static final String NAME = "RandomUniform";
20504
20505 public enum Attribute implements OnnxAttribute {
20506 high(Float.class, true, 1.0f),
20507 shape(long[].class, false, null),
20508 seed(Float.class, true, null),
20509 low(Float.class, true, 0.0f),
20510 dtype(Long.class, true, 1),
20511 ;
20512
20513 final Class<?> t;
20514 final boolean optional;
20515 final Object defaultValue;
20516
20517 Attribute(Class<?> type, boolean optional, Object defaultValue) {
20518 this.t = type;
20519 this.optional = optional;
20520 this.defaultValue = defaultValue;
20521 assert optional || defaultValue == null;
20522 }
20523
20524 public Class<?> type() {
20525 return t;
20526 }
20527
20528 public boolean isOptional() {
20529 return optional;
20530 }
20531
20532 public Object defaultValue() {
20533 return defaultValue;
20534 }
20535 }
20536
20537 public enum TypeConstraint implements OnnxTypeConstraint {
20538 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
20539 ;
20540
20541 final OnnxType.TypeVariable typeVariable;
20542
20543 TypeConstraint(OnnxType.TypeVariable typeVariable) {
20544 assert typeVariable.name().equals(name());
20545 this.typeVariable = typeVariable;
20546 }
20547
20548 @Override
20549 public OnnxType.TypeVariable typeVariable() {
20550 return typeVariable;
20551 }
20552 }
20553
20554 public enum InputParameter implements OnnxParameter.None { }
20555
20556 public enum OutputParameter implements OnnxParameter {
20557 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20558 ;
20559
20560 final OnnxType type;
20561 final Quantifier quantifier;
20562
20563 OutputParameter(OnnxType type, Quantifier quantifier) {
20564 this.type = type;
20565 this.quantifier = quantifier;
20566 }
20567
20568 @Override
20569 public OnnxType type() {
20570 return type;
20571 }
20572
20573 @Override
20574 public Quantifier quantifier() {
20575 return quantifier;
20576 }
20577 }
20578
20579 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
20580 NAME,
20581 List.of(Attribute.values()),
20582 List.of(TypeConstraint.values()),
20583 List.of(InputParameter.values()),
20584 List.of(OutputParameter.values())
20585 );
20586
20587 public RandomUniform(ExternalizedOp def) {
20588 super(SCHEMA, def);
20589 }
20590
20591 RandomUniform(RandomUniform that, CodeContext cc) {
20592 super(that, cc);
20593 }
20594
20595 @Override
20596 public RandomUniform transform(CodeContext cc, CodeTransformer ot) {
20597 return new RandomUniform(this, cc);
20598 }
20599
20600 RandomUniform(TypeElement resultType, java.util.Optional<Float> high, long[] shape, java.util.Optional<Float> seed, java.util.Optional<Float> low, java.util.Optional<Long> dtype) {
20601 super(SCHEMA, resultType, Set.of(), List.of(), List.of(high, shape, seed, low, dtype));
20602 }
20603
20604 @Override
20605 public SequencedSet<OnnxParameter> onnxOutputs() {
20606 return onnxOutputs(SCHEMA);
20607 }
20608
20609 @Override
20610 public SequencedMap<OnnxParameter, Object> onnxInputs() {
20611 return onnxInputs(SCHEMA, List.of());
20612 }
20613
20614 public java.util.Optional<Float> high() {
20615 Float high = Attribute.high.access(Float.class, onnxAttributes);
20616 return java.util.Optional.ofNullable(high);
20617 }
20618
20619 public long[] shape() {
20620 long[] shape = Attribute.shape.access(long[].class, onnxAttributes);
20621 return shape.clone();
20622 }
20623
20624 public java.util.Optional<Float> seed() {
20625 Float seed = Attribute.seed.access(Float.class, onnxAttributes);
20626 return java.util.Optional.ofNullable(seed);
20627 }
20628
20629 public java.util.Optional<Float> low() {
20630 Float low = Attribute.low.access(Float.class, onnxAttributes);
20631 return java.util.Optional.ofNullable(low);
20632 }
20633
20634 public java.util.Optional<Long> dtype() {
20635 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes);
20636 return java.util.Optional.ofNullable(dtype);
20637 }
20638
20639 }
20640
20641 public static RandomUniform RandomUniform(TypeElement resultType, java.util.Optional<Float> high, long[] shape, java.util.Optional<Float> seed, java.util.Optional<Float> low, java.util.Optional<Long> dtype) {
20642 return new RandomUniform(resultType, high, shape, seed, low, dtype);
20643 }
20644
20645 @OpFactoryHelper.OpDeclaration(RandomUniformLike.NAME)
20646 public static final class RandomUniformLike extends OnnxOp {
20647 public static final String NAME = "RandomUniformLike";
20648
20649 public enum Attribute implements OnnxAttribute {
20650 high(Float.class, true, 1.0f),
20651 seed(Float.class, true, null),
20652 low(Float.class, true, 0.0f),
20653 dtype(Long.class, true, null),
20654 ;
20655
20656 final Class<?> t;
20657 final boolean optional;
20658 final Object defaultValue;
20659
20660 Attribute(Class<?> type, boolean optional, Object defaultValue) {
20661 this.t = type;
20662 this.optional = optional;
20663 this.defaultValue = defaultValue;
20664 assert optional || defaultValue == null;
20665 }
20666
20667 public Class<?> type() {
20668 return t;
20669 }
20670
20671 public boolean isOptional() {
20672 return optional;
20673 }
20674
20675 public Object defaultValue() {
20676 return defaultValue;
20677 }
20678 }
20679
20680 public enum TypeConstraint implements OnnxTypeConstraint {
20681 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
20682 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
20683 ;
20684
20685 final OnnxType.TypeVariable typeVariable;
20686
20687 TypeConstraint(OnnxType.TypeVariable typeVariable) {
20688 assert typeVariable.name().equals(name());
20689 this.typeVariable = typeVariable;
20690 }
20691
20692 @Override
20693 public OnnxType.TypeVariable typeVariable() {
20694 return typeVariable;
20695 }
20696 }
20697
20698 public enum InputParameter implements OnnxParameter {
20699 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
20700 ;
20701
20702 final OnnxType type;
20703 final Quantifier quantifier;
20704
20705 InputParameter(OnnxType type, Quantifier quantifier) {
20706 this.type = type;
20707 this.quantifier = quantifier;
20708 }
20709
20710 @Override
20711 public OnnxType type() {
20712 return type;
20713 }
20714
20715 @Override
20716 public Quantifier quantifier() {
20717 return quantifier;
20718 }
20719 }
20720
20721 public enum OutputParameter implements OnnxParameter {
20722 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
20723 ;
20724
20725 final OnnxType type;
20726 final Quantifier quantifier;
20727
20728 OutputParameter(OnnxType type, Quantifier quantifier) {
20729 this.type = type;
20730 this.quantifier = quantifier;
20731 }
20732
20733 @Override
20734 public OnnxType type() {
20735 return type;
20736 }
20737
20738 @Override
20739 public Quantifier quantifier() {
20740 return quantifier;
20741 }
20742 }
20743
20744 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
20745 NAME,
20746 List.of(Attribute.values()),
20747 List.of(TypeConstraint.values()),
20748 List.of(InputParameter.values()),
20749 List.of(OutputParameter.values())
20750 );
20751
20752 public RandomUniformLike(ExternalizedOp def) {
20753 super(SCHEMA, def);
20754 }
20755
20756 RandomUniformLike(RandomUniformLike that, CodeContext cc) {
20757 super(that, cc);
20758 }
20759
20760 @Override
20761 public RandomUniformLike transform(CodeContext cc, CodeTransformer ot) {
20762 return new RandomUniformLike(this, cc);
20763 }
20764
20765 RandomUniformLike(TypeElement resultType, Value input, java.util.Optional<Float> high, java.util.Optional<Float> seed, java.util.Optional<Float> low, java.util.Optional<Long> dtype) {
20766 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(high, seed, low, dtype));
20767 }
20768
20769 @Override
20770 public SequencedSet<OnnxParameter> onnxOutputs() {
20771 return onnxOutputs(SCHEMA);
20772 }
20773
20774 @Override
20775 public SequencedMap<OnnxParameter, Object> onnxInputs() {
20776 return onnxInputs(SCHEMA, List.of(input()));
20777 }
20778
20779 public Value input() {
20780 return operands().get(0);
20781 }
20782
20783 public java.util.Optional<Float> high() {
20784 Float high = Attribute.high.access(Float.class, onnxAttributes);
20785 return java.util.Optional.ofNullable(high);
20786 }
20787
20788 public java.util.Optional<Float> seed() {
20789 Float seed = Attribute.seed.access(Float.class, onnxAttributes);
20790 return java.util.Optional.ofNullable(seed);
20791 }
20792
20793 public java.util.Optional<Float> low() {
20794 Float low = Attribute.low.access(Float.class, onnxAttributes);
20795 return java.util.Optional.ofNullable(low);
20796 }
20797
20798 public java.util.Optional<Long> dtype() {
20799 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes);
20800 return java.util.Optional.ofNullable(dtype);
20801 }
20802
20803 }
20804
20805 public static RandomUniformLike RandomUniformLike(TypeElement resultType, Value input, java.util.Optional<Float> high, java.util.Optional<Float> seed, java.util.Optional<Float> low, java.util.Optional<Long> dtype) {
20806 return new RandomUniformLike(resultType, input, high, seed, low, dtype);
20807 }
20808
20809 @OpFactoryHelper.OpDeclaration(Range.NAME)
20810 public static final class Range extends OnnxOp {
20811 public static final String NAME = "Range";
20812
20813 public enum Attribute implements OnnxAttribute.None { }
20814
20815 public enum TypeConstraint implements OnnxTypeConstraint {
20816 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
20817 ;
20818
20819 final OnnxType.TypeVariable typeVariable;
20820
20821 TypeConstraint(OnnxType.TypeVariable typeVariable) {
20822 assert typeVariable.name().equals(name());
20823 this.typeVariable = typeVariable;
20824 }
20825
20826 @Override
20827 public OnnxType.TypeVariable typeVariable() {
20828 return typeVariable;
20829 }
20830 }
20831
20832 public enum InputParameter implements OnnxParameter {
20833 start(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20834 limit(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20835 delta(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20836 ;
20837
20838 final OnnxType type;
20839 final Quantifier quantifier;
20840
20841 InputParameter(OnnxType type, Quantifier quantifier) {
20842 this.type = type;
20843 this.quantifier = quantifier;
20844 }
20845
20846 @Override
20847 public OnnxType type() {
20848 return type;
20849 }
20850
20851 @Override
20852 public Quantifier quantifier() {
20853 return quantifier;
20854 }
20855 }
20856
20857 public enum OutputParameter implements OnnxParameter {
20858 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20859 ;
20860
20861 final OnnxType type;
20862 final Quantifier quantifier;
20863
20864 OutputParameter(OnnxType type, Quantifier quantifier) {
20865 this.type = type;
20866 this.quantifier = quantifier;
20867 }
20868
20869 @Override
20870 public OnnxType type() {
20871 return type;
20872 }
20873
20874 @Override
20875 public Quantifier quantifier() {
20876 return quantifier;
20877 }
20878 }
20879
20880 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
20881 NAME,
20882 List.of(Attribute.values()),
20883 List.of(TypeConstraint.values()),
20884 List.of(InputParameter.values()),
20885 List.of(OutputParameter.values())
20886 );
20887
20888 public Range(ExternalizedOp def) {
20889 super(SCHEMA, def);
20890 }
20891
20892 Range(Range that, CodeContext cc) {
20893 super(that, cc);
20894 }
20895
20896 @Override
20897 public Range transform(CodeContext cc, CodeTransformer ot) {
20898 return new Range(this, cc);
20899 }
20900
20901 Range(TypeElement resultType, Value start, Value limit, Value delta) {
20902 super(SCHEMA, resultType, Set.of(), List.of(start, limit, delta), List.of());
20903 }
20904
20905 @Override
20906 public SequencedSet<OnnxParameter> onnxOutputs() {
20907 return onnxOutputs(SCHEMA);
20908 }
20909
20910 @Override
20911 public SequencedMap<OnnxParameter, Object> onnxInputs() {
20912 return onnxInputs(SCHEMA, List.of(start(), limit(), delta()));
20913 }
20914
20915 public Value start() {
20916 return operands().get(0);
20917 }
20918
20919 public Value limit() {
20920 return operands().get(1);
20921 }
20922
20923 public Value delta() {
20924 return operands().get(2);
20925 }
20926
20927 }
20928
20929 public static Range Range(TypeElement resultType, Value start, Value limit, Value delta) {
20930 return new Range(resultType, start, limit, delta);
20931 }
20932
20933 @OpFactoryHelper.OpDeclaration(Reciprocal.NAME)
20934 public static final class Reciprocal extends OnnxOp {
20935 public static final String NAME = "Reciprocal";
20936
20937 public enum Attribute implements OnnxAttribute.None { }
20938
20939 public enum TypeConstraint implements OnnxTypeConstraint {
20940 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
20941 ;
20942
20943 final OnnxType.TypeVariable typeVariable;
20944
20945 TypeConstraint(OnnxType.TypeVariable typeVariable) {
20946 assert typeVariable.name().equals(name());
20947 this.typeVariable = typeVariable;
20948 }
20949
20950 @Override
20951 public OnnxType.TypeVariable typeVariable() {
20952 return typeVariable;
20953 }
20954 }
20955
20956 public enum InputParameter implements OnnxParameter {
20957 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20958 ;
20959
20960 final OnnxType type;
20961 final Quantifier quantifier;
20962
20963 InputParameter(OnnxType type, Quantifier quantifier) {
20964 this.type = type;
20965 this.quantifier = quantifier;
20966 }
20967
20968 @Override
20969 public OnnxType type() {
20970 return type;
20971 }
20972
20973 @Override
20974 public Quantifier quantifier() {
20975 return quantifier;
20976 }
20977 }
20978
20979 public enum OutputParameter implements OnnxParameter {
20980 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
20981 ;
20982
20983 final OnnxType type;
20984 final Quantifier quantifier;
20985
20986 OutputParameter(OnnxType type, Quantifier quantifier) {
20987 this.type = type;
20988 this.quantifier = quantifier;
20989 }
20990
20991 @Override
20992 public OnnxType type() {
20993 return type;
20994 }
20995
20996 @Override
20997 public Quantifier quantifier() {
20998 return quantifier;
20999 }
21000 }
21001
21002 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
21003 NAME,
21004 List.of(Attribute.values()),
21005 List.of(TypeConstraint.values()),
21006 List.of(InputParameter.values()),
21007 List.of(OutputParameter.values())
21008 );
21009
21010 public Reciprocal(ExternalizedOp def) {
21011 super(SCHEMA, def);
21012 }
21013
21014 Reciprocal(Reciprocal that, CodeContext cc) {
21015 super(that, cc);
21016 }
21017
21018 @Override
21019 public Reciprocal transform(CodeContext cc, CodeTransformer ot) {
21020 return new Reciprocal(this, cc);
21021 }
21022
21023 Reciprocal(TypeElement resultType, Value X) {
21024 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
21025 }
21026
21027 @Override
21028 public SequencedSet<OnnxParameter> onnxOutputs() {
21029 return onnxOutputs(SCHEMA);
21030 }
21031
21032 @Override
21033 public SequencedMap<OnnxParameter, Object> onnxInputs() {
21034 return onnxInputs(SCHEMA, List.of(X()));
21035 }
21036
21037 public Value X() {
21038 return operands().get(0);
21039 }
21040
21041 }
21042
21043 public static Reciprocal Reciprocal(TypeElement resultType, Value X) {
21044 return new Reciprocal(resultType, X);
21045 }
21046
21047 @OpFactoryHelper.OpDeclaration(ReduceL1.NAME)
21048 public static final class ReduceL1 extends OnnxOp {
21049 public static final String NAME = "ReduceL1";
21050
21051 public enum Attribute implements OnnxAttribute {
21052 noop_with_empty_axes(Long.class, true, 0),
21053 keepdims(Long.class, true, 1),
21054 ;
21055
21056 final Class<?> t;
21057 final boolean optional;
21058 final Object defaultValue;
21059
21060 Attribute(Class<?> type, boolean optional, Object defaultValue) {
21061 this.t = type;
21062 this.optional = optional;
21063 this.defaultValue = defaultValue;
21064 assert optional || defaultValue == null;
21065 }
21066
21067 public Class<?> type() {
21068 return t;
21069 }
21070
21071 public boolean isOptional() {
21072 return optional;
21073 }
21074
21075 public Object defaultValue() {
21076 return defaultValue;
21077 }
21078 }
21079
21080 public enum TypeConstraint implements OnnxTypeConstraint {
21081 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
21082 ;
21083
21084 final OnnxType.TypeVariable typeVariable;
21085
21086 TypeConstraint(OnnxType.TypeVariable typeVariable) {
21087 assert typeVariable.name().equals(name());
21088 this.typeVariable = typeVariable;
21089 }
21090
21091 @Override
21092 public OnnxType.TypeVariable typeVariable() {
21093 return typeVariable;
21094 }
21095 }
21096
21097 public enum InputParameter implements OnnxParameter {
21098 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21099 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
21100 ;
21101
21102 final OnnxType type;
21103 final Quantifier quantifier;
21104
21105 InputParameter(OnnxType type, Quantifier quantifier) {
21106 this.type = type;
21107 this.quantifier = quantifier;
21108 }
21109
21110 @Override
21111 public OnnxType type() {
21112 return type;
21113 }
21114
21115 @Override
21116 public Quantifier quantifier() {
21117 return quantifier;
21118 }
21119 }
21120
21121 public enum OutputParameter implements OnnxParameter {
21122 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21123 ;
21124
21125 final OnnxType type;
21126 final Quantifier quantifier;
21127
21128 OutputParameter(OnnxType type, Quantifier quantifier) {
21129 this.type = type;
21130 this.quantifier = quantifier;
21131 }
21132
21133 @Override
21134 public OnnxType type() {
21135 return type;
21136 }
21137
21138 @Override
21139 public Quantifier quantifier() {
21140 return quantifier;
21141 }
21142 }
21143
21144 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
21145 NAME,
21146 List.of(Attribute.values()),
21147 List.of(TypeConstraint.values()),
21148 List.of(InputParameter.values()),
21149 List.of(OutputParameter.values())
21150 );
21151
21152 public ReduceL1(ExternalizedOp def) {
21153 super(SCHEMA, def);
21154 }
21155
21156 ReduceL1(ReduceL1 that, CodeContext cc) {
21157 super(that, cc);
21158 }
21159
21160 @Override
21161 public ReduceL1 transform(CodeContext cc, CodeTransformer ot) {
21162 return new ReduceL1(this, cc);
21163 }
21164
21165 ReduceL1(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21166 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
21167 }
21168
21169 @Override
21170 public SequencedSet<OnnxParameter> onnxOutputs() {
21171 return onnxOutputs(SCHEMA);
21172 }
21173
21174 @Override
21175 public SequencedMap<OnnxParameter, Object> onnxInputs() {
21176 return onnxInputs(SCHEMA, List.of(data(), axes()));
21177 }
21178
21179 public Value data() {
21180 return operands().get(0);
21181 }
21182
21183 public java.util.Optional<Value> axes() {
21184 int i = optionalInputArguments.indexOf(InputParameter.axes);
21185 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
21186 }
21187
21188 public java.util.Optional<Long> noop_with_empty_axes() {
21189 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
21190 return java.util.Optional.ofNullable(noop_with_empty_axes);
21191 }
21192
21193 public java.util.Optional<Long> keepdims() {
21194 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
21195 return java.util.Optional.ofNullable(keepdims);
21196 }
21197
21198 }
21199
21200 public static ReduceL1 ReduceL1(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21201 return new ReduceL1(resultType, data, axes, noop_with_empty_axes, keepdims);
21202 }
21203
21204 @OpFactoryHelper.OpDeclaration(ReduceL2.NAME)
21205 public static final class ReduceL2 extends OnnxOp {
21206 public static final String NAME = "ReduceL2";
21207
21208 public enum Attribute implements OnnxAttribute {
21209 noop_with_empty_axes(Long.class, true, 0),
21210 keepdims(Long.class, true, 1),
21211 ;
21212
21213 final Class<?> t;
21214 final boolean optional;
21215 final Object defaultValue;
21216
21217 Attribute(Class<?> type, boolean optional, Object defaultValue) {
21218 this.t = type;
21219 this.optional = optional;
21220 this.defaultValue = defaultValue;
21221 assert optional || defaultValue == null;
21222 }
21223
21224 public Class<?> type() {
21225 return t;
21226 }
21227
21228 public boolean isOptional() {
21229 return optional;
21230 }
21231
21232 public Object defaultValue() {
21233 return defaultValue;
21234 }
21235 }
21236
21237 public enum TypeConstraint implements OnnxTypeConstraint {
21238 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
21239 ;
21240
21241 final OnnxType.TypeVariable typeVariable;
21242
21243 TypeConstraint(OnnxType.TypeVariable typeVariable) {
21244 assert typeVariable.name().equals(name());
21245 this.typeVariable = typeVariable;
21246 }
21247
21248 @Override
21249 public OnnxType.TypeVariable typeVariable() {
21250 return typeVariable;
21251 }
21252 }
21253
21254 public enum InputParameter implements OnnxParameter {
21255 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21256 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
21257 ;
21258
21259 final OnnxType type;
21260 final Quantifier quantifier;
21261
21262 InputParameter(OnnxType type, Quantifier quantifier) {
21263 this.type = type;
21264 this.quantifier = quantifier;
21265 }
21266
21267 @Override
21268 public OnnxType type() {
21269 return type;
21270 }
21271
21272 @Override
21273 public Quantifier quantifier() {
21274 return quantifier;
21275 }
21276 }
21277
21278 public enum OutputParameter implements OnnxParameter {
21279 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21280 ;
21281
21282 final OnnxType type;
21283 final Quantifier quantifier;
21284
21285 OutputParameter(OnnxType type, Quantifier quantifier) {
21286 this.type = type;
21287 this.quantifier = quantifier;
21288 }
21289
21290 @Override
21291 public OnnxType type() {
21292 return type;
21293 }
21294
21295 @Override
21296 public Quantifier quantifier() {
21297 return quantifier;
21298 }
21299 }
21300
21301 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
21302 NAME,
21303 List.of(Attribute.values()),
21304 List.of(TypeConstraint.values()),
21305 List.of(InputParameter.values()),
21306 List.of(OutputParameter.values())
21307 );
21308
21309 public ReduceL2(ExternalizedOp def) {
21310 super(SCHEMA, def);
21311 }
21312
21313 ReduceL2(ReduceL2 that, CodeContext cc) {
21314 super(that, cc);
21315 }
21316
21317 @Override
21318 public ReduceL2 transform(CodeContext cc, CodeTransformer ot) {
21319 return new ReduceL2(this, cc);
21320 }
21321
21322 ReduceL2(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21323 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
21324 }
21325
21326 @Override
21327 public SequencedSet<OnnxParameter> onnxOutputs() {
21328 return onnxOutputs(SCHEMA);
21329 }
21330
21331 @Override
21332 public SequencedMap<OnnxParameter, Object> onnxInputs() {
21333 return onnxInputs(SCHEMA, List.of(data(), axes()));
21334 }
21335
21336 public Value data() {
21337 return operands().get(0);
21338 }
21339
21340 public java.util.Optional<Value> axes() {
21341 int i = optionalInputArguments.indexOf(InputParameter.axes);
21342 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
21343 }
21344
21345 public java.util.Optional<Long> noop_with_empty_axes() {
21346 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
21347 return java.util.Optional.ofNullable(noop_with_empty_axes);
21348 }
21349
21350 public java.util.Optional<Long> keepdims() {
21351 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
21352 return java.util.Optional.ofNullable(keepdims);
21353 }
21354
21355 }
21356
21357 public static ReduceL2 ReduceL2(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21358 return new ReduceL2(resultType, data, axes, noop_with_empty_axes, keepdims);
21359 }
21360
21361 @OpFactoryHelper.OpDeclaration(ReduceLogSum.NAME)
21362 public static final class ReduceLogSum extends OnnxOp {
21363 public static final String NAME = "ReduceLogSum";
21364
21365 public enum Attribute implements OnnxAttribute {
21366 noop_with_empty_axes(Long.class, true, 0),
21367 keepdims(Long.class, true, 1),
21368 ;
21369
21370 final Class<?> t;
21371 final boolean optional;
21372 final Object defaultValue;
21373
21374 Attribute(Class<?> type, boolean optional, Object defaultValue) {
21375 this.t = type;
21376 this.optional = optional;
21377 this.defaultValue = defaultValue;
21378 assert optional || defaultValue == null;
21379 }
21380
21381 public Class<?> type() {
21382 return t;
21383 }
21384
21385 public boolean isOptional() {
21386 return optional;
21387 }
21388
21389 public Object defaultValue() {
21390 return defaultValue;
21391 }
21392 }
21393
21394 public enum TypeConstraint implements OnnxTypeConstraint {
21395 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
21396 ;
21397
21398 final OnnxType.TypeVariable typeVariable;
21399
21400 TypeConstraint(OnnxType.TypeVariable typeVariable) {
21401 assert typeVariable.name().equals(name());
21402 this.typeVariable = typeVariable;
21403 }
21404
21405 @Override
21406 public OnnxType.TypeVariable typeVariable() {
21407 return typeVariable;
21408 }
21409 }
21410
21411 public enum InputParameter implements OnnxParameter {
21412 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21413 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
21414 ;
21415
21416 final OnnxType type;
21417 final Quantifier quantifier;
21418
21419 InputParameter(OnnxType type, Quantifier quantifier) {
21420 this.type = type;
21421 this.quantifier = quantifier;
21422 }
21423
21424 @Override
21425 public OnnxType type() {
21426 return type;
21427 }
21428
21429 @Override
21430 public Quantifier quantifier() {
21431 return quantifier;
21432 }
21433 }
21434
21435 public enum OutputParameter implements OnnxParameter {
21436 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21437 ;
21438
21439 final OnnxType type;
21440 final Quantifier quantifier;
21441
21442 OutputParameter(OnnxType type, Quantifier quantifier) {
21443 this.type = type;
21444 this.quantifier = quantifier;
21445 }
21446
21447 @Override
21448 public OnnxType type() {
21449 return type;
21450 }
21451
21452 @Override
21453 public Quantifier quantifier() {
21454 return quantifier;
21455 }
21456 }
21457
21458 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
21459 NAME,
21460 List.of(Attribute.values()),
21461 List.of(TypeConstraint.values()),
21462 List.of(InputParameter.values()),
21463 List.of(OutputParameter.values())
21464 );
21465
21466 public ReduceLogSum(ExternalizedOp def) {
21467 super(SCHEMA, def);
21468 }
21469
21470 ReduceLogSum(ReduceLogSum that, CodeContext cc) {
21471 super(that, cc);
21472 }
21473
21474 @Override
21475 public ReduceLogSum transform(CodeContext cc, CodeTransformer ot) {
21476 return new ReduceLogSum(this, cc);
21477 }
21478
21479 ReduceLogSum(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21480 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
21481 }
21482
21483 @Override
21484 public SequencedSet<OnnxParameter> onnxOutputs() {
21485 return onnxOutputs(SCHEMA);
21486 }
21487
21488 @Override
21489 public SequencedMap<OnnxParameter, Object> onnxInputs() {
21490 return onnxInputs(SCHEMA, List.of(data(), axes()));
21491 }
21492
21493 public Value data() {
21494 return operands().get(0);
21495 }
21496
21497 public java.util.Optional<Value> axes() {
21498 int i = optionalInputArguments.indexOf(InputParameter.axes);
21499 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
21500 }
21501
21502 public java.util.Optional<Long> noop_with_empty_axes() {
21503 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
21504 return java.util.Optional.ofNullable(noop_with_empty_axes);
21505 }
21506
21507 public java.util.Optional<Long> keepdims() {
21508 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
21509 return java.util.Optional.ofNullable(keepdims);
21510 }
21511
21512 }
21513
21514 public static ReduceLogSum ReduceLogSum(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21515 return new ReduceLogSum(resultType, data, axes, noop_with_empty_axes, keepdims);
21516 }
21517
21518 @OpFactoryHelper.OpDeclaration(ReduceLogSumExp.NAME)
21519 public static final class ReduceLogSumExp extends OnnxOp {
21520 public static final String NAME = "ReduceLogSumExp";
21521
21522 public enum Attribute implements OnnxAttribute {
21523 noop_with_empty_axes(Long.class, true, 0),
21524 keepdims(Long.class, true, 1),
21525 ;
21526
21527 final Class<?> t;
21528 final boolean optional;
21529 final Object defaultValue;
21530
21531 Attribute(Class<?> type, boolean optional, Object defaultValue) {
21532 this.t = type;
21533 this.optional = optional;
21534 this.defaultValue = defaultValue;
21535 assert optional || defaultValue == null;
21536 }
21537
21538 public Class<?> type() {
21539 return t;
21540 }
21541
21542 public boolean isOptional() {
21543 return optional;
21544 }
21545
21546 public Object defaultValue() {
21547 return defaultValue;
21548 }
21549 }
21550
21551 public enum TypeConstraint implements OnnxTypeConstraint {
21552 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
21553 ;
21554
21555 final OnnxType.TypeVariable typeVariable;
21556
21557 TypeConstraint(OnnxType.TypeVariable typeVariable) {
21558 assert typeVariable.name().equals(name());
21559 this.typeVariable = typeVariable;
21560 }
21561
21562 @Override
21563 public OnnxType.TypeVariable typeVariable() {
21564 return typeVariable;
21565 }
21566 }
21567
21568 public enum InputParameter implements OnnxParameter {
21569 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21570 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
21571 ;
21572
21573 final OnnxType type;
21574 final Quantifier quantifier;
21575
21576 InputParameter(OnnxType type, Quantifier quantifier) {
21577 this.type = type;
21578 this.quantifier = quantifier;
21579 }
21580
21581 @Override
21582 public OnnxType type() {
21583 return type;
21584 }
21585
21586 @Override
21587 public Quantifier quantifier() {
21588 return quantifier;
21589 }
21590 }
21591
21592 public enum OutputParameter implements OnnxParameter {
21593 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21594 ;
21595
21596 final OnnxType type;
21597 final Quantifier quantifier;
21598
21599 OutputParameter(OnnxType type, Quantifier quantifier) {
21600 this.type = type;
21601 this.quantifier = quantifier;
21602 }
21603
21604 @Override
21605 public OnnxType type() {
21606 return type;
21607 }
21608
21609 @Override
21610 public Quantifier quantifier() {
21611 return quantifier;
21612 }
21613 }
21614
21615 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
21616 NAME,
21617 List.of(Attribute.values()),
21618 List.of(TypeConstraint.values()),
21619 List.of(InputParameter.values()),
21620 List.of(OutputParameter.values())
21621 );
21622
21623 public ReduceLogSumExp(ExternalizedOp def) {
21624 super(SCHEMA, def);
21625 }
21626
21627 ReduceLogSumExp(ReduceLogSumExp that, CodeContext cc) {
21628 super(that, cc);
21629 }
21630
21631 @Override
21632 public ReduceLogSumExp transform(CodeContext cc, CodeTransformer ot) {
21633 return new ReduceLogSumExp(this, cc);
21634 }
21635
21636 ReduceLogSumExp(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21637 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
21638 }
21639
21640 @Override
21641 public SequencedSet<OnnxParameter> onnxOutputs() {
21642 return onnxOutputs(SCHEMA);
21643 }
21644
21645 @Override
21646 public SequencedMap<OnnxParameter, Object> onnxInputs() {
21647 return onnxInputs(SCHEMA, List.of(data(), axes()));
21648 }
21649
21650 public Value data() {
21651 return operands().get(0);
21652 }
21653
21654 public java.util.Optional<Value> axes() {
21655 int i = optionalInputArguments.indexOf(InputParameter.axes);
21656 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
21657 }
21658
21659 public java.util.Optional<Long> noop_with_empty_axes() {
21660 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
21661 return java.util.Optional.ofNullable(noop_with_empty_axes);
21662 }
21663
21664 public java.util.Optional<Long> keepdims() {
21665 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
21666 return java.util.Optional.ofNullable(keepdims);
21667 }
21668
21669 }
21670
21671 public static ReduceLogSumExp ReduceLogSumExp(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21672 return new ReduceLogSumExp(resultType, data, axes, noop_with_empty_axes, keepdims);
21673 }
21674
21675 @OpFactoryHelper.OpDeclaration(ReduceMax.NAME)
21676 public static final class ReduceMax extends OnnxOp {
21677 public static final String NAME = "ReduceMax";
21678
21679 public enum Attribute implements OnnxAttribute {
21680 noop_with_empty_axes(Long.class, true, 0),
21681 keepdims(Long.class, true, 1),
21682 ;
21683
21684 final Class<?> t;
21685 final boolean optional;
21686 final Object defaultValue;
21687
21688 Attribute(Class<?> type, boolean optional, Object defaultValue) {
21689 this.t = type;
21690 this.optional = optional;
21691 this.defaultValue = defaultValue;
21692 assert optional || defaultValue == null;
21693 }
21694
21695 public Class<?> type() {
21696 return t;
21697 }
21698
21699 public boolean isOptional() {
21700 return optional;
21701 }
21702
21703 public Object defaultValue() {
21704 return defaultValue;
21705 }
21706 }
21707
21708 public enum TypeConstraint implements OnnxTypeConstraint {
21709 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.bool())))),
21710 ;
21711
21712 final OnnxType.TypeVariable typeVariable;
21713
21714 TypeConstraint(OnnxType.TypeVariable typeVariable) {
21715 assert typeVariable.name().equals(name());
21716 this.typeVariable = typeVariable;
21717 }
21718
21719 @Override
21720 public OnnxType.TypeVariable typeVariable() {
21721 return typeVariable;
21722 }
21723 }
21724
21725 public enum InputParameter implements OnnxParameter {
21726 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21727 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
21728 ;
21729
21730 final OnnxType type;
21731 final Quantifier quantifier;
21732
21733 InputParameter(OnnxType type, Quantifier quantifier) {
21734 this.type = type;
21735 this.quantifier = quantifier;
21736 }
21737
21738 @Override
21739 public OnnxType type() {
21740 return type;
21741 }
21742
21743 @Override
21744 public Quantifier quantifier() {
21745 return quantifier;
21746 }
21747 }
21748
21749 public enum OutputParameter implements OnnxParameter {
21750 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21751 ;
21752
21753 final OnnxType type;
21754 final Quantifier quantifier;
21755
21756 OutputParameter(OnnxType type, Quantifier quantifier) {
21757 this.type = type;
21758 this.quantifier = quantifier;
21759 }
21760
21761 @Override
21762 public OnnxType type() {
21763 return type;
21764 }
21765
21766 @Override
21767 public Quantifier quantifier() {
21768 return quantifier;
21769 }
21770 }
21771
21772 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
21773 NAME,
21774 List.of(Attribute.values()),
21775 List.of(TypeConstraint.values()),
21776 List.of(InputParameter.values()),
21777 List.of(OutputParameter.values())
21778 );
21779
21780 public ReduceMax(ExternalizedOp def) {
21781 super(SCHEMA, def);
21782 }
21783
21784 ReduceMax(ReduceMax that, CodeContext cc) {
21785 super(that, cc);
21786 }
21787
21788 @Override
21789 public ReduceMax transform(CodeContext cc, CodeTransformer ot) {
21790 return new ReduceMax(this, cc);
21791 }
21792
21793 ReduceMax(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21794 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
21795 }
21796
21797 @Override
21798 public SequencedSet<OnnxParameter> onnxOutputs() {
21799 return onnxOutputs(SCHEMA);
21800 }
21801
21802 @Override
21803 public SequencedMap<OnnxParameter, Object> onnxInputs() {
21804 return onnxInputs(SCHEMA, List.of(data(), axes()));
21805 }
21806
21807 public Value data() {
21808 return operands().get(0);
21809 }
21810
21811 public java.util.Optional<Value> axes() {
21812 int i = optionalInputArguments.indexOf(InputParameter.axes);
21813 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
21814 }
21815
21816 public java.util.Optional<Long> noop_with_empty_axes() {
21817 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
21818 return java.util.Optional.ofNullable(noop_with_empty_axes);
21819 }
21820
21821 public java.util.Optional<Long> keepdims() {
21822 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
21823 return java.util.Optional.ofNullable(keepdims);
21824 }
21825
21826 }
21827
21828 public static ReduceMax ReduceMax(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21829 return new ReduceMax(resultType, data, axes, noop_with_empty_axes, keepdims);
21830 }
21831
21832 @OpFactoryHelper.OpDeclaration(ReduceMean.NAME)
21833 public static final class ReduceMean extends OnnxOp {
21834 public static final String NAME = "ReduceMean";
21835
21836 public enum Attribute implements OnnxAttribute {
21837 noop_with_empty_axes(Long.class, true, 0),
21838 keepdims(Long.class, true, 1),
21839 ;
21840
21841 final Class<?> t;
21842 final boolean optional;
21843 final Object defaultValue;
21844
21845 Attribute(Class<?> type, boolean optional, Object defaultValue) {
21846 this.t = type;
21847 this.optional = optional;
21848 this.defaultValue = defaultValue;
21849 assert optional || defaultValue == null;
21850 }
21851
21852 public Class<?> type() {
21853 return t;
21854 }
21855
21856 public boolean isOptional() {
21857 return optional;
21858 }
21859
21860 public Object defaultValue() {
21861 return defaultValue;
21862 }
21863 }
21864
21865 public enum TypeConstraint implements OnnxTypeConstraint {
21866 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
21867 ;
21868
21869 final OnnxType.TypeVariable typeVariable;
21870
21871 TypeConstraint(OnnxType.TypeVariable typeVariable) {
21872 assert typeVariable.name().equals(name());
21873 this.typeVariable = typeVariable;
21874 }
21875
21876 @Override
21877 public OnnxType.TypeVariable typeVariable() {
21878 return typeVariable;
21879 }
21880 }
21881
21882 public enum InputParameter implements OnnxParameter {
21883 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21884 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
21885 ;
21886
21887 final OnnxType type;
21888 final Quantifier quantifier;
21889
21890 InputParameter(OnnxType type, Quantifier quantifier) {
21891 this.type = type;
21892 this.quantifier = quantifier;
21893 }
21894
21895 @Override
21896 public OnnxType type() {
21897 return type;
21898 }
21899
21900 @Override
21901 public Quantifier quantifier() {
21902 return quantifier;
21903 }
21904 }
21905
21906 public enum OutputParameter implements OnnxParameter {
21907 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
21908 ;
21909
21910 final OnnxType type;
21911 final Quantifier quantifier;
21912
21913 OutputParameter(OnnxType type, Quantifier quantifier) {
21914 this.type = type;
21915 this.quantifier = quantifier;
21916 }
21917
21918 @Override
21919 public OnnxType type() {
21920 return type;
21921 }
21922
21923 @Override
21924 public Quantifier quantifier() {
21925 return quantifier;
21926 }
21927 }
21928
21929 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
21930 NAME,
21931 List.of(Attribute.values()),
21932 List.of(TypeConstraint.values()),
21933 List.of(InputParameter.values()),
21934 List.of(OutputParameter.values())
21935 );
21936
21937 public ReduceMean(ExternalizedOp def) {
21938 super(SCHEMA, def);
21939 }
21940
21941 ReduceMean(ReduceMean that, CodeContext cc) {
21942 super(that, cc);
21943 }
21944
21945 @Override
21946 public ReduceMean transform(CodeContext cc, CodeTransformer ot) {
21947 return new ReduceMean(this, cc);
21948 }
21949
21950 ReduceMean(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21951 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
21952 }
21953
21954 @Override
21955 public SequencedSet<OnnxParameter> onnxOutputs() {
21956 return onnxOutputs(SCHEMA);
21957 }
21958
21959 @Override
21960 public SequencedMap<OnnxParameter, Object> onnxInputs() {
21961 return onnxInputs(SCHEMA, List.of(data(), axes()));
21962 }
21963
21964 public Value data() {
21965 return operands().get(0);
21966 }
21967
21968 public java.util.Optional<Value> axes() {
21969 int i = optionalInputArguments.indexOf(InputParameter.axes);
21970 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
21971 }
21972
21973 public java.util.Optional<Long> noop_with_empty_axes() {
21974 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
21975 return java.util.Optional.ofNullable(noop_with_empty_axes);
21976 }
21977
21978 public java.util.Optional<Long> keepdims() {
21979 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
21980 return java.util.Optional.ofNullable(keepdims);
21981 }
21982
21983 }
21984
21985 public static ReduceMean ReduceMean(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
21986 return new ReduceMean(resultType, data, axes, noop_with_empty_axes, keepdims);
21987 }
21988
21989 @OpFactoryHelper.OpDeclaration(ReduceMin.NAME)
21990 public static final class ReduceMin extends OnnxOp {
21991 public static final String NAME = "ReduceMin";
21992
21993 public enum Attribute implements OnnxAttribute {
21994 noop_with_empty_axes(Long.class, true, 0),
21995 keepdims(Long.class, true, 1),
21996 ;
21997
21998 final Class<?> t;
21999 final boolean optional;
22000 final Object defaultValue;
22001
22002 Attribute(Class<?> type, boolean optional, Object defaultValue) {
22003 this.t = type;
22004 this.optional = optional;
22005 this.defaultValue = defaultValue;
22006 assert optional || defaultValue == null;
22007 }
22008
22009 public Class<?> type() {
22010 return t;
22011 }
22012
22013 public boolean isOptional() {
22014 return optional;
22015 }
22016
22017 public Object defaultValue() {
22018 return defaultValue;
22019 }
22020 }
22021
22022 public enum TypeConstraint implements OnnxTypeConstraint {
22023 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.bool())))),
22024 ;
22025
22026 final OnnxType.TypeVariable typeVariable;
22027
22028 TypeConstraint(OnnxType.TypeVariable typeVariable) {
22029 assert typeVariable.name().equals(name());
22030 this.typeVariable = typeVariable;
22031 }
22032
22033 @Override
22034 public OnnxType.TypeVariable typeVariable() {
22035 return typeVariable;
22036 }
22037 }
22038
22039 public enum InputParameter implements OnnxParameter {
22040 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22041 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
22042 ;
22043
22044 final OnnxType type;
22045 final Quantifier quantifier;
22046
22047 InputParameter(OnnxType type, Quantifier quantifier) {
22048 this.type = type;
22049 this.quantifier = quantifier;
22050 }
22051
22052 @Override
22053 public OnnxType type() {
22054 return type;
22055 }
22056
22057 @Override
22058 public Quantifier quantifier() {
22059 return quantifier;
22060 }
22061 }
22062
22063 public enum OutputParameter implements OnnxParameter {
22064 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22065 ;
22066
22067 final OnnxType type;
22068 final Quantifier quantifier;
22069
22070 OutputParameter(OnnxType type, Quantifier quantifier) {
22071 this.type = type;
22072 this.quantifier = quantifier;
22073 }
22074
22075 @Override
22076 public OnnxType type() {
22077 return type;
22078 }
22079
22080 @Override
22081 public Quantifier quantifier() {
22082 return quantifier;
22083 }
22084 }
22085
22086 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
22087 NAME,
22088 List.of(Attribute.values()),
22089 List.of(TypeConstraint.values()),
22090 List.of(InputParameter.values()),
22091 List.of(OutputParameter.values())
22092 );
22093
22094 public ReduceMin(ExternalizedOp def) {
22095 super(SCHEMA, def);
22096 }
22097
22098 ReduceMin(ReduceMin that, CodeContext cc) {
22099 super(that, cc);
22100 }
22101
22102 @Override
22103 public ReduceMin transform(CodeContext cc, CodeTransformer ot) {
22104 return new ReduceMin(this, cc);
22105 }
22106
22107 ReduceMin(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
22108 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
22109 }
22110
22111 @Override
22112 public SequencedSet<OnnxParameter> onnxOutputs() {
22113 return onnxOutputs(SCHEMA);
22114 }
22115
22116 @Override
22117 public SequencedMap<OnnxParameter, Object> onnxInputs() {
22118 return onnxInputs(SCHEMA, List.of(data(), axes()));
22119 }
22120
22121 public Value data() {
22122 return operands().get(0);
22123 }
22124
22125 public java.util.Optional<Value> axes() {
22126 int i = optionalInputArguments.indexOf(InputParameter.axes);
22127 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
22128 }
22129
22130 public java.util.Optional<Long> noop_with_empty_axes() {
22131 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
22132 return java.util.Optional.ofNullable(noop_with_empty_axes);
22133 }
22134
22135 public java.util.Optional<Long> keepdims() {
22136 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
22137 return java.util.Optional.ofNullable(keepdims);
22138 }
22139
22140 }
22141
22142 public static ReduceMin ReduceMin(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
22143 return new ReduceMin(resultType, data, axes, noop_with_empty_axes, keepdims);
22144 }
22145
22146 @OpFactoryHelper.OpDeclaration(ReduceProd.NAME)
22147 public static final class ReduceProd extends OnnxOp {
22148 public static final String NAME = "ReduceProd";
22149
22150 public enum Attribute implements OnnxAttribute {
22151 noop_with_empty_axes(Long.class, true, 0),
22152 keepdims(Long.class, true, 1),
22153 ;
22154
22155 final Class<?> t;
22156 final boolean optional;
22157 final Object defaultValue;
22158
22159 Attribute(Class<?> type, boolean optional, Object defaultValue) {
22160 this.t = type;
22161 this.optional = optional;
22162 this.defaultValue = defaultValue;
22163 assert optional || defaultValue == null;
22164 }
22165
22166 public Class<?> type() {
22167 return t;
22168 }
22169
22170 public boolean isOptional() {
22171 return optional;
22172 }
22173
22174 public Object defaultValue() {
22175 return defaultValue;
22176 }
22177 }
22178
22179 public enum TypeConstraint implements OnnxTypeConstraint {
22180 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
22181 ;
22182
22183 final OnnxType.TypeVariable typeVariable;
22184
22185 TypeConstraint(OnnxType.TypeVariable typeVariable) {
22186 assert typeVariable.name().equals(name());
22187 this.typeVariable = typeVariable;
22188 }
22189
22190 @Override
22191 public OnnxType.TypeVariable typeVariable() {
22192 return typeVariable;
22193 }
22194 }
22195
22196 public enum InputParameter implements OnnxParameter {
22197 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22198 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
22199 ;
22200
22201 final OnnxType type;
22202 final Quantifier quantifier;
22203
22204 InputParameter(OnnxType type, Quantifier quantifier) {
22205 this.type = type;
22206 this.quantifier = quantifier;
22207 }
22208
22209 @Override
22210 public OnnxType type() {
22211 return type;
22212 }
22213
22214 @Override
22215 public Quantifier quantifier() {
22216 return quantifier;
22217 }
22218 }
22219
22220 public enum OutputParameter implements OnnxParameter {
22221 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22222 ;
22223
22224 final OnnxType type;
22225 final Quantifier quantifier;
22226
22227 OutputParameter(OnnxType type, Quantifier quantifier) {
22228 this.type = type;
22229 this.quantifier = quantifier;
22230 }
22231
22232 @Override
22233 public OnnxType type() {
22234 return type;
22235 }
22236
22237 @Override
22238 public Quantifier quantifier() {
22239 return quantifier;
22240 }
22241 }
22242
22243 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
22244 NAME,
22245 List.of(Attribute.values()),
22246 List.of(TypeConstraint.values()),
22247 List.of(InputParameter.values()),
22248 List.of(OutputParameter.values())
22249 );
22250
22251 public ReduceProd(ExternalizedOp def) {
22252 super(SCHEMA, def);
22253 }
22254
22255 ReduceProd(ReduceProd that, CodeContext cc) {
22256 super(that, cc);
22257 }
22258
22259 @Override
22260 public ReduceProd transform(CodeContext cc, CodeTransformer ot) {
22261 return new ReduceProd(this, cc);
22262 }
22263
22264 ReduceProd(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
22265 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
22266 }
22267
22268 @Override
22269 public SequencedSet<OnnxParameter> onnxOutputs() {
22270 return onnxOutputs(SCHEMA);
22271 }
22272
22273 @Override
22274 public SequencedMap<OnnxParameter, Object> onnxInputs() {
22275 return onnxInputs(SCHEMA, List.of(data(), axes()));
22276 }
22277
22278 public Value data() {
22279 return operands().get(0);
22280 }
22281
22282 public java.util.Optional<Value> axes() {
22283 int i = optionalInputArguments.indexOf(InputParameter.axes);
22284 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
22285 }
22286
22287 public java.util.Optional<Long> noop_with_empty_axes() {
22288 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
22289 return java.util.Optional.ofNullable(noop_with_empty_axes);
22290 }
22291
22292 public java.util.Optional<Long> keepdims() {
22293 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
22294 return java.util.Optional.ofNullable(keepdims);
22295 }
22296
22297 }
22298
22299 public static ReduceProd ReduceProd(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
22300 return new ReduceProd(resultType, data, axes, noop_with_empty_axes, keepdims);
22301 }
22302
22303 @OpFactoryHelper.OpDeclaration(ReduceSum.NAME)
22304 public static final class ReduceSum extends OnnxOp {
22305 public static final String NAME = "ReduceSum";
22306
22307 public enum Attribute implements OnnxAttribute {
22308 noop_with_empty_axes(Long.class, true, 0),
22309 keepdims(Long.class, true, 1),
22310 ;
22311
22312 final Class<?> t;
22313 final boolean optional;
22314 final Object defaultValue;
22315
22316 Attribute(Class<?> type, boolean optional, Object defaultValue) {
22317 this.t = type;
22318 this.optional = optional;
22319 this.defaultValue = defaultValue;
22320 assert optional || defaultValue == null;
22321 }
22322
22323 public Class<?> type() {
22324 return t;
22325 }
22326
22327 public boolean isOptional() {
22328 return optional;
22329 }
22330
22331 public Object defaultValue() {
22332 return defaultValue;
22333 }
22334 }
22335
22336 public enum TypeConstraint implements OnnxTypeConstraint {
22337 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
22338 ;
22339
22340 final OnnxType.TypeVariable typeVariable;
22341
22342 TypeConstraint(OnnxType.TypeVariable typeVariable) {
22343 assert typeVariable.name().equals(name());
22344 this.typeVariable = typeVariable;
22345 }
22346
22347 @Override
22348 public OnnxType.TypeVariable typeVariable() {
22349 return typeVariable;
22350 }
22351 }
22352
22353 public enum InputParameter implements OnnxParameter {
22354 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22355 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
22356 ;
22357
22358 final OnnxType type;
22359 final Quantifier quantifier;
22360
22361 InputParameter(OnnxType type, Quantifier quantifier) {
22362 this.type = type;
22363 this.quantifier = quantifier;
22364 }
22365
22366 @Override
22367 public OnnxType type() {
22368 return type;
22369 }
22370
22371 @Override
22372 public Quantifier quantifier() {
22373 return quantifier;
22374 }
22375 }
22376
22377 public enum OutputParameter implements OnnxParameter {
22378 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22379 ;
22380
22381 final OnnxType type;
22382 final Quantifier quantifier;
22383
22384 OutputParameter(OnnxType type, Quantifier quantifier) {
22385 this.type = type;
22386 this.quantifier = quantifier;
22387 }
22388
22389 @Override
22390 public OnnxType type() {
22391 return type;
22392 }
22393
22394 @Override
22395 public Quantifier quantifier() {
22396 return quantifier;
22397 }
22398 }
22399
22400 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
22401 NAME,
22402 List.of(Attribute.values()),
22403 List.of(TypeConstraint.values()),
22404 List.of(InputParameter.values()),
22405 List.of(OutputParameter.values())
22406 );
22407
22408 public ReduceSum(ExternalizedOp def) {
22409 super(SCHEMA, def);
22410 }
22411
22412 ReduceSum(ReduceSum that, CodeContext cc) {
22413 super(that, cc);
22414 }
22415
22416 @Override
22417 public ReduceSum transform(CodeContext cc, CodeTransformer ot) {
22418 return new ReduceSum(this, cc);
22419 }
22420
22421 ReduceSum(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
22422 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
22423 }
22424
22425 @Override
22426 public SequencedSet<OnnxParameter> onnxOutputs() {
22427 return onnxOutputs(SCHEMA);
22428 }
22429
22430 @Override
22431 public SequencedMap<OnnxParameter, Object> onnxInputs() {
22432 return onnxInputs(SCHEMA, List.of(data(), axes()));
22433 }
22434
22435 public Value data() {
22436 return operands().get(0);
22437 }
22438
22439 public java.util.Optional<Value> axes() {
22440 int i = optionalInputArguments.indexOf(InputParameter.axes);
22441 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
22442 }
22443
22444 public java.util.Optional<Long> noop_with_empty_axes() {
22445 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
22446 return java.util.Optional.ofNullable(noop_with_empty_axes);
22447 }
22448
22449 public java.util.Optional<Long> keepdims() {
22450 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
22451 return java.util.Optional.ofNullable(keepdims);
22452 }
22453
22454 }
22455
22456 public static ReduceSum ReduceSum(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
22457 return new ReduceSum(resultType, data, axes, noop_with_empty_axes, keepdims);
22458 }
22459
22460 @OpFactoryHelper.OpDeclaration(ReduceSumSquare.NAME)
22461 public static final class ReduceSumSquare extends OnnxOp {
22462 public static final String NAME = "ReduceSumSquare";
22463
22464 public enum Attribute implements OnnxAttribute {
22465 noop_with_empty_axes(Long.class, true, 0),
22466 keepdims(Long.class, true, 1),
22467 ;
22468
22469 final Class<?> t;
22470 final boolean optional;
22471 final Object defaultValue;
22472
22473 Attribute(Class<?> type, boolean optional, Object defaultValue) {
22474 this.t = type;
22475 this.optional = optional;
22476 this.defaultValue = defaultValue;
22477 assert optional || defaultValue == null;
22478 }
22479
22480 public Class<?> type() {
22481 return t;
22482 }
22483
22484 public boolean isOptional() {
22485 return optional;
22486 }
22487
22488 public Object defaultValue() {
22489 return defaultValue;
22490 }
22491 }
22492
22493 public enum TypeConstraint implements OnnxTypeConstraint {
22494 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
22495 ;
22496
22497 final OnnxType.TypeVariable typeVariable;
22498
22499 TypeConstraint(OnnxType.TypeVariable typeVariable) {
22500 assert typeVariable.name().equals(name());
22501 this.typeVariable = typeVariable;
22502 }
22503
22504 @Override
22505 public OnnxType.TypeVariable typeVariable() {
22506 return typeVariable;
22507 }
22508 }
22509
22510 public enum InputParameter implements OnnxParameter {
22511 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22512 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
22513 ;
22514
22515 final OnnxType type;
22516 final Quantifier quantifier;
22517
22518 InputParameter(OnnxType type, Quantifier quantifier) {
22519 this.type = type;
22520 this.quantifier = quantifier;
22521 }
22522
22523 @Override
22524 public OnnxType type() {
22525 return type;
22526 }
22527
22528 @Override
22529 public Quantifier quantifier() {
22530 return quantifier;
22531 }
22532 }
22533
22534 public enum OutputParameter implements OnnxParameter {
22535 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22536 ;
22537
22538 final OnnxType type;
22539 final Quantifier quantifier;
22540
22541 OutputParameter(OnnxType type, Quantifier quantifier) {
22542 this.type = type;
22543 this.quantifier = quantifier;
22544 }
22545
22546 @Override
22547 public OnnxType type() {
22548 return type;
22549 }
22550
22551 @Override
22552 public Quantifier quantifier() {
22553 return quantifier;
22554 }
22555 }
22556
22557 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
22558 NAME,
22559 List.of(Attribute.values()),
22560 List.of(TypeConstraint.values()),
22561 List.of(InputParameter.values()),
22562 List.of(OutputParameter.values())
22563 );
22564
22565 public ReduceSumSquare(ExternalizedOp def) {
22566 super(SCHEMA, def);
22567 }
22568
22569 ReduceSumSquare(ReduceSumSquare that, CodeContext cc) {
22570 super(that, cc);
22571 }
22572
22573 @Override
22574 public ReduceSumSquare transform(CodeContext cc, CodeTransformer ot) {
22575 return new ReduceSumSquare(this, cc);
22576 }
22577
22578 ReduceSumSquare(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
22579 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims));
22580 }
22581
22582 @Override
22583 public SequencedSet<OnnxParameter> onnxOutputs() {
22584 return onnxOutputs(SCHEMA);
22585 }
22586
22587 @Override
22588 public SequencedMap<OnnxParameter, Object> onnxInputs() {
22589 return onnxInputs(SCHEMA, List.of(data(), axes()));
22590 }
22591
22592 public Value data() {
22593 return operands().get(0);
22594 }
22595
22596 public java.util.Optional<Value> axes() {
22597 int i = optionalInputArguments.indexOf(InputParameter.axes);
22598 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
22599 }
22600
22601 public java.util.Optional<Long> noop_with_empty_axes() {
22602 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes);
22603 return java.util.Optional.ofNullable(noop_with_empty_axes);
22604 }
22605
22606 public java.util.Optional<Long> keepdims() {
22607 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
22608 return java.util.Optional.ofNullable(keepdims);
22609 }
22610
22611 }
22612
22613 public static ReduceSumSquare ReduceSumSquare(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) {
22614 return new ReduceSumSquare(resultType, data, axes, noop_with_empty_axes, keepdims);
22615 }
22616
22617 @OpFactoryHelper.OpDeclaration(RegexFullMatch.NAME)
22618 public static final class RegexFullMatch extends OnnxOp {
22619 public static final String NAME = "RegexFullMatch";
22620
22621 public enum Attribute implements OnnxAttribute {
22622 pattern(String.class, true, null),
22623 ;
22624
22625 final Class<?> t;
22626 final boolean optional;
22627 final Object defaultValue;
22628
22629 Attribute(Class<?> type, boolean optional, Object defaultValue) {
22630 this.t = type;
22631 this.optional = optional;
22632 this.defaultValue = defaultValue;
22633 assert optional || defaultValue == null;
22634 }
22635
22636 public Class<?> type() {
22637 return t;
22638 }
22639
22640 public boolean isOptional() {
22641 return optional;
22642 }
22643
22644 public Object defaultValue() {
22645 return defaultValue;
22646 }
22647 }
22648
22649 public enum TypeConstraint implements OnnxTypeConstraint {
22650 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.string())))),
22651 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bool())))),
22652 ;
22653
22654 final OnnxType.TypeVariable typeVariable;
22655
22656 TypeConstraint(OnnxType.TypeVariable typeVariable) {
22657 assert typeVariable.name().equals(name());
22658 this.typeVariable = typeVariable;
22659 }
22660
22661 @Override
22662 public OnnxType.TypeVariable typeVariable() {
22663 return typeVariable;
22664 }
22665 }
22666
22667 public enum InputParameter implements OnnxParameter {
22668 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
22669 ;
22670
22671 final OnnxType type;
22672 final Quantifier quantifier;
22673
22674 InputParameter(OnnxType type, Quantifier quantifier) {
22675 this.type = type;
22676 this.quantifier = quantifier;
22677 }
22678
22679 @Override
22680 public OnnxType type() {
22681 return type;
22682 }
22683
22684 @Override
22685 public Quantifier quantifier() {
22686 return quantifier;
22687 }
22688 }
22689
22690 public enum OutputParameter implements OnnxParameter {
22691 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
22692 ;
22693
22694 final OnnxType type;
22695 final Quantifier quantifier;
22696
22697 OutputParameter(OnnxType type, Quantifier quantifier) {
22698 this.type = type;
22699 this.quantifier = quantifier;
22700 }
22701
22702 @Override
22703 public OnnxType type() {
22704 return type;
22705 }
22706
22707 @Override
22708 public Quantifier quantifier() {
22709 return quantifier;
22710 }
22711 }
22712
22713 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
22714 NAME,
22715 List.of(Attribute.values()),
22716 List.of(TypeConstraint.values()),
22717 List.of(InputParameter.values()),
22718 List.of(OutputParameter.values())
22719 );
22720
22721 public RegexFullMatch(ExternalizedOp def) {
22722 super(SCHEMA, def);
22723 }
22724
22725 RegexFullMatch(RegexFullMatch that, CodeContext cc) {
22726 super(that, cc);
22727 }
22728
22729 @Override
22730 public RegexFullMatch transform(CodeContext cc, CodeTransformer ot) {
22731 return new RegexFullMatch(this, cc);
22732 }
22733
22734 RegexFullMatch(TypeElement resultType, Value X, java.util.Optional<String> pattern) {
22735 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(pattern));
22736 }
22737
22738 @Override
22739 public SequencedSet<OnnxParameter> onnxOutputs() {
22740 return onnxOutputs(SCHEMA);
22741 }
22742
22743 @Override
22744 public SequencedMap<OnnxParameter, Object> onnxInputs() {
22745 return onnxInputs(SCHEMA, List.of(X()));
22746 }
22747
22748 public Value X() {
22749 return operands().get(0);
22750 }
22751
22752 public java.util.Optional<String> pattern() {
22753 String pattern = Attribute.pattern.access(String.class, onnxAttributes);
22754 return java.util.Optional.ofNullable(pattern);
22755 }
22756
22757 }
22758
22759 public static RegexFullMatch RegexFullMatch(TypeElement resultType, Value X, java.util.Optional<String> pattern) {
22760 return new RegexFullMatch(resultType, X, pattern);
22761 }
22762
22763 @OpFactoryHelper.OpDeclaration(Relu.NAME)
22764 public static final class Relu extends OnnxOp {
22765 public static final String NAME = "Relu";
22766
22767 public enum Attribute implements OnnxAttribute.None { }
22768
22769 public enum TypeConstraint implements OnnxTypeConstraint {
22770 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
22771 ;
22772
22773 final OnnxType.TypeVariable typeVariable;
22774
22775 TypeConstraint(OnnxType.TypeVariable typeVariable) {
22776 assert typeVariable.name().equals(name());
22777 this.typeVariable = typeVariable;
22778 }
22779
22780 @Override
22781 public OnnxType.TypeVariable typeVariable() {
22782 return typeVariable;
22783 }
22784 }
22785
22786 public enum InputParameter implements OnnxParameter {
22787 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22788 ;
22789
22790 final OnnxType type;
22791 final Quantifier quantifier;
22792
22793 InputParameter(OnnxType type, Quantifier quantifier) {
22794 this.type = type;
22795 this.quantifier = quantifier;
22796 }
22797
22798 @Override
22799 public OnnxType type() {
22800 return type;
22801 }
22802
22803 @Override
22804 public Quantifier quantifier() {
22805 return quantifier;
22806 }
22807 }
22808
22809 public enum OutputParameter implements OnnxParameter {
22810 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22811 ;
22812
22813 final OnnxType type;
22814 final Quantifier quantifier;
22815
22816 OutputParameter(OnnxType type, Quantifier quantifier) {
22817 this.type = type;
22818 this.quantifier = quantifier;
22819 }
22820
22821 @Override
22822 public OnnxType type() {
22823 return type;
22824 }
22825
22826 @Override
22827 public Quantifier quantifier() {
22828 return quantifier;
22829 }
22830 }
22831
22832 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
22833 NAME,
22834 List.of(Attribute.values()),
22835 List.of(TypeConstraint.values()),
22836 List.of(InputParameter.values()),
22837 List.of(OutputParameter.values())
22838 );
22839
22840 public Relu(ExternalizedOp def) {
22841 super(SCHEMA, def);
22842 }
22843
22844 Relu(Relu that, CodeContext cc) {
22845 super(that, cc);
22846 }
22847
22848 @Override
22849 public Relu transform(CodeContext cc, CodeTransformer ot) {
22850 return new Relu(this, cc);
22851 }
22852
22853 Relu(TypeElement resultType, Value X) {
22854 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
22855 }
22856
22857 @Override
22858 public SequencedSet<OnnxParameter> onnxOutputs() {
22859 return onnxOutputs(SCHEMA);
22860 }
22861
22862 @Override
22863 public SequencedMap<OnnxParameter, Object> onnxInputs() {
22864 return onnxInputs(SCHEMA, List.of(X()));
22865 }
22866
22867 public Value X() {
22868 return operands().get(0);
22869 }
22870
22871 }
22872
22873 public static Relu Relu(TypeElement resultType, Value X) {
22874 return new Relu(resultType, X);
22875 }
22876
22877 @OpFactoryHelper.OpDeclaration(Reshape.NAME)
22878 public static final class Reshape extends OnnxOp {
22879 public static final String NAME = "Reshape";
22880
22881 public enum Attribute implements OnnxAttribute {
22882 allowzero(Long.class, true, 0),
22883 ;
22884
22885 final Class<?> t;
22886 final boolean optional;
22887 final Object defaultValue;
22888
22889 Attribute(Class<?> type, boolean optional, Object defaultValue) {
22890 this.t = type;
22891 this.optional = optional;
22892 this.defaultValue = defaultValue;
22893 assert optional || defaultValue == null;
22894 }
22895
22896 public Class<?> type() {
22897 return t;
22898 }
22899
22900 public boolean isOptional() {
22901 return optional;
22902 }
22903
22904 public Object defaultValue() {
22905 return defaultValue;
22906 }
22907 }
22908
22909 public enum TypeConstraint implements OnnxTypeConstraint {
22910 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
22911 ;
22912
22913 final OnnxType.TypeVariable typeVariable;
22914
22915 TypeConstraint(OnnxType.TypeVariable typeVariable) {
22916 assert typeVariable.name().equals(name());
22917 this.typeVariable = typeVariable;
22918 }
22919
22920 @Override
22921 public OnnxType.TypeVariable typeVariable() {
22922 return typeVariable;
22923 }
22924 }
22925
22926 public enum InputParameter implements OnnxParameter {
22927 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22928 shape(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
22929 ;
22930
22931 final OnnxType type;
22932 final Quantifier quantifier;
22933
22934 InputParameter(OnnxType type, Quantifier quantifier) {
22935 this.type = type;
22936 this.quantifier = quantifier;
22937 }
22938
22939 @Override
22940 public OnnxType type() {
22941 return type;
22942 }
22943
22944 @Override
22945 public Quantifier quantifier() {
22946 return quantifier;
22947 }
22948 }
22949
22950 public enum OutputParameter implements OnnxParameter {
22951 reshaped(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
22952 ;
22953
22954 final OnnxType type;
22955 final Quantifier quantifier;
22956
22957 OutputParameter(OnnxType type, Quantifier quantifier) {
22958 this.type = type;
22959 this.quantifier = quantifier;
22960 }
22961
22962 @Override
22963 public OnnxType type() {
22964 return type;
22965 }
22966
22967 @Override
22968 public Quantifier quantifier() {
22969 return quantifier;
22970 }
22971 }
22972
22973 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
22974 NAME,
22975 List.of(Attribute.values()),
22976 List.of(TypeConstraint.values()),
22977 List.of(InputParameter.values()),
22978 List.of(OutputParameter.values())
22979 );
22980
22981 public Reshape(ExternalizedOp def) {
22982 super(SCHEMA, def);
22983 }
22984
22985 Reshape(Reshape that, CodeContext cc) {
22986 super(that, cc);
22987 }
22988
22989 @Override
22990 public Reshape transform(CodeContext cc, CodeTransformer ot) {
22991 return new Reshape(this, cc);
22992 }
22993
22994 Reshape(TypeElement resultType, Value data, Value shape, java.util.Optional<Long> allowzero) {
22995 super(SCHEMA, resultType, Set.of(), List.of(data, shape), List.of(allowzero));
22996 }
22997
22998 @Override
22999 public SequencedSet<OnnxParameter> onnxOutputs() {
23000 return onnxOutputs(SCHEMA);
23001 }
23002
23003 @Override
23004 public SequencedMap<OnnxParameter, Object> onnxInputs() {
23005 return onnxInputs(SCHEMA, List.of(data(), shape()));
23006 }
23007
23008 public Value data() {
23009 return operands().get(0);
23010 }
23011
23012 public Value shape() {
23013 return operands().get(1);
23014 }
23015
23016 public java.util.Optional<Long> allowzero() {
23017 Long allowzero = Attribute.allowzero.access(Long.class, onnxAttributes);
23018 return java.util.Optional.ofNullable(allowzero);
23019 }
23020
23021 }
23022
23023 public static Reshape Reshape(TypeElement resultType, Value data, Value shape, java.util.Optional<Long> allowzero) {
23024 return new Reshape(resultType, data, shape, allowzero);
23025 }
23026
23027 @OpFactoryHelper.OpDeclaration(Resize.NAME)
23028 public static final class Resize extends OnnxOp {
23029 public static final String NAME = "Resize";
23030
23031 public enum Attribute implements OnnxAttribute {
23032 mode(String.class, true, "nearest"),
23033 extrapolation_value(Float.class, true, 0.0f),
23034 nearest_mode(String.class, true, "round_prefer_floor"),
23035 antialias(Long.class, true, 0),
23036 cubic_coeff_a(Float.class, true, -0.75f),
23037 axes(long[].class, true, null),
23038 coordinate_transformation_mode(String.class, true, "half_pixel"),
23039 keep_aspect_ratio_policy(String.class, true, "stretch"),
23040 exclude_outside(Long.class, true, 0),
23041 ;
23042
23043 final Class<?> t;
23044 final boolean optional;
23045 final Object defaultValue;
23046
23047 Attribute(Class<?> type, boolean optional, Object defaultValue) {
23048 this.t = type;
23049 this.optional = optional;
23050 this.defaultValue = defaultValue;
23051 assert optional || defaultValue == null;
23052 }
23053
23054 public Class<?> type() {
23055 return t;
23056 }
23057
23058 public boolean isOptional() {
23059 return optional;
23060 }
23061
23062 public Object defaultValue() {
23063 return defaultValue;
23064 }
23065 }
23066
23067 public enum TypeConstraint implements OnnxTypeConstraint {
23068 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
23069 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
23070 ;
23071
23072 final OnnxType.TypeVariable typeVariable;
23073
23074 TypeConstraint(OnnxType.TypeVariable typeVariable) {
23075 assert typeVariable.name().equals(name());
23076 this.typeVariable = typeVariable;
23077 }
23078
23079 @Override
23080 public OnnxType.TypeVariable typeVariable() {
23081 return typeVariable;
23082 }
23083 }
23084
23085 public enum InputParameter implements OnnxParameter {
23086 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
23087 roi(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
23088 scales(OnnxType.tensor(OnnxType.float32()), Quantifier.OPTIONAL),
23089 sizes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
23090 ;
23091
23092 final OnnxType type;
23093 final Quantifier quantifier;
23094
23095 InputParameter(OnnxType type, Quantifier quantifier) {
23096 this.type = type;
23097 this.quantifier = quantifier;
23098 }
23099
23100 @Override
23101 public OnnxType type() {
23102 return type;
23103 }
23104
23105 @Override
23106 public Quantifier quantifier() {
23107 return quantifier;
23108 }
23109 }
23110
23111 public enum OutputParameter implements OnnxParameter {
23112 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
23113 ;
23114
23115 final OnnxType type;
23116 final Quantifier quantifier;
23117
23118 OutputParameter(OnnxType type, Quantifier quantifier) {
23119 this.type = type;
23120 this.quantifier = quantifier;
23121 }
23122
23123 @Override
23124 public OnnxType type() {
23125 return type;
23126 }
23127
23128 @Override
23129 public Quantifier quantifier() {
23130 return quantifier;
23131 }
23132 }
23133
23134 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
23135 NAME,
23136 List.of(Attribute.values()),
23137 List.of(TypeConstraint.values()),
23138 List.of(InputParameter.values()),
23139 List.of(OutputParameter.values())
23140 );
23141
23142 public Resize(ExternalizedOp def) {
23143 super(SCHEMA, def);
23144 }
23145
23146 Resize(Resize that, CodeContext cc) {
23147 super(that, cc);
23148 }
23149
23150 @Override
23151 public Resize transform(CodeContext cc, CodeTransformer ot) {
23152 return new Resize(this, cc);
23153 }
23154
23155 Resize(TypeElement resultType, Value X, java.util.Optional<Value> roi, java.util.Optional<Value> scales, java.util.Optional<Value> sizes, java.util.Optional<String> mode, java.util.Optional<Float> extrapolation_value, java.util.Optional<String> nearest_mode, java.util.Optional<Long> antialias, java.util.Optional<Float> cubic_coeff_a, java.util.Optional<long[]> axes, java.util.Optional<String> coordinate_transformation_mode, java.util.Optional<String> keep_aspect_ratio_policy, java.util.Optional<Long> exclude_outside) {
23156 super(SCHEMA, resultType, Set.of(), List.of(X, roi, scales, sizes), List.of(mode, extrapolation_value, nearest_mode, antialias, cubic_coeff_a, axes, coordinate_transformation_mode, keep_aspect_ratio_policy, exclude_outside));
23157 }
23158
23159 @Override
23160 public SequencedSet<OnnxParameter> onnxOutputs() {
23161 return onnxOutputs(SCHEMA);
23162 }
23163
23164 @Override
23165 public SequencedMap<OnnxParameter, Object> onnxInputs() {
23166 return onnxInputs(SCHEMA, List.of(X(), roi(), scales(), sizes()));
23167 }
23168
23169 public Value X() {
23170 return operands().get(0);
23171 }
23172
23173 public java.util.Optional<Value> roi() {
23174 int i = optionalInputArguments.indexOf(InputParameter.roi);
23175 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
23176 }
23177
23178 public java.util.Optional<Value> scales() {
23179 int i = optionalInputArguments.indexOf(InputParameter.scales);
23180 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
23181 }
23182
23183 public java.util.Optional<Value> sizes() {
23184 int i = optionalInputArguments.indexOf(InputParameter.sizes);
23185 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
23186 }
23187
23188 public java.util.Optional<String> mode() {
23189 String mode = Attribute.mode.access(String.class, onnxAttributes);
23190 return java.util.Optional.ofNullable(mode);
23191 }
23192
23193 public java.util.Optional<Float> extrapolation_value() {
23194 Float extrapolation_value = Attribute.extrapolation_value.access(Float.class, onnxAttributes);
23195 return java.util.Optional.ofNullable(extrapolation_value);
23196 }
23197
23198 public java.util.Optional<String> nearest_mode() {
23199 String nearest_mode = Attribute.nearest_mode.access(String.class, onnxAttributes);
23200 return java.util.Optional.ofNullable(nearest_mode);
23201 }
23202
23203 public java.util.Optional<Long> antialias() {
23204 Long antialias = Attribute.antialias.access(Long.class, onnxAttributes);
23205 return java.util.Optional.ofNullable(antialias);
23206 }
23207
23208 public java.util.Optional<Float> cubic_coeff_a() {
23209 Float cubic_coeff_a = Attribute.cubic_coeff_a.access(Float.class, onnxAttributes);
23210 return java.util.Optional.ofNullable(cubic_coeff_a);
23211 }
23212
23213 public java.util.Optional<long[]> axes() {
23214 long[] axes = Attribute.axes.access(long[].class, onnxAttributes);
23215 return java.util.Optional.ofNullable(axes).map(long[]::clone);
23216 }
23217
23218 public java.util.Optional<String> coordinate_transformation_mode() {
23219 String coordinate_transformation_mode = Attribute.coordinate_transformation_mode.access(String.class, onnxAttributes);
23220 return java.util.Optional.ofNullable(coordinate_transformation_mode);
23221 }
23222
23223 public java.util.Optional<String> keep_aspect_ratio_policy() {
23224 String keep_aspect_ratio_policy = Attribute.keep_aspect_ratio_policy.access(String.class, onnxAttributes);
23225 return java.util.Optional.ofNullable(keep_aspect_ratio_policy);
23226 }
23227
23228 public java.util.Optional<Long> exclude_outside() {
23229 Long exclude_outside = Attribute.exclude_outside.access(Long.class, onnxAttributes);
23230 return java.util.Optional.ofNullable(exclude_outside);
23231 }
23232
23233 }
23234
23235 public static Resize Resize(TypeElement resultType, Value X, java.util.Optional<Value> roi, java.util.Optional<Value> scales, java.util.Optional<Value> sizes, java.util.Optional<String> mode, java.util.Optional<Float> extrapolation_value, java.util.Optional<String> nearest_mode, java.util.Optional<Long> antialias, java.util.Optional<Float> cubic_coeff_a, java.util.Optional<long[]> axes, java.util.Optional<String> coordinate_transformation_mode, java.util.Optional<String> keep_aspect_ratio_policy, java.util.Optional<Long> exclude_outside) {
23236 return new Resize(resultType, X, roi, scales, sizes, mode, extrapolation_value, nearest_mode, antialias, cubic_coeff_a, axes, coordinate_transformation_mode, keep_aspect_ratio_policy, exclude_outside);
23237 }
23238
23239 @OpFactoryHelper.OpDeclaration(ReverseSequence.NAME)
23240 public static final class ReverseSequence extends OnnxOp {
23241 public static final String NAME = "ReverseSequence";
23242
23243 public enum Attribute implements OnnxAttribute {
23244 time_axis(Long.class, true, 0),
23245 batch_axis(Long.class, true, 1),
23246 ;
23247
23248 final Class<?> t;
23249 final boolean optional;
23250 final Object defaultValue;
23251
23252 Attribute(Class<?> type, boolean optional, Object defaultValue) {
23253 this.t = type;
23254 this.optional = optional;
23255 this.defaultValue = defaultValue;
23256 assert optional || defaultValue == null;
23257 }
23258
23259 public Class<?> type() {
23260 return t;
23261 }
23262
23263 public boolean isOptional() {
23264 return optional;
23265 }
23266
23267 public Object defaultValue() {
23268 return defaultValue;
23269 }
23270 }
23271
23272 public enum TypeConstraint implements OnnxTypeConstraint {
23273 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
23274 ;
23275
23276 final OnnxType.TypeVariable typeVariable;
23277
23278 TypeConstraint(OnnxType.TypeVariable typeVariable) {
23279 assert typeVariable.name().equals(name());
23280 this.typeVariable = typeVariable;
23281 }
23282
23283 @Override
23284 public OnnxType.TypeVariable typeVariable() {
23285 return typeVariable;
23286 }
23287 }
23288
23289 public enum InputParameter implements OnnxParameter {
23290 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
23291 sequence_lens(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
23292 ;
23293
23294 final OnnxType type;
23295 final Quantifier quantifier;
23296
23297 InputParameter(OnnxType type, Quantifier quantifier) {
23298 this.type = type;
23299 this.quantifier = quantifier;
23300 }
23301
23302 @Override
23303 public OnnxType type() {
23304 return type;
23305 }
23306
23307 @Override
23308 public Quantifier quantifier() {
23309 return quantifier;
23310 }
23311 }
23312
23313 public enum OutputParameter implements OnnxParameter {
23314 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
23315 ;
23316
23317 final OnnxType type;
23318 final Quantifier quantifier;
23319
23320 OutputParameter(OnnxType type, Quantifier quantifier) {
23321 this.type = type;
23322 this.quantifier = quantifier;
23323 }
23324
23325 @Override
23326 public OnnxType type() {
23327 return type;
23328 }
23329
23330 @Override
23331 public Quantifier quantifier() {
23332 return quantifier;
23333 }
23334 }
23335
23336 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
23337 NAME,
23338 List.of(Attribute.values()),
23339 List.of(TypeConstraint.values()),
23340 List.of(InputParameter.values()),
23341 List.of(OutputParameter.values())
23342 );
23343
23344 public ReverseSequence(ExternalizedOp def) {
23345 super(SCHEMA, def);
23346 }
23347
23348 ReverseSequence(ReverseSequence that, CodeContext cc) {
23349 super(that, cc);
23350 }
23351
23352 @Override
23353 public ReverseSequence transform(CodeContext cc, CodeTransformer ot) {
23354 return new ReverseSequence(this, cc);
23355 }
23356
23357 ReverseSequence(TypeElement resultType, Value input, Value sequence_lens, java.util.Optional<Long> time_axis, java.util.Optional<Long> batch_axis) {
23358 super(SCHEMA, resultType, Set.of(), List.of(input, sequence_lens), List.of(time_axis, batch_axis));
23359 }
23360
23361 @Override
23362 public SequencedSet<OnnxParameter> onnxOutputs() {
23363 return onnxOutputs(SCHEMA);
23364 }
23365
23366 @Override
23367 public SequencedMap<OnnxParameter, Object> onnxInputs() {
23368 return onnxInputs(SCHEMA, List.of(input(), sequence_lens()));
23369 }
23370
23371 public Value input() {
23372 return operands().get(0);
23373 }
23374
23375 public Value sequence_lens() {
23376 return operands().get(1);
23377 }
23378
23379 public java.util.Optional<Long> time_axis() {
23380 Long time_axis = Attribute.time_axis.access(Long.class, onnxAttributes);
23381 return java.util.Optional.ofNullable(time_axis);
23382 }
23383
23384 public java.util.Optional<Long> batch_axis() {
23385 Long batch_axis = Attribute.batch_axis.access(Long.class, onnxAttributes);
23386 return java.util.Optional.ofNullable(batch_axis);
23387 }
23388
23389 }
23390
23391 public static ReverseSequence ReverseSequence(TypeElement resultType, Value input, Value sequence_lens, java.util.Optional<Long> time_axis, java.util.Optional<Long> batch_axis) {
23392 return new ReverseSequence(resultType, input, sequence_lens, time_axis, batch_axis);
23393 }
23394
23395 @OpFactoryHelper.OpDeclaration(RoiAlign.NAME)
23396 public static final class RoiAlign extends OnnxOp {
23397 public static final String NAME = "RoiAlign";
23398
23399 public enum Attribute implements OnnxAttribute {
23400 mode(String.class, true, "avg"),
23401 output_width(Long.class, true, 1),
23402 spatial_scale(Float.class, true, 1.0f),
23403 coordinate_transformation_mode(String.class, true, "half_pixel"),
23404 sampling_ratio(Long.class, true, 0),
23405 output_height(Long.class, true, 1),
23406 ;
23407
23408 final Class<?> t;
23409 final boolean optional;
23410 final Object defaultValue;
23411
23412 Attribute(Class<?> type, boolean optional, Object defaultValue) {
23413 this.t = type;
23414 this.optional = optional;
23415 this.defaultValue = defaultValue;
23416 assert optional || defaultValue == null;
23417 }
23418
23419 public Class<?> type() {
23420 return t;
23421 }
23422
23423 public boolean isOptional() {
23424 return optional;
23425 }
23426
23427 public Object defaultValue() {
23428 return defaultValue;
23429 }
23430 }
23431
23432 public enum TypeConstraint implements OnnxTypeConstraint {
23433 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
23434 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))),
23435 ;
23436
23437 final OnnxType.TypeVariable typeVariable;
23438
23439 TypeConstraint(OnnxType.TypeVariable typeVariable) {
23440 assert typeVariable.name().equals(name());
23441 this.typeVariable = typeVariable;
23442 }
23443
23444 @Override
23445 public OnnxType.TypeVariable typeVariable() {
23446 return typeVariable;
23447 }
23448 }
23449
23450 public enum InputParameter implements OnnxParameter {
23451 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
23452 rois(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
23453 batch_indices(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
23454 ;
23455
23456 final OnnxType type;
23457 final Quantifier quantifier;
23458
23459 InputParameter(OnnxType type, Quantifier quantifier) {
23460 this.type = type;
23461 this.quantifier = quantifier;
23462 }
23463
23464 @Override
23465 public OnnxType type() {
23466 return type;
23467 }
23468
23469 @Override
23470 public Quantifier quantifier() {
23471 return quantifier;
23472 }
23473 }
23474
23475 public enum OutputParameter implements OnnxParameter {
23476 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
23477 ;
23478
23479 final OnnxType type;
23480 final Quantifier quantifier;
23481
23482 OutputParameter(OnnxType type, Quantifier quantifier) {
23483 this.type = type;
23484 this.quantifier = quantifier;
23485 }
23486
23487 @Override
23488 public OnnxType type() {
23489 return type;
23490 }
23491
23492 @Override
23493 public Quantifier quantifier() {
23494 return quantifier;
23495 }
23496 }
23497
23498 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
23499 NAME,
23500 List.of(Attribute.values()),
23501 List.of(TypeConstraint.values()),
23502 List.of(InputParameter.values()),
23503 List.of(OutputParameter.values())
23504 );
23505
23506 public RoiAlign(ExternalizedOp def) {
23507 super(SCHEMA, def);
23508 }
23509
23510 RoiAlign(RoiAlign that, CodeContext cc) {
23511 super(that, cc);
23512 }
23513
23514 @Override
23515 public RoiAlign transform(CodeContext cc, CodeTransformer ot) {
23516 return new RoiAlign(this, cc);
23517 }
23518
23519 RoiAlign(TypeElement resultType, Value X, Value rois, Value batch_indices, java.util.Optional<String> mode, java.util.Optional<Long> output_width, java.util.Optional<Float> spatial_scale, java.util.Optional<String> coordinate_transformation_mode, java.util.Optional<Long> sampling_ratio, java.util.Optional<Long> output_height) {
23520 super(SCHEMA, resultType, Set.of(), List.of(X, rois, batch_indices), List.of(mode, output_width, spatial_scale, coordinate_transformation_mode, sampling_ratio, output_height));
23521 }
23522
23523 @Override
23524 public SequencedSet<OnnxParameter> onnxOutputs() {
23525 return onnxOutputs(SCHEMA);
23526 }
23527
23528 @Override
23529 public SequencedMap<OnnxParameter, Object> onnxInputs() {
23530 return onnxInputs(SCHEMA, List.of(X(), rois(), batch_indices()));
23531 }
23532
23533 public Value X() {
23534 return operands().get(0);
23535 }
23536
23537 public Value rois() {
23538 return operands().get(1);
23539 }
23540
23541 public Value batch_indices() {
23542 return operands().get(2);
23543 }
23544
23545 public java.util.Optional<String> mode() {
23546 String mode = Attribute.mode.access(String.class, onnxAttributes);
23547 return java.util.Optional.ofNullable(mode);
23548 }
23549
23550 public java.util.Optional<Long> output_width() {
23551 Long output_width = Attribute.output_width.access(Long.class, onnxAttributes);
23552 return java.util.Optional.ofNullable(output_width);
23553 }
23554
23555 public java.util.Optional<Float> spatial_scale() {
23556 Float spatial_scale = Attribute.spatial_scale.access(Float.class, onnxAttributes);
23557 return java.util.Optional.ofNullable(spatial_scale);
23558 }
23559
23560 public java.util.Optional<String> coordinate_transformation_mode() {
23561 String coordinate_transformation_mode = Attribute.coordinate_transformation_mode.access(String.class, onnxAttributes);
23562 return java.util.Optional.ofNullable(coordinate_transformation_mode);
23563 }
23564
23565 public java.util.Optional<Long> sampling_ratio() {
23566 Long sampling_ratio = Attribute.sampling_ratio.access(Long.class, onnxAttributes);
23567 return java.util.Optional.ofNullable(sampling_ratio);
23568 }
23569
23570 public java.util.Optional<Long> output_height() {
23571 Long output_height = Attribute.output_height.access(Long.class, onnxAttributes);
23572 return java.util.Optional.ofNullable(output_height);
23573 }
23574
23575 }
23576
23577 public static RoiAlign RoiAlign(TypeElement resultType, Value X, Value rois, Value batch_indices, java.util.Optional<String> mode, java.util.Optional<Long> output_width, java.util.Optional<Float> spatial_scale, java.util.Optional<String> coordinate_transformation_mode, java.util.Optional<Long> sampling_ratio, java.util.Optional<Long> output_height) {
23578 return new RoiAlign(resultType, X, rois, batch_indices, mode, output_width, spatial_scale, coordinate_transformation_mode, sampling_ratio, output_height);
23579 }
23580
23581 @OpFactoryHelper.OpDeclaration(RotaryEmbedding.NAME)
23582 public static final class RotaryEmbedding extends OnnxOp {
23583 public static final String NAME = "RotaryEmbedding";
23584
23585 public enum Attribute implements OnnxAttribute {
23586 num_heads(Long.class, true, null),
23587 rotary_embedding_dim(Long.class, true, 0),
23588 interleaved(Long.class, true, 0),
23589 ;
23590
23591 final Class<?> t;
23592 final boolean optional;
23593 final Object defaultValue;
23594
23595 Attribute(Class<?> type, boolean optional, Object defaultValue) {
23596 this.t = type;
23597 this.optional = optional;
23598 this.defaultValue = defaultValue;
23599 assert optional || defaultValue == null;
23600 }
23601
23602 public Class<?> type() {
23603 return t;
23604 }
23605
23606 public boolean isOptional() {
23607 return optional;
23608 }
23609
23610 public Object defaultValue() {
23611 return defaultValue;
23612 }
23613 }
23614
23615 public enum TypeConstraint implements OnnxTypeConstraint {
23616 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16())))),
23617 M(new OnnxType.TypeVariable("M", List.of(OnnxType.tensor(OnnxType.int64())))),
23618 ;
23619
23620 final OnnxType.TypeVariable typeVariable;
23621
23622 TypeConstraint(OnnxType.TypeVariable typeVariable) {
23623 assert typeVariable.name().equals(name());
23624 this.typeVariable = typeVariable;
23625 }
23626
23627 @Override
23628 public OnnxType.TypeVariable typeVariable() {
23629 return typeVariable;
23630 }
23631 }
23632
23633 public enum InputParameter implements OnnxParameter {
23634 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
23635 cos_cache(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
23636 sin_cache(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
23637 position_ids(TypeConstraint.M.typeVariable(), Quantifier.OPTIONAL),
23638 ;
23639
23640 final OnnxType type;
23641 final Quantifier quantifier;
23642
23643 InputParameter(OnnxType type, Quantifier quantifier) {
23644 this.type = type;
23645 this.quantifier = quantifier;
23646 }
23647
23648 @Override
23649 public OnnxType type() {
23650 return type;
23651 }
23652
23653 @Override
23654 public Quantifier quantifier() {
23655 return quantifier;
23656 }
23657 }
23658
23659 public enum OutputParameter implements OnnxParameter {
23660 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
23661 ;
23662
23663 final OnnxType type;
23664 final Quantifier quantifier;
23665
23666 OutputParameter(OnnxType type, Quantifier quantifier) {
23667 this.type = type;
23668 this.quantifier = quantifier;
23669 }
23670
23671 @Override
23672 public OnnxType type() {
23673 return type;
23674 }
23675
23676 @Override
23677 public Quantifier quantifier() {
23678 return quantifier;
23679 }
23680 }
23681
23682 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
23683 NAME,
23684 List.of(Attribute.values()),
23685 List.of(TypeConstraint.values()),
23686 List.of(InputParameter.values()),
23687 List.of(OutputParameter.values())
23688 );
23689
23690 public RotaryEmbedding(ExternalizedOp def) {
23691 super(SCHEMA, def);
23692 }
23693
23694 RotaryEmbedding(RotaryEmbedding that, CodeContext cc) {
23695 super(that, cc);
23696 }
23697
23698 @Override
23699 public RotaryEmbedding transform(CodeContext cc, CodeTransformer ot) {
23700 return new RotaryEmbedding(this, cc);
23701 }
23702
23703 RotaryEmbedding(TypeElement resultType, Value X, Value cos_cache, Value sin_cache, java.util.Optional<Value> position_ids, java.util.Optional<Long> num_heads, java.util.Optional<Long> rotary_embedding_dim, java.util.Optional<Long> interleaved) {
23704 super(SCHEMA, resultType, Set.of(), List.of(X, cos_cache, sin_cache, position_ids), List.of(num_heads, rotary_embedding_dim, interleaved));
23705 }
23706
23707 @Override
23708 public SequencedSet<OnnxParameter> onnxOutputs() {
23709 return onnxOutputs(SCHEMA);
23710 }
23711
23712 @Override
23713 public SequencedMap<OnnxParameter, Object> onnxInputs() {
23714 return onnxInputs(SCHEMA, List.of(X(), cos_cache(), sin_cache(), position_ids()));
23715 }
23716
23717 public Value X() {
23718 return operands().get(0);
23719 }
23720
23721 public Value cos_cache() {
23722 return operands().get(1);
23723 }
23724
23725 public Value sin_cache() {
23726 return operands().get(2);
23727 }
23728
23729 public java.util.Optional<Value> position_ids() {
23730 int i = optionalInputArguments.indexOf(InputParameter.position_ids);
23731 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
23732 }
23733
23734 public java.util.Optional<Long> num_heads() {
23735 Long num_heads = Attribute.num_heads.access(Long.class, onnxAttributes);
23736 return java.util.Optional.ofNullable(num_heads);
23737 }
23738
23739 public java.util.Optional<Long> rotary_embedding_dim() {
23740 Long rotary_embedding_dim = Attribute.rotary_embedding_dim.access(Long.class, onnxAttributes);
23741 return java.util.Optional.ofNullable(rotary_embedding_dim);
23742 }
23743
23744 public java.util.Optional<Long> interleaved() {
23745 Long interleaved = Attribute.interleaved.access(Long.class, onnxAttributes);
23746 return java.util.Optional.ofNullable(interleaved);
23747 }
23748
23749 }
23750
23751 public static RotaryEmbedding RotaryEmbedding(TypeElement resultType, Value X, Value cos_cache, Value sin_cache, java.util.Optional<Value> position_ids, java.util.Optional<Long> num_heads, java.util.Optional<Long> rotary_embedding_dim, java.util.Optional<Long> interleaved) {
23752 return new RotaryEmbedding(resultType, X, cos_cache, sin_cache, position_ids, num_heads, rotary_embedding_dim, interleaved);
23753 }
23754
23755 @OpFactoryHelper.OpDeclaration(Round.NAME)
23756 public static final class Round extends OnnxOp {
23757 public static final String NAME = "Round";
23758
23759 public enum Attribute implements OnnxAttribute.None { }
23760
23761 public enum TypeConstraint implements OnnxTypeConstraint {
23762 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
23763 ;
23764
23765 final OnnxType.TypeVariable typeVariable;
23766
23767 TypeConstraint(OnnxType.TypeVariable typeVariable) {
23768 assert typeVariable.name().equals(name());
23769 this.typeVariable = typeVariable;
23770 }
23771
23772 @Override
23773 public OnnxType.TypeVariable typeVariable() {
23774 return typeVariable;
23775 }
23776 }
23777
23778 public enum InputParameter implements OnnxParameter {
23779 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
23780 ;
23781
23782 final OnnxType type;
23783 final Quantifier quantifier;
23784
23785 InputParameter(OnnxType type, Quantifier quantifier) {
23786 this.type = type;
23787 this.quantifier = quantifier;
23788 }
23789
23790 @Override
23791 public OnnxType type() {
23792 return type;
23793 }
23794
23795 @Override
23796 public Quantifier quantifier() {
23797 return quantifier;
23798 }
23799 }
23800
23801 public enum OutputParameter implements OnnxParameter {
23802 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
23803 ;
23804
23805 final OnnxType type;
23806 final Quantifier quantifier;
23807
23808 OutputParameter(OnnxType type, Quantifier quantifier) {
23809 this.type = type;
23810 this.quantifier = quantifier;
23811 }
23812
23813 @Override
23814 public OnnxType type() {
23815 return type;
23816 }
23817
23818 @Override
23819 public Quantifier quantifier() {
23820 return quantifier;
23821 }
23822 }
23823
23824 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
23825 NAME,
23826 List.of(Attribute.values()),
23827 List.of(TypeConstraint.values()),
23828 List.of(InputParameter.values()),
23829 List.of(OutputParameter.values())
23830 );
23831
23832 public Round(ExternalizedOp def) {
23833 super(SCHEMA, def);
23834 }
23835
23836 Round(Round that, CodeContext cc) {
23837 super(that, cc);
23838 }
23839
23840 @Override
23841 public Round transform(CodeContext cc, CodeTransformer ot) {
23842 return new Round(this, cc);
23843 }
23844
23845 Round(TypeElement resultType, Value X) {
23846 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
23847 }
23848
23849 @Override
23850 public SequencedSet<OnnxParameter> onnxOutputs() {
23851 return onnxOutputs(SCHEMA);
23852 }
23853
23854 @Override
23855 public SequencedMap<OnnxParameter, Object> onnxInputs() {
23856 return onnxInputs(SCHEMA, List.of(X()));
23857 }
23858
23859 public Value X() {
23860 return operands().get(0);
23861 }
23862
23863 }
23864
23865 public static Round Round(TypeElement resultType, Value X) {
23866 return new Round(resultType, X);
23867 }
23868
23869 @OpFactoryHelper.OpDeclaration(STFT.NAME)
23870 public static final class STFT extends OnnxOp {
23871 public static final String NAME = "STFT";
23872
23873 public enum Attribute implements OnnxAttribute {
23874 onesided(Long.class, true, 1),
23875 ;
23876
23877 final Class<?> t;
23878 final boolean optional;
23879 final Object defaultValue;
23880
23881 Attribute(Class<?> type, boolean optional, Object defaultValue) {
23882 this.t = type;
23883 this.optional = optional;
23884 this.defaultValue = defaultValue;
23885 assert optional || defaultValue == null;
23886 }
23887
23888 public Class<?> type() {
23889 return t;
23890 }
23891
23892 public boolean isOptional() {
23893 return optional;
23894 }
23895
23896 public Object defaultValue() {
23897 return defaultValue;
23898 }
23899 }
23900
23901 public enum TypeConstraint implements OnnxTypeConstraint {
23902 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
23903 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
23904 ;
23905
23906 final OnnxType.TypeVariable typeVariable;
23907
23908 TypeConstraint(OnnxType.TypeVariable typeVariable) {
23909 assert typeVariable.name().equals(name());
23910 this.typeVariable = typeVariable;
23911 }
23912
23913 @Override
23914 public OnnxType.TypeVariable typeVariable() {
23915 return typeVariable;
23916 }
23917 }
23918
23919 public enum InputParameter implements OnnxParameter {
23920 signal(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
23921 frame_step(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
23922 window(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL),
23923 frame_length(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL),
23924 ;
23925
23926 final OnnxType type;
23927 final Quantifier quantifier;
23928
23929 InputParameter(OnnxType type, Quantifier quantifier) {
23930 this.type = type;
23931 this.quantifier = quantifier;
23932 }
23933
23934 @Override
23935 public OnnxType type() {
23936 return type;
23937 }
23938
23939 @Override
23940 public Quantifier quantifier() {
23941 return quantifier;
23942 }
23943 }
23944
23945 public enum OutputParameter implements OnnxParameter {
23946 output(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
23947 ;
23948
23949 final OnnxType type;
23950 final Quantifier quantifier;
23951
23952 OutputParameter(OnnxType type, Quantifier quantifier) {
23953 this.type = type;
23954 this.quantifier = quantifier;
23955 }
23956
23957 @Override
23958 public OnnxType type() {
23959 return type;
23960 }
23961
23962 @Override
23963 public Quantifier quantifier() {
23964 return quantifier;
23965 }
23966 }
23967
23968 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
23969 NAME,
23970 List.of(Attribute.values()),
23971 List.of(TypeConstraint.values()),
23972 List.of(InputParameter.values()),
23973 List.of(OutputParameter.values())
23974 );
23975
23976 public STFT(ExternalizedOp def) {
23977 super(SCHEMA, def);
23978 }
23979
23980 STFT(STFT that, CodeContext cc) {
23981 super(that, cc);
23982 }
23983
23984 @Override
23985 public STFT transform(CodeContext cc, CodeTransformer ot) {
23986 return new STFT(this, cc);
23987 }
23988
23989 STFT(TypeElement resultType, Value signal, Value frame_step, java.util.Optional<Value> window, java.util.Optional<Value> frame_length, java.util.Optional<Long> onesided) {
23990 super(SCHEMA, resultType, Set.of(), List.of(signal, frame_step, window, frame_length), List.of(onesided));
23991 }
23992
23993 @Override
23994 public SequencedSet<OnnxParameter> onnxOutputs() {
23995 return onnxOutputs(SCHEMA);
23996 }
23997
23998 @Override
23999 public SequencedMap<OnnxParameter, Object> onnxInputs() {
24000 return onnxInputs(SCHEMA, List.of(signal(), frame_step(), window(), frame_length()));
24001 }
24002
24003 public Value signal() {
24004 return operands().get(0);
24005 }
24006
24007 public Value frame_step() {
24008 return operands().get(1);
24009 }
24010
24011 public java.util.Optional<Value> window() {
24012 int i = optionalInputArguments.indexOf(InputParameter.window);
24013 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
24014 }
24015
24016 public java.util.Optional<Value> frame_length() {
24017 int i = optionalInputArguments.indexOf(InputParameter.frame_length);
24018 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
24019 }
24020
24021 public java.util.Optional<Long> onesided() {
24022 Long onesided = Attribute.onesided.access(Long.class, onnxAttributes);
24023 return java.util.Optional.ofNullable(onesided);
24024 }
24025
24026 }
24027
24028 public static STFT STFT(TypeElement resultType, Value signal, Value frame_step, java.util.Optional<Value> window, java.util.Optional<Value> frame_length, java.util.Optional<Long> onesided) {
24029 return new STFT(resultType, signal, frame_step, window, frame_length, onesided);
24030 }
24031
24032 @OpFactoryHelper.OpDeclaration(SVMClassifier.NAME)
24033 public static final class SVMClassifier extends OnnxOp {
24034 public static final String NAME = "SVMClassifier";
24035
24036 public enum Attribute implements OnnxAttribute {
24037 prob_b(float[].class, true, null),
24038 kernel_params(float[].class, true, null),
24039 kernel_type(String.class, true, "LINEAR"),
24040 classlabels_ints(long[].class, true, null),
24041 post_transform(String.class, true, "NONE"),
24042 rho(float[].class, true, null),
24043 coefficients(float[].class, true, null),
24044 support_vectors(float[].class, true, null),
24045 vectors_per_class(long[].class, true, null),
24046 prob_a(float[].class, true, null),
24047 classlabels_strings(String[].class, true, null),
24048 ;
24049
24050 final Class<?> t;
24051 final boolean optional;
24052 final Object defaultValue;
24053
24054 Attribute(Class<?> type, boolean optional, Object defaultValue) {
24055 this.t = type;
24056 this.optional = optional;
24057 this.defaultValue = defaultValue;
24058 assert optional || defaultValue == null;
24059 }
24060
24061 public Class<?> type() {
24062 return t;
24063 }
24064
24065 public boolean isOptional() {
24066 return optional;
24067 }
24068
24069 public Object defaultValue() {
24070 return defaultValue;
24071 }
24072 }
24073
24074 public enum TypeConstraint implements OnnxTypeConstraint {
24075 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
24076 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))),
24077 ;
24078
24079 final OnnxType.TypeVariable typeVariable;
24080
24081 TypeConstraint(OnnxType.TypeVariable typeVariable) {
24082 assert typeVariable.name().equals(name());
24083 this.typeVariable = typeVariable;
24084 }
24085
24086 @Override
24087 public OnnxType.TypeVariable typeVariable() {
24088 return typeVariable;
24089 }
24090 }
24091
24092 public enum InputParameter implements OnnxParameter {
24093 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
24094 ;
24095
24096 final OnnxType type;
24097 final Quantifier quantifier;
24098
24099 InputParameter(OnnxType type, Quantifier quantifier) {
24100 this.type = type;
24101 this.quantifier = quantifier;
24102 }
24103
24104 @Override
24105 public OnnxType type() {
24106 return type;
24107 }
24108
24109 @Override
24110 public Quantifier quantifier() {
24111 return quantifier;
24112 }
24113 }
24114
24115 public enum OutputParameter implements OnnxParameter {
24116 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
24117 Z(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
24118 ;
24119
24120 final OnnxType type;
24121 final Quantifier quantifier;
24122
24123 OutputParameter(OnnxType type, Quantifier quantifier) {
24124 this.type = type;
24125 this.quantifier = quantifier;
24126 }
24127
24128 @Override
24129 public OnnxType type() {
24130 return type;
24131 }
24132
24133 @Override
24134 public Quantifier quantifier() {
24135 return quantifier;
24136 }
24137 }
24138
24139 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
24140 NAME,
24141 List.of(Attribute.values()),
24142 List.of(TypeConstraint.values()),
24143 List.of(InputParameter.values()),
24144 List.of(OutputParameter.values())
24145 );
24146
24147 public SVMClassifier(ExternalizedOp def) {
24148 super(SCHEMA, def);
24149 }
24150
24151 SVMClassifier(SVMClassifier that, CodeContext cc) {
24152 super(that, cc);
24153 }
24154
24155 @Override
24156 public SVMClassifier transform(CodeContext cc, CodeTransformer ot) {
24157 return new SVMClassifier(this, cc);
24158 }
24159
24160 SVMClassifier(TypeElement resultType, Value X, java.util.Optional<float[]> prob_b, java.util.Optional<float[]> kernel_params, java.util.Optional<String> kernel_type, java.util.Optional<long[]> classlabels_ints, java.util.Optional<String> post_transform, java.util.Optional<float[]> rho, java.util.Optional<float[]> coefficients, java.util.Optional<float[]> support_vectors, java.util.Optional<long[]> vectors_per_class, java.util.Optional<float[]> prob_a, java.util.Optional<String[]> classlabels_strings) {
24161 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(prob_b, kernel_params, kernel_type, classlabels_ints, post_transform, rho, coefficients, support_vectors, vectors_per_class, prob_a, classlabels_strings));
24162 }
24163
24164 @Override
24165 public SequencedSet<OnnxParameter> onnxOutputs() {
24166 return onnxOutputs(SCHEMA);
24167 }
24168
24169 @Override
24170 public SequencedMap<OnnxParameter, Object> onnxInputs() {
24171 return onnxInputs(SCHEMA, List.of(X()));
24172 }
24173
24174 public Value X() {
24175 return operands().get(0);
24176 }
24177
24178 public java.util.Optional<float[]> prob_b() {
24179 float[] prob_b = Attribute.prob_b.access(float[].class, onnxAttributes);
24180 return java.util.Optional.ofNullable(prob_b).map(float[]::clone);
24181 }
24182
24183 public java.util.Optional<float[]> kernel_params() {
24184 float[] kernel_params = Attribute.kernel_params.access(float[].class, onnxAttributes);
24185 return java.util.Optional.ofNullable(kernel_params).map(float[]::clone);
24186 }
24187
24188 public java.util.Optional<String> kernel_type() {
24189 String kernel_type = Attribute.kernel_type.access(String.class, onnxAttributes);
24190 return java.util.Optional.ofNullable(kernel_type);
24191 }
24192
24193 public java.util.Optional<long[]> classlabels_ints() {
24194 long[] classlabels_ints = Attribute.classlabels_ints.access(long[].class, onnxAttributes);
24195 return java.util.Optional.ofNullable(classlabels_ints).map(long[]::clone);
24196 }
24197
24198 public java.util.Optional<String> post_transform() {
24199 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes);
24200 return java.util.Optional.ofNullable(post_transform);
24201 }
24202
24203 public java.util.Optional<float[]> rho() {
24204 float[] rho = Attribute.rho.access(float[].class, onnxAttributes);
24205 return java.util.Optional.ofNullable(rho).map(float[]::clone);
24206 }
24207
24208 public java.util.Optional<float[]> coefficients() {
24209 float[] coefficients = Attribute.coefficients.access(float[].class, onnxAttributes);
24210 return java.util.Optional.ofNullable(coefficients).map(float[]::clone);
24211 }
24212
24213 public java.util.Optional<float[]> support_vectors() {
24214 float[] support_vectors = Attribute.support_vectors.access(float[].class, onnxAttributes);
24215 return java.util.Optional.ofNullable(support_vectors).map(float[]::clone);
24216 }
24217
24218 public java.util.Optional<long[]> vectors_per_class() {
24219 long[] vectors_per_class = Attribute.vectors_per_class.access(long[].class, onnxAttributes);
24220 return java.util.Optional.ofNullable(vectors_per_class).map(long[]::clone);
24221 }
24222
24223 public java.util.Optional<float[]> prob_a() {
24224 float[] prob_a = Attribute.prob_a.access(float[].class, onnxAttributes);
24225 return java.util.Optional.ofNullable(prob_a).map(float[]::clone);
24226 }
24227
24228 public java.util.Optional<String[]> classlabels_strings() {
24229 String[] classlabels_strings = Attribute.classlabels_strings.access(String[].class, onnxAttributes);
24230 return java.util.Optional.ofNullable(classlabels_strings).map(String[]::clone);
24231 }
24232
24233 }
24234
24235 public static SVMClassifier SVMClassifier(TypeElement resultType, Value X, java.util.Optional<float[]> prob_b, java.util.Optional<float[]> kernel_params, java.util.Optional<String> kernel_type, java.util.Optional<long[]> classlabels_ints, java.util.Optional<String> post_transform, java.util.Optional<float[]> rho, java.util.Optional<float[]> coefficients, java.util.Optional<float[]> support_vectors, java.util.Optional<long[]> vectors_per_class, java.util.Optional<float[]> prob_a, java.util.Optional<String[]> classlabels_strings) {
24236 return new SVMClassifier(resultType, X, prob_b, kernel_params, kernel_type, classlabels_ints, post_transform, rho, coefficients, support_vectors, vectors_per_class, prob_a, classlabels_strings);
24237 }
24238
24239 @OpFactoryHelper.OpDeclaration(SVMRegressor.NAME)
24240 public static final class SVMRegressor extends OnnxOp {
24241 public static final String NAME = "SVMRegressor";
24242
24243 public enum Attribute implements OnnxAttribute {
24244 kernel_type(String.class, true, "LINEAR"),
24245 kernel_params(float[].class, true, null),
24246 n_supports(Long.class, true, 0),
24247 rho(float[].class, true, null),
24248 post_transform(String.class, true, "NONE"),
24249 coefficients(float[].class, true, null),
24250 support_vectors(float[].class, true, null),
24251 one_class(Long.class, true, 0),
24252 ;
24253
24254 final Class<?> t;
24255 final boolean optional;
24256 final Object defaultValue;
24257
24258 Attribute(Class<?> type, boolean optional, Object defaultValue) {
24259 this.t = type;
24260 this.optional = optional;
24261 this.defaultValue = defaultValue;
24262 assert optional || defaultValue == null;
24263 }
24264
24265 public Class<?> type() {
24266 return t;
24267 }
24268
24269 public boolean isOptional() {
24270 return optional;
24271 }
24272
24273 public Object defaultValue() {
24274 return defaultValue;
24275 }
24276 }
24277
24278 public enum TypeConstraint implements OnnxTypeConstraint {
24279 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
24280 ;
24281
24282 final OnnxType.TypeVariable typeVariable;
24283
24284 TypeConstraint(OnnxType.TypeVariable typeVariable) {
24285 assert typeVariable.name().equals(name());
24286 this.typeVariable = typeVariable;
24287 }
24288
24289 @Override
24290 public OnnxType.TypeVariable typeVariable() {
24291 return typeVariable;
24292 }
24293 }
24294
24295 public enum InputParameter implements OnnxParameter {
24296 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24297 ;
24298
24299 final OnnxType type;
24300 final Quantifier quantifier;
24301
24302 InputParameter(OnnxType type, Quantifier quantifier) {
24303 this.type = type;
24304 this.quantifier = quantifier;
24305 }
24306
24307 @Override
24308 public OnnxType type() {
24309 return type;
24310 }
24311
24312 @Override
24313 public Quantifier quantifier() {
24314 return quantifier;
24315 }
24316 }
24317
24318 public enum OutputParameter implements OnnxParameter {
24319 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
24320 ;
24321
24322 final OnnxType type;
24323 final Quantifier quantifier;
24324
24325 OutputParameter(OnnxType type, Quantifier quantifier) {
24326 this.type = type;
24327 this.quantifier = quantifier;
24328 }
24329
24330 @Override
24331 public OnnxType type() {
24332 return type;
24333 }
24334
24335 @Override
24336 public Quantifier quantifier() {
24337 return quantifier;
24338 }
24339 }
24340
24341 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
24342 NAME,
24343 List.of(Attribute.values()),
24344 List.of(TypeConstraint.values()),
24345 List.of(InputParameter.values()),
24346 List.of(OutputParameter.values())
24347 );
24348
24349 public SVMRegressor(ExternalizedOp def) {
24350 super(SCHEMA, def);
24351 }
24352
24353 SVMRegressor(SVMRegressor that, CodeContext cc) {
24354 super(that, cc);
24355 }
24356
24357 @Override
24358 public SVMRegressor transform(CodeContext cc, CodeTransformer ot) {
24359 return new SVMRegressor(this, cc);
24360 }
24361
24362 SVMRegressor(TypeElement resultType, Value X, java.util.Optional<String> kernel_type, java.util.Optional<float[]> kernel_params, java.util.Optional<Long> n_supports, java.util.Optional<float[]> rho, java.util.Optional<String> post_transform, java.util.Optional<float[]> coefficients, java.util.Optional<float[]> support_vectors, java.util.Optional<Long> one_class) {
24363 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(kernel_type, kernel_params, n_supports, rho, post_transform, coefficients, support_vectors, one_class));
24364 }
24365
24366 @Override
24367 public SequencedSet<OnnxParameter> onnxOutputs() {
24368 return onnxOutputs(SCHEMA);
24369 }
24370
24371 @Override
24372 public SequencedMap<OnnxParameter, Object> onnxInputs() {
24373 return onnxInputs(SCHEMA, List.of(X()));
24374 }
24375
24376 public Value X() {
24377 return operands().get(0);
24378 }
24379
24380 public java.util.Optional<String> kernel_type() {
24381 String kernel_type = Attribute.kernel_type.access(String.class, onnxAttributes);
24382 return java.util.Optional.ofNullable(kernel_type);
24383 }
24384
24385 public java.util.Optional<float[]> kernel_params() {
24386 float[] kernel_params = Attribute.kernel_params.access(float[].class, onnxAttributes);
24387 return java.util.Optional.ofNullable(kernel_params).map(float[]::clone);
24388 }
24389
24390 public java.util.Optional<Long> n_supports() {
24391 Long n_supports = Attribute.n_supports.access(Long.class, onnxAttributes);
24392 return java.util.Optional.ofNullable(n_supports);
24393 }
24394
24395 public java.util.Optional<float[]> rho() {
24396 float[] rho = Attribute.rho.access(float[].class, onnxAttributes);
24397 return java.util.Optional.ofNullable(rho).map(float[]::clone);
24398 }
24399
24400 public java.util.Optional<String> post_transform() {
24401 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes);
24402 return java.util.Optional.ofNullable(post_transform);
24403 }
24404
24405 public java.util.Optional<float[]> coefficients() {
24406 float[] coefficients = Attribute.coefficients.access(float[].class, onnxAttributes);
24407 return java.util.Optional.ofNullable(coefficients).map(float[]::clone);
24408 }
24409
24410 public java.util.Optional<float[]> support_vectors() {
24411 float[] support_vectors = Attribute.support_vectors.access(float[].class, onnxAttributes);
24412 return java.util.Optional.ofNullable(support_vectors).map(float[]::clone);
24413 }
24414
24415 public java.util.Optional<Long> one_class() {
24416 Long one_class = Attribute.one_class.access(Long.class, onnxAttributes);
24417 return java.util.Optional.ofNullable(one_class);
24418 }
24419
24420 }
24421
24422 public static SVMRegressor SVMRegressor(TypeElement resultType, Value X, java.util.Optional<String> kernel_type, java.util.Optional<float[]> kernel_params, java.util.Optional<Long> n_supports, java.util.Optional<float[]> rho, java.util.Optional<String> post_transform, java.util.Optional<float[]> coefficients, java.util.Optional<float[]> support_vectors, java.util.Optional<Long> one_class) {
24423 return new SVMRegressor(resultType, X, kernel_type, kernel_params, n_supports, rho, post_transform, coefficients, support_vectors, one_class);
24424 }
24425
24426 @OpFactoryHelper.OpDeclaration(Scaler.NAME)
24427 public static final class Scaler extends OnnxOp {
24428 public static final String NAME = "Scaler";
24429
24430 public enum Attribute implements OnnxAttribute {
24431 offset(float[].class, true, null),
24432 scale(float[].class, true, null),
24433 ;
24434
24435 final Class<?> t;
24436 final boolean optional;
24437 final Object defaultValue;
24438
24439 Attribute(Class<?> type, boolean optional, Object defaultValue) {
24440 this.t = type;
24441 this.optional = optional;
24442 this.defaultValue = defaultValue;
24443 assert optional || defaultValue == null;
24444 }
24445
24446 public Class<?> type() {
24447 return t;
24448 }
24449
24450 public boolean isOptional() {
24451 return optional;
24452 }
24453
24454 public Object defaultValue() {
24455 return defaultValue;
24456 }
24457 }
24458
24459 public enum TypeConstraint implements OnnxTypeConstraint {
24460 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
24461 ;
24462
24463 final OnnxType.TypeVariable typeVariable;
24464
24465 TypeConstraint(OnnxType.TypeVariable typeVariable) {
24466 assert typeVariable.name().equals(name());
24467 this.typeVariable = typeVariable;
24468 }
24469
24470 @Override
24471 public OnnxType.TypeVariable typeVariable() {
24472 return typeVariable;
24473 }
24474 }
24475
24476 public enum InputParameter implements OnnxParameter {
24477 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24478 ;
24479
24480 final OnnxType type;
24481 final Quantifier quantifier;
24482
24483 InputParameter(OnnxType type, Quantifier quantifier) {
24484 this.type = type;
24485 this.quantifier = quantifier;
24486 }
24487
24488 @Override
24489 public OnnxType type() {
24490 return type;
24491 }
24492
24493 @Override
24494 public Quantifier quantifier() {
24495 return quantifier;
24496 }
24497 }
24498
24499 public enum OutputParameter implements OnnxParameter {
24500 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
24501 ;
24502
24503 final OnnxType type;
24504 final Quantifier quantifier;
24505
24506 OutputParameter(OnnxType type, Quantifier quantifier) {
24507 this.type = type;
24508 this.quantifier = quantifier;
24509 }
24510
24511 @Override
24512 public OnnxType type() {
24513 return type;
24514 }
24515
24516 @Override
24517 public Quantifier quantifier() {
24518 return quantifier;
24519 }
24520 }
24521
24522 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
24523 NAME,
24524 List.of(Attribute.values()),
24525 List.of(TypeConstraint.values()),
24526 List.of(InputParameter.values()),
24527 List.of(OutputParameter.values())
24528 );
24529
24530 public Scaler(ExternalizedOp def) {
24531 super(SCHEMA, def);
24532 }
24533
24534 Scaler(Scaler that, CodeContext cc) {
24535 super(that, cc);
24536 }
24537
24538 @Override
24539 public Scaler transform(CodeContext cc, CodeTransformer ot) {
24540 return new Scaler(this, cc);
24541 }
24542
24543 Scaler(TypeElement resultType, Value X, java.util.Optional<float[]> offset, java.util.Optional<float[]> scale) {
24544 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(offset, scale));
24545 }
24546
24547 @Override
24548 public SequencedSet<OnnxParameter> onnxOutputs() {
24549 return onnxOutputs(SCHEMA);
24550 }
24551
24552 @Override
24553 public SequencedMap<OnnxParameter, Object> onnxInputs() {
24554 return onnxInputs(SCHEMA, List.of(X()));
24555 }
24556
24557 public Value X() {
24558 return operands().get(0);
24559 }
24560
24561 public java.util.Optional<float[]> offset() {
24562 float[] offset = Attribute.offset.access(float[].class, onnxAttributes);
24563 return java.util.Optional.ofNullable(offset).map(float[]::clone);
24564 }
24565
24566 public java.util.Optional<float[]> scale() {
24567 float[] scale = Attribute.scale.access(float[].class, onnxAttributes);
24568 return java.util.Optional.ofNullable(scale).map(float[]::clone);
24569 }
24570
24571 }
24572
24573 public static Scaler Scaler(TypeElement resultType, Value X, java.util.Optional<float[]> offset, java.util.Optional<float[]> scale) {
24574 return new Scaler(resultType, X, offset, scale);
24575 }
24576
24577 @OpFactoryHelper.OpDeclaration(Scatter.NAME)
24578 public static final class Scatter extends OnnxOp {
24579 public static final String NAME = "Scatter";
24580
24581 public enum Attribute implements OnnxAttribute {
24582 axis(Long.class, true, 0),
24583 ;
24584
24585 final Class<?> t;
24586 final boolean optional;
24587 final Object defaultValue;
24588
24589 Attribute(Class<?> type, boolean optional, Object defaultValue) {
24590 this.t = type;
24591 this.optional = optional;
24592 this.defaultValue = defaultValue;
24593 assert optional || defaultValue == null;
24594 }
24595
24596 public Class<?> type() {
24597 return t;
24598 }
24599
24600 public boolean isOptional() {
24601 return optional;
24602 }
24603
24604 public Object defaultValue() {
24605 return defaultValue;
24606 }
24607 }
24608
24609 public enum TypeConstraint implements OnnxTypeConstraint {
24610 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
24611 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
24612 ;
24613
24614 final OnnxType.TypeVariable typeVariable;
24615
24616 TypeConstraint(OnnxType.TypeVariable typeVariable) {
24617 assert typeVariable.name().equals(name());
24618 this.typeVariable = typeVariable;
24619 }
24620
24621 @Override
24622 public OnnxType.TypeVariable typeVariable() {
24623 return typeVariable;
24624 }
24625 }
24626
24627 public enum InputParameter implements OnnxParameter {
24628 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24629 indices(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
24630 updates(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24631 ;
24632
24633 final OnnxType type;
24634 final Quantifier quantifier;
24635
24636 InputParameter(OnnxType type, Quantifier quantifier) {
24637 this.type = type;
24638 this.quantifier = quantifier;
24639 }
24640
24641 @Override
24642 public OnnxType type() {
24643 return type;
24644 }
24645
24646 @Override
24647 public Quantifier quantifier() {
24648 return quantifier;
24649 }
24650 }
24651
24652 public enum OutputParameter implements OnnxParameter {
24653 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24654 ;
24655
24656 final OnnxType type;
24657 final Quantifier quantifier;
24658
24659 OutputParameter(OnnxType type, Quantifier quantifier) {
24660 this.type = type;
24661 this.quantifier = quantifier;
24662 }
24663
24664 @Override
24665 public OnnxType type() {
24666 return type;
24667 }
24668
24669 @Override
24670 public Quantifier quantifier() {
24671 return quantifier;
24672 }
24673 }
24674
24675 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
24676 NAME,
24677 List.of(Attribute.values()),
24678 List.of(TypeConstraint.values()),
24679 List.of(InputParameter.values()),
24680 List.of(OutputParameter.values())
24681 );
24682
24683 public Scatter(ExternalizedOp def) {
24684 super(SCHEMA, def);
24685 }
24686
24687 Scatter(Scatter that, CodeContext cc) {
24688 super(that, cc);
24689 }
24690
24691 @Override
24692 public Scatter transform(CodeContext cc, CodeTransformer ot) {
24693 return new Scatter(this, cc);
24694 }
24695
24696 Scatter(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<Long> axis) {
24697 super(SCHEMA, resultType, Set.of(), List.of(data, indices, updates), List.of(axis));
24698 }
24699
24700 @Override
24701 public SequencedSet<OnnxParameter> onnxOutputs() {
24702 return onnxOutputs(SCHEMA);
24703 }
24704
24705 @Override
24706 public SequencedMap<OnnxParameter, Object> onnxInputs() {
24707 return onnxInputs(SCHEMA, List.of(data(), indices(), updates()));
24708 }
24709
24710 public Value data() {
24711 return operands().get(0);
24712 }
24713
24714 public Value indices() {
24715 return operands().get(1);
24716 }
24717
24718 public Value updates() {
24719 return operands().get(2);
24720 }
24721
24722 public java.util.Optional<Long> axis() {
24723 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
24724 return java.util.Optional.ofNullable(axis);
24725 }
24726
24727 }
24728
24729 public static Scatter Scatter(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<Long> axis) {
24730 return new Scatter(resultType, data, indices, updates, axis);
24731 }
24732
24733 @OpFactoryHelper.OpDeclaration(ScatterElements.NAME)
24734 public static final class ScatterElements extends OnnxOp {
24735 public static final String NAME = "ScatterElements";
24736
24737 public enum Attribute implements OnnxAttribute {
24738 reduction(String.class, true, "none"),
24739 axis(Long.class, true, 0),
24740 ;
24741
24742 final Class<?> t;
24743 final boolean optional;
24744 final Object defaultValue;
24745
24746 Attribute(Class<?> type, boolean optional, Object defaultValue) {
24747 this.t = type;
24748 this.optional = optional;
24749 this.defaultValue = defaultValue;
24750 assert optional || defaultValue == null;
24751 }
24752
24753 public Class<?> type() {
24754 return t;
24755 }
24756
24757 public boolean isOptional() {
24758 return optional;
24759 }
24760
24761 public Object defaultValue() {
24762 return defaultValue;
24763 }
24764 }
24765
24766 public enum TypeConstraint implements OnnxTypeConstraint {
24767 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
24768 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
24769 ;
24770
24771 final OnnxType.TypeVariable typeVariable;
24772
24773 TypeConstraint(OnnxType.TypeVariable typeVariable) {
24774 assert typeVariable.name().equals(name());
24775 this.typeVariable = typeVariable;
24776 }
24777
24778 @Override
24779 public OnnxType.TypeVariable typeVariable() {
24780 return typeVariable;
24781 }
24782 }
24783
24784 public enum InputParameter implements OnnxParameter {
24785 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24786 indices(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
24787 updates(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24788 ;
24789
24790 final OnnxType type;
24791 final Quantifier quantifier;
24792
24793 InputParameter(OnnxType type, Quantifier quantifier) {
24794 this.type = type;
24795 this.quantifier = quantifier;
24796 }
24797
24798 @Override
24799 public OnnxType type() {
24800 return type;
24801 }
24802
24803 @Override
24804 public Quantifier quantifier() {
24805 return quantifier;
24806 }
24807 }
24808
24809 public enum OutputParameter implements OnnxParameter {
24810 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24811 ;
24812
24813 final OnnxType type;
24814 final Quantifier quantifier;
24815
24816 OutputParameter(OnnxType type, Quantifier quantifier) {
24817 this.type = type;
24818 this.quantifier = quantifier;
24819 }
24820
24821 @Override
24822 public OnnxType type() {
24823 return type;
24824 }
24825
24826 @Override
24827 public Quantifier quantifier() {
24828 return quantifier;
24829 }
24830 }
24831
24832 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
24833 NAME,
24834 List.of(Attribute.values()),
24835 List.of(TypeConstraint.values()),
24836 List.of(InputParameter.values()),
24837 List.of(OutputParameter.values())
24838 );
24839
24840 public ScatterElements(ExternalizedOp def) {
24841 super(SCHEMA, def);
24842 }
24843
24844 ScatterElements(ScatterElements that, CodeContext cc) {
24845 super(that, cc);
24846 }
24847
24848 @Override
24849 public ScatterElements transform(CodeContext cc, CodeTransformer ot) {
24850 return new ScatterElements(this, cc);
24851 }
24852
24853 ScatterElements(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<String> reduction, java.util.Optional<Long> axis) {
24854 super(SCHEMA, resultType, Set.of(), List.of(data, indices, updates), List.of(reduction, axis));
24855 }
24856
24857 @Override
24858 public SequencedSet<OnnxParameter> onnxOutputs() {
24859 return onnxOutputs(SCHEMA);
24860 }
24861
24862 @Override
24863 public SequencedMap<OnnxParameter, Object> onnxInputs() {
24864 return onnxInputs(SCHEMA, List.of(data(), indices(), updates()));
24865 }
24866
24867 public Value data() {
24868 return operands().get(0);
24869 }
24870
24871 public Value indices() {
24872 return operands().get(1);
24873 }
24874
24875 public Value updates() {
24876 return operands().get(2);
24877 }
24878
24879 public java.util.Optional<String> reduction() {
24880 String reduction = Attribute.reduction.access(String.class, onnxAttributes);
24881 return java.util.Optional.ofNullable(reduction);
24882 }
24883
24884 public java.util.Optional<Long> axis() {
24885 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
24886 return java.util.Optional.ofNullable(axis);
24887 }
24888
24889 }
24890
24891 public static ScatterElements ScatterElements(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<String> reduction, java.util.Optional<Long> axis) {
24892 return new ScatterElements(resultType, data, indices, updates, reduction, axis);
24893 }
24894
24895 @OpFactoryHelper.OpDeclaration(ScatterND.NAME)
24896 public static final class ScatterND extends OnnxOp {
24897 public static final String NAME = "ScatterND";
24898
24899 public enum Attribute implements OnnxAttribute {
24900 reduction(String.class, true, "none"),
24901 ;
24902
24903 final Class<?> t;
24904 final boolean optional;
24905 final Object defaultValue;
24906
24907 Attribute(Class<?> type, boolean optional, Object defaultValue) {
24908 this.t = type;
24909 this.optional = optional;
24910 this.defaultValue = defaultValue;
24911 assert optional || defaultValue == null;
24912 }
24913
24914 public Class<?> type() {
24915 return t;
24916 }
24917
24918 public boolean isOptional() {
24919 return optional;
24920 }
24921
24922 public Object defaultValue() {
24923 return defaultValue;
24924 }
24925 }
24926
24927 public enum TypeConstraint implements OnnxTypeConstraint {
24928 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
24929 ;
24930
24931 final OnnxType.TypeVariable typeVariable;
24932
24933 TypeConstraint(OnnxType.TypeVariable typeVariable) {
24934 assert typeVariable.name().equals(name());
24935 this.typeVariable = typeVariable;
24936 }
24937
24938 @Override
24939 public OnnxType.TypeVariable typeVariable() {
24940 return typeVariable;
24941 }
24942 }
24943
24944 public enum InputParameter implements OnnxParameter {
24945 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24946 indices(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
24947 updates(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24948 ;
24949
24950 final OnnxType type;
24951 final Quantifier quantifier;
24952
24953 InputParameter(OnnxType type, Quantifier quantifier) {
24954 this.type = type;
24955 this.quantifier = quantifier;
24956 }
24957
24958 @Override
24959 public OnnxType type() {
24960 return type;
24961 }
24962
24963 @Override
24964 public Quantifier quantifier() {
24965 return quantifier;
24966 }
24967 }
24968
24969 public enum OutputParameter implements OnnxParameter {
24970 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
24971 ;
24972
24973 final OnnxType type;
24974 final Quantifier quantifier;
24975
24976 OutputParameter(OnnxType type, Quantifier quantifier) {
24977 this.type = type;
24978 this.quantifier = quantifier;
24979 }
24980
24981 @Override
24982 public OnnxType type() {
24983 return type;
24984 }
24985
24986 @Override
24987 public Quantifier quantifier() {
24988 return quantifier;
24989 }
24990 }
24991
24992 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
24993 NAME,
24994 List.of(Attribute.values()),
24995 List.of(TypeConstraint.values()),
24996 List.of(InputParameter.values()),
24997 List.of(OutputParameter.values())
24998 );
24999
25000 public ScatterND(ExternalizedOp def) {
25001 super(SCHEMA, def);
25002 }
25003
25004 ScatterND(ScatterND that, CodeContext cc) {
25005 super(that, cc);
25006 }
25007
25008 @Override
25009 public ScatterND transform(CodeContext cc, CodeTransformer ot) {
25010 return new ScatterND(this, cc);
25011 }
25012
25013 ScatterND(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<String> reduction) {
25014 super(SCHEMA, resultType, Set.of(), List.of(data, indices, updates), List.of(reduction));
25015 }
25016
25017 @Override
25018 public SequencedSet<OnnxParameter> onnxOutputs() {
25019 return onnxOutputs(SCHEMA);
25020 }
25021
25022 @Override
25023 public SequencedMap<OnnxParameter, Object> onnxInputs() {
25024 return onnxInputs(SCHEMA, List.of(data(), indices(), updates()));
25025 }
25026
25027 public Value data() {
25028 return operands().get(0);
25029 }
25030
25031 public Value indices() {
25032 return operands().get(1);
25033 }
25034
25035 public Value updates() {
25036 return operands().get(2);
25037 }
25038
25039 public java.util.Optional<String> reduction() {
25040 String reduction = Attribute.reduction.access(String.class, onnxAttributes);
25041 return java.util.Optional.ofNullable(reduction);
25042 }
25043
25044 }
25045
25046 public static ScatterND ScatterND(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<String> reduction) {
25047 return new ScatterND(resultType, data, indices, updates, reduction);
25048 }
25049
25050 @OpFactoryHelper.OpDeclaration(Selu.NAME)
25051 public static final class Selu extends OnnxOp {
25052 public static final String NAME = "Selu";
25053
25054 public enum Attribute implements OnnxAttribute {
25055 alpha(Float.class, true, 1.6732632f),
25056 gamma(Float.class, true, 1.050701f),
25057 ;
25058
25059 final Class<?> t;
25060 final boolean optional;
25061 final Object defaultValue;
25062
25063 Attribute(Class<?> type, boolean optional, Object defaultValue) {
25064 this.t = type;
25065 this.optional = optional;
25066 this.defaultValue = defaultValue;
25067 assert optional || defaultValue == null;
25068 }
25069
25070 public Class<?> type() {
25071 return t;
25072 }
25073
25074 public boolean isOptional() {
25075 return optional;
25076 }
25077
25078 public Object defaultValue() {
25079 return defaultValue;
25080 }
25081 }
25082
25083 public enum TypeConstraint implements OnnxTypeConstraint {
25084 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
25085 ;
25086
25087 final OnnxType.TypeVariable typeVariable;
25088
25089 TypeConstraint(OnnxType.TypeVariable typeVariable) {
25090 assert typeVariable.name().equals(name());
25091 this.typeVariable = typeVariable;
25092 }
25093
25094 @Override
25095 public OnnxType.TypeVariable typeVariable() {
25096 return typeVariable;
25097 }
25098 }
25099
25100 public enum InputParameter implements OnnxParameter {
25101 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
25102 ;
25103
25104 final OnnxType type;
25105 final Quantifier quantifier;
25106
25107 InputParameter(OnnxType type, Quantifier quantifier) {
25108 this.type = type;
25109 this.quantifier = quantifier;
25110 }
25111
25112 @Override
25113 public OnnxType type() {
25114 return type;
25115 }
25116
25117 @Override
25118 public Quantifier quantifier() {
25119 return quantifier;
25120 }
25121 }
25122
25123 public enum OutputParameter implements OnnxParameter {
25124 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
25125 ;
25126
25127 final OnnxType type;
25128 final Quantifier quantifier;
25129
25130 OutputParameter(OnnxType type, Quantifier quantifier) {
25131 this.type = type;
25132 this.quantifier = quantifier;
25133 }
25134
25135 @Override
25136 public OnnxType type() {
25137 return type;
25138 }
25139
25140 @Override
25141 public Quantifier quantifier() {
25142 return quantifier;
25143 }
25144 }
25145
25146 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
25147 NAME,
25148 List.of(Attribute.values()),
25149 List.of(TypeConstraint.values()),
25150 List.of(InputParameter.values()),
25151 List.of(OutputParameter.values())
25152 );
25153
25154 public Selu(ExternalizedOp def) {
25155 super(SCHEMA, def);
25156 }
25157
25158 Selu(Selu that, CodeContext cc) {
25159 super(that, cc);
25160 }
25161
25162 @Override
25163 public Selu transform(CodeContext cc, CodeTransformer ot) {
25164 return new Selu(this, cc);
25165 }
25166
25167 Selu(TypeElement resultType, Value X, java.util.Optional<Float> alpha, java.util.Optional<Float> gamma) {
25168 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha, gamma));
25169 }
25170
25171 @Override
25172 public SequencedSet<OnnxParameter> onnxOutputs() {
25173 return onnxOutputs(SCHEMA);
25174 }
25175
25176 @Override
25177 public SequencedMap<OnnxParameter, Object> onnxInputs() {
25178 return onnxInputs(SCHEMA, List.of(X()));
25179 }
25180
25181 public Value X() {
25182 return operands().get(0);
25183 }
25184
25185 public java.util.Optional<Float> alpha() {
25186 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
25187 return java.util.Optional.ofNullable(alpha);
25188 }
25189
25190 public java.util.Optional<Float> gamma() {
25191 Float gamma = Attribute.gamma.access(Float.class, onnxAttributes);
25192 return java.util.Optional.ofNullable(gamma);
25193 }
25194
25195 }
25196
25197 public static Selu Selu(TypeElement resultType, Value X, java.util.Optional<Float> alpha, java.util.Optional<Float> gamma) {
25198 return new Selu(resultType, X, alpha, gamma);
25199 }
25200
25201 @OpFactoryHelper.OpDeclaration(SequenceAt.NAME)
25202 public static final class SequenceAt extends OnnxOp {
25203 public static final String NAME = "SequenceAt";
25204
25205 public enum Attribute implements OnnxAttribute.None { }
25206
25207 public enum TypeConstraint implements OnnxTypeConstraint {
25208 S(new OnnxType.TypeVariable("S", List.of(OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
25209 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
25210 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
25211 ;
25212
25213 final OnnxType.TypeVariable typeVariable;
25214
25215 TypeConstraint(OnnxType.TypeVariable typeVariable) {
25216 assert typeVariable.name().equals(name());
25217 this.typeVariable = typeVariable;
25218 }
25219
25220 @Override
25221 public OnnxType.TypeVariable typeVariable() {
25222 return typeVariable;
25223 }
25224 }
25225
25226 public enum InputParameter implements OnnxParameter {
25227 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
25228 position(TypeConstraint.I.typeVariable(), Quantifier.REQUIRED),
25229 ;
25230
25231 final OnnxType type;
25232 final Quantifier quantifier;
25233
25234 InputParameter(OnnxType type, Quantifier quantifier) {
25235 this.type = type;
25236 this.quantifier = quantifier;
25237 }
25238
25239 @Override
25240 public OnnxType type() {
25241 return type;
25242 }
25243
25244 @Override
25245 public Quantifier quantifier() {
25246 return quantifier;
25247 }
25248 }
25249
25250 public enum OutputParameter implements OnnxParameter {
25251 tensor(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
25252 ;
25253
25254 final OnnxType type;
25255 final Quantifier quantifier;
25256
25257 OutputParameter(OnnxType type, Quantifier quantifier) {
25258 this.type = type;
25259 this.quantifier = quantifier;
25260 }
25261
25262 @Override
25263 public OnnxType type() {
25264 return type;
25265 }
25266
25267 @Override
25268 public Quantifier quantifier() {
25269 return quantifier;
25270 }
25271 }
25272
25273 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
25274 NAME,
25275 List.of(Attribute.values()),
25276 List.of(TypeConstraint.values()),
25277 List.of(InputParameter.values()),
25278 List.of(OutputParameter.values())
25279 );
25280
25281 public SequenceAt(ExternalizedOp def) {
25282 super(SCHEMA, def);
25283 }
25284
25285 SequenceAt(SequenceAt that, CodeContext cc) {
25286 super(that, cc);
25287 }
25288
25289 @Override
25290 public SequenceAt transform(CodeContext cc, CodeTransformer ot) {
25291 return new SequenceAt(this, cc);
25292 }
25293
25294 SequenceAt(TypeElement resultType, Value input_sequence, Value position) {
25295 super(SCHEMA, resultType, Set.of(), List.of(input_sequence, position), List.of());
25296 }
25297
25298 @Override
25299 public SequencedSet<OnnxParameter> onnxOutputs() {
25300 return onnxOutputs(SCHEMA);
25301 }
25302
25303 @Override
25304 public SequencedMap<OnnxParameter, Object> onnxInputs() {
25305 return onnxInputs(SCHEMA, List.of(input_sequence(), position()));
25306 }
25307
25308 public Value input_sequence() {
25309 return operands().get(0);
25310 }
25311
25312 public Value position() {
25313 return operands().get(1);
25314 }
25315
25316 }
25317
25318 public static SequenceAt SequenceAt(TypeElement resultType, Value input_sequence, Value position) {
25319 return new SequenceAt(resultType, input_sequence, position);
25320 }
25321
25322 @OpFactoryHelper.OpDeclaration(SequenceConstruct.NAME)
25323 public static final class SequenceConstruct extends OnnxOp {
25324 public static final String NAME = "SequenceConstruct";
25325
25326 public enum Attribute implements OnnxAttribute.None { }
25327
25328 public enum TypeConstraint implements OnnxTypeConstraint {
25329 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
25330 S(new OnnxType.TypeVariable("S", List.of(OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
25331 ;
25332
25333 final OnnxType.TypeVariable typeVariable;
25334
25335 TypeConstraint(OnnxType.TypeVariable typeVariable) {
25336 assert typeVariable.name().equals(name());
25337 this.typeVariable = typeVariable;
25338 }
25339
25340 @Override
25341 public OnnxType.TypeVariable typeVariable() {
25342 return typeVariable;
25343 }
25344 }
25345
25346 public enum InputParameter implements OnnxParameter {
25347 inputs(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC),
25348 ;
25349
25350 final OnnxType type;
25351 final Quantifier quantifier;
25352
25353 InputParameter(OnnxType type, Quantifier quantifier) {
25354 this.type = type;
25355 this.quantifier = quantifier;
25356 }
25357
25358 @Override
25359 public OnnxType type() {
25360 return type;
25361 }
25362
25363 @Override
25364 public Quantifier quantifier() {
25365 return quantifier;
25366 }
25367 }
25368
25369 public enum OutputParameter implements OnnxParameter {
25370 output_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
25371 ;
25372
25373 final OnnxType type;
25374 final Quantifier quantifier;
25375
25376 OutputParameter(OnnxType type, Quantifier quantifier) {
25377 this.type = type;
25378 this.quantifier = quantifier;
25379 }
25380
25381 @Override
25382 public OnnxType type() {
25383 return type;
25384 }
25385
25386 @Override
25387 public Quantifier quantifier() {
25388 return quantifier;
25389 }
25390 }
25391
25392 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
25393 NAME,
25394 List.of(Attribute.values()),
25395 List.of(TypeConstraint.values()),
25396 List.of(InputParameter.values()),
25397 List.of(OutputParameter.values())
25398 );
25399
25400 public SequenceConstruct(ExternalizedOp def) {
25401 super(SCHEMA, def);
25402 }
25403
25404 SequenceConstruct(SequenceConstruct that, CodeContext cc) {
25405 super(that, cc);
25406 }
25407
25408 @Override
25409 public SequenceConstruct transform(CodeContext cc, CodeTransformer ot) {
25410 return new SequenceConstruct(this, cc);
25411 }
25412
25413 SequenceConstruct(TypeElement resultType, List<Value> inputs) {
25414 super(SCHEMA, resultType, Set.of(), List.of(inputs), List.of());
25415 }
25416
25417 @Override
25418 public SequencedSet<OnnxParameter> onnxOutputs() {
25419 return onnxOutputs(SCHEMA);
25420 }
25421
25422 @Override
25423 public SequencedMap<OnnxParameter, Object> onnxInputs() {
25424 return onnxInputs(SCHEMA, List.of(inputs()));
25425 }
25426
25427 public List<Value> inputs() {
25428 return operands();
25429 }
25430
25431 }
25432
25433 public static SequenceConstruct SequenceConstruct(TypeElement resultType, List<Value> inputs) {
25434 return new SequenceConstruct(resultType, inputs);
25435 }
25436
25437 @OpFactoryHelper.OpDeclaration(SequenceEmpty.NAME)
25438 public static final class SequenceEmpty extends OnnxOp {
25439 public static final String NAME = "SequenceEmpty";
25440
25441 public enum Attribute implements OnnxAttribute {
25442 dtype(Long.class, true, null),
25443 ;
25444
25445 final Class<?> t;
25446 final boolean optional;
25447 final Object defaultValue;
25448
25449 Attribute(Class<?> type, boolean optional, Object defaultValue) {
25450 this.t = type;
25451 this.optional = optional;
25452 this.defaultValue = defaultValue;
25453 assert optional || defaultValue == null;
25454 }
25455
25456 public Class<?> type() {
25457 return t;
25458 }
25459
25460 public boolean isOptional() {
25461 return optional;
25462 }
25463
25464 public Object defaultValue() {
25465 return defaultValue;
25466 }
25467 }
25468
25469 public enum TypeConstraint implements OnnxTypeConstraint {
25470 S(new OnnxType.TypeVariable("S", List.of(OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
25471 ;
25472
25473 final OnnxType.TypeVariable typeVariable;
25474
25475 TypeConstraint(OnnxType.TypeVariable typeVariable) {
25476 assert typeVariable.name().equals(name());
25477 this.typeVariable = typeVariable;
25478 }
25479
25480 @Override
25481 public OnnxType.TypeVariable typeVariable() {
25482 return typeVariable;
25483 }
25484 }
25485
25486 public enum InputParameter implements OnnxParameter.None { }
25487
25488 public enum OutputParameter implements OnnxParameter {
25489 output(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
25490 ;
25491
25492 final OnnxType type;
25493 final Quantifier quantifier;
25494
25495 OutputParameter(OnnxType type, Quantifier quantifier) {
25496 this.type = type;
25497 this.quantifier = quantifier;
25498 }
25499
25500 @Override
25501 public OnnxType type() {
25502 return type;
25503 }
25504
25505 @Override
25506 public Quantifier quantifier() {
25507 return quantifier;
25508 }
25509 }
25510
25511 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
25512 NAME,
25513 List.of(Attribute.values()),
25514 List.of(TypeConstraint.values()),
25515 List.of(InputParameter.values()),
25516 List.of(OutputParameter.values())
25517 );
25518
25519 public SequenceEmpty(ExternalizedOp def) {
25520 super(SCHEMA, def);
25521 }
25522
25523 SequenceEmpty(SequenceEmpty that, CodeContext cc) {
25524 super(that, cc);
25525 }
25526
25527 @Override
25528 public SequenceEmpty transform(CodeContext cc, CodeTransformer ot) {
25529 return new SequenceEmpty(this, cc);
25530 }
25531
25532 SequenceEmpty(TypeElement resultType, java.util.Optional<Long> dtype) {
25533 super(SCHEMA, resultType, Set.of(), List.of(), List.of(dtype));
25534 }
25535
25536 @Override
25537 public SequencedSet<OnnxParameter> onnxOutputs() {
25538 return onnxOutputs(SCHEMA);
25539 }
25540
25541 @Override
25542 public SequencedMap<OnnxParameter, Object> onnxInputs() {
25543 return onnxInputs(SCHEMA, List.of());
25544 }
25545
25546 public java.util.Optional<Long> dtype() {
25547 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes);
25548 return java.util.Optional.ofNullable(dtype);
25549 }
25550
25551 }
25552
25553 public static SequenceEmpty SequenceEmpty(TypeElement resultType, java.util.Optional<Long> dtype) {
25554 return new SequenceEmpty(resultType, dtype);
25555 }
25556
25557 @OpFactoryHelper.OpDeclaration(SequenceErase.NAME)
25558 public static final class SequenceErase extends OnnxOp {
25559 public static final String NAME = "SequenceErase";
25560
25561 public enum Attribute implements OnnxAttribute.None { }
25562
25563 public enum TypeConstraint implements OnnxTypeConstraint {
25564 S(new OnnxType.TypeVariable("S", List.of(OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
25565 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
25566 ;
25567
25568 final OnnxType.TypeVariable typeVariable;
25569
25570 TypeConstraint(OnnxType.TypeVariable typeVariable) {
25571 assert typeVariable.name().equals(name());
25572 this.typeVariable = typeVariable;
25573 }
25574
25575 @Override
25576 public OnnxType.TypeVariable typeVariable() {
25577 return typeVariable;
25578 }
25579 }
25580
25581 public enum InputParameter implements OnnxParameter {
25582 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
25583 position(TypeConstraint.I.typeVariable(), Quantifier.OPTIONAL),
25584 ;
25585
25586 final OnnxType type;
25587 final Quantifier quantifier;
25588
25589 InputParameter(OnnxType type, Quantifier quantifier) {
25590 this.type = type;
25591 this.quantifier = quantifier;
25592 }
25593
25594 @Override
25595 public OnnxType type() {
25596 return type;
25597 }
25598
25599 @Override
25600 public Quantifier quantifier() {
25601 return quantifier;
25602 }
25603 }
25604
25605 public enum OutputParameter implements OnnxParameter {
25606 output_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
25607 ;
25608
25609 final OnnxType type;
25610 final Quantifier quantifier;
25611
25612 OutputParameter(OnnxType type, Quantifier quantifier) {
25613 this.type = type;
25614 this.quantifier = quantifier;
25615 }
25616
25617 @Override
25618 public OnnxType type() {
25619 return type;
25620 }
25621
25622 @Override
25623 public Quantifier quantifier() {
25624 return quantifier;
25625 }
25626 }
25627
25628 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
25629 NAME,
25630 List.of(Attribute.values()),
25631 List.of(TypeConstraint.values()),
25632 List.of(InputParameter.values()),
25633 List.of(OutputParameter.values())
25634 );
25635
25636 public SequenceErase(ExternalizedOp def) {
25637 super(SCHEMA, def);
25638 }
25639
25640 SequenceErase(SequenceErase that, CodeContext cc) {
25641 super(that, cc);
25642 }
25643
25644 @Override
25645 public SequenceErase transform(CodeContext cc, CodeTransformer ot) {
25646 return new SequenceErase(this, cc);
25647 }
25648
25649 SequenceErase(TypeElement resultType, Value input_sequence, java.util.Optional<Value> position) {
25650 super(SCHEMA, resultType, Set.of(), List.of(input_sequence, position), List.of());
25651 }
25652
25653 @Override
25654 public SequencedSet<OnnxParameter> onnxOutputs() {
25655 return onnxOutputs(SCHEMA);
25656 }
25657
25658 @Override
25659 public SequencedMap<OnnxParameter, Object> onnxInputs() {
25660 return onnxInputs(SCHEMA, List.of(input_sequence(), position()));
25661 }
25662
25663 public Value input_sequence() {
25664 return operands().get(0);
25665 }
25666
25667 public java.util.Optional<Value> position() {
25668 int i = optionalInputArguments.indexOf(InputParameter.position);
25669 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
25670 }
25671
25672 }
25673
25674 public static SequenceErase SequenceErase(TypeElement resultType, Value input_sequence, java.util.Optional<Value> position) {
25675 return new SequenceErase(resultType, input_sequence, position);
25676 }
25677
25678 @OpFactoryHelper.OpDeclaration(SequenceInsert.NAME)
25679 public static final class SequenceInsert extends OnnxOp {
25680 public static final String NAME = "SequenceInsert";
25681
25682 public enum Attribute implements OnnxAttribute.None { }
25683
25684 public enum TypeConstraint implements OnnxTypeConstraint {
25685 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
25686 S(new OnnxType.TypeVariable("S", List.of(OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
25687 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
25688 ;
25689
25690 final OnnxType.TypeVariable typeVariable;
25691
25692 TypeConstraint(OnnxType.TypeVariable typeVariable) {
25693 assert typeVariable.name().equals(name());
25694 this.typeVariable = typeVariable;
25695 }
25696
25697 @Override
25698 public OnnxType.TypeVariable typeVariable() {
25699 return typeVariable;
25700 }
25701 }
25702
25703 public enum InputParameter implements OnnxParameter {
25704 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
25705 tensor(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
25706 position(TypeConstraint.I.typeVariable(), Quantifier.OPTIONAL),
25707 ;
25708
25709 final OnnxType type;
25710 final Quantifier quantifier;
25711
25712 InputParameter(OnnxType type, Quantifier quantifier) {
25713 this.type = type;
25714 this.quantifier = quantifier;
25715 }
25716
25717 @Override
25718 public OnnxType type() {
25719 return type;
25720 }
25721
25722 @Override
25723 public Quantifier quantifier() {
25724 return quantifier;
25725 }
25726 }
25727
25728 public enum OutputParameter implements OnnxParameter {
25729 output_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
25730 ;
25731
25732 final OnnxType type;
25733 final Quantifier quantifier;
25734
25735 OutputParameter(OnnxType type, Quantifier quantifier) {
25736 this.type = type;
25737 this.quantifier = quantifier;
25738 }
25739
25740 @Override
25741 public OnnxType type() {
25742 return type;
25743 }
25744
25745 @Override
25746 public Quantifier quantifier() {
25747 return quantifier;
25748 }
25749 }
25750
25751 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
25752 NAME,
25753 List.of(Attribute.values()),
25754 List.of(TypeConstraint.values()),
25755 List.of(InputParameter.values()),
25756 List.of(OutputParameter.values())
25757 );
25758
25759 public SequenceInsert(ExternalizedOp def) {
25760 super(SCHEMA, def);
25761 }
25762
25763 SequenceInsert(SequenceInsert that, CodeContext cc) {
25764 super(that, cc);
25765 }
25766
25767 @Override
25768 public SequenceInsert transform(CodeContext cc, CodeTransformer ot) {
25769 return new SequenceInsert(this, cc);
25770 }
25771
25772 SequenceInsert(TypeElement resultType, Value input_sequence, Value tensor, java.util.Optional<Value> position) {
25773 super(SCHEMA, resultType, Set.of(), List.of(input_sequence, tensor, position), List.of());
25774 }
25775
25776 @Override
25777 public SequencedSet<OnnxParameter> onnxOutputs() {
25778 return onnxOutputs(SCHEMA);
25779 }
25780
25781 @Override
25782 public SequencedMap<OnnxParameter, Object> onnxInputs() {
25783 return onnxInputs(SCHEMA, List.of(input_sequence(), tensor(), position()));
25784 }
25785
25786 public Value input_sequence() {
25787 return operands().get(0);
25788 }
25789
25790 public Value tensor() {
25791 return operands().get(1);
25792 }
25793
25794 public java.util.Optional<Value> position() {
25795 int i = optionalInputArguments.indexOf(InputParameter.position);
25796 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
25797 }
25798
25799 }
25800
25801 public static SequenceInsert SequenceInsert(TypeElement resultType, Value input_sequence, Value tensor, java.util.Optional<Value> position) {
25802 return new SequenceInsert(resultType, input_sequence, tensor, position);
25803 }
25804
25805 @OpFactoryHelper.OpDeclaration(SequenceLength.NAME)
25806 public static final class SequenceLength extends OnnxOp {
25807 public static final String NAME = "SequenceLength";
25808
25809 public enum Attribute implements OnnxAttribute.None { }
25810
25811 public enum TypeConstraint implements OnnxTypeConstraint {
25812 S(new OnnxType.TypeVariable("S", List.of(OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
25813 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int64())))),
25814 ;
25815
25816 final OnnxType.TypeVariable typeVariable;
25817
25818 TypeConstraint(OnnxType.TypeVariable typeVariable) {
25819 assert typeVariable.name().equals(name());
25820 this.typeVariable = typeVariable;
25821 }
25822
25823 @Override
25824 public OnnxType.TypeVariable typeVariable() {
25825 return typeVariable;
25826 }
25827 }
25828
25829 public enum InputParameter implements OnnxParameter {
25830 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
25831 ;
25832
25833 final OnnxType type;
25834 final Quantifier quantifier;
25835
25836 InputParameter(OnnxType type, Quantifier quantifier) {
25837 this.type = type;
25838 this.quantifier = quantifier;
25839 }
25840
25841 @Override
25842 public OnnxType type() {
25843 return type;
25844 }
25845
25846 @Override
25847 public Quantifier quantifier() {
25848 return quantifier;
25849 }
25850 }
25851
25852 public enum OutputParameter implements OnnxParameter {
25853 length(TypeConstraint.I.typeVariable(), Quantifier.REQUIRED),
25854 ;
25855
25856 final OnnxType type;
25857 final Quantifier quantifier;
25858
25859 OutputParameter(OnnxType type, Quantifier quantifier) {
25860 this.type = type;
25861 this.quantifier = quantifier;
25862 }
25863
25864 @Override
25865 public OnnxType type() {
25866 return type;
25867 }
25868
25869 @Override
25870 public Quantifier quantifier() {
25871 return quantifier;
25872 }
25873 }
25874
25875 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
25876 NAME,
25877 List.of(Attribute.values()),
25878 List.of(TypeConstraint.values()),
25879 List.of(InputParameter.values()),
25880 List.of(OutputParameter.values())
25881 );
25882
25883 public SequenceLength(ExternalizedOp def) {
25884 super(SCHEMA, def);
25885 }
25886
25887 SequenceLength(SequenceLength that, CodeContext cc) {
25888 super(that, cc);
25889 }
25890
25891 @Override
25892 public SequenceLength transform(CodeContext cc, CodeTransformer ot) {
25893 return new SequenceLength(this, cc);
25894 }
25895
25896 SequenceLength(TypeElement resultType, Value input_sequence) {
25897 super(SCHEMA, resultType, Set.of(), List.of(input_sequence), List.of());
25898 }
25899
25900 @Override
25901 public SequencedSet<OnnxParameter> onnxOutputs() {
25902 return onnxOutputs(SCHEMA);
25903 }
25904
25905 @Override
25906 public SequencedMap<OnnxParameter, Object> onnxInputs() {
25907 return onnxInputs(SCHEMA, List.of(input_sequence()));
25908 }
25909
25910 public Value input_sequence() {
25911 return operands().get(0);
25912 }
25913
25914 }
25915
25916 public static SequenceLength SequenceLength(TypeElement resultType, Value input_sequence) {
25917 return new SequenceLength(resultType, input_sequence);
25918 }
25919
25920 @OpFactoryHelper.OpDeclaration(Shape.NAME)
25921 public static final class Shape extends OnnxOp {
25922 public static final String NAME = "Shape";
25923
25924 public enum Attribute implements OnnxAttribute {
25925 start(Long.class, true, 0),
25926 end(Long.class, true, null),
25927 ;
25928
25929 final Class<?> t;
25930 final boolean optional;
25931 final Object defaultValue;
25932
25933 Attribute(Class<?> type, boolean optional, Object defaultValue) {
25934 this.t = type;
25935 this.optional = optional;
25936 this.defaultValue = defaultValue;
25937 assert optional || defaultValue == null;
25938 }
25939
25940 public Class<?> type() {
25941 return t;
25942 }
25943
25944 public boolean isOptional() {
25945 return optional;
25946 }
25947
25948 public Object defaultValue() {
25949 return defaultValue;
25950 }
25951 }
25952
25953 public enum TypeConstraint implements OnnxTypeConstraint {
25954 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
25955 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int64())))),
25956 ;
25957
25958 final OnnxType.TypeVariable typeVariable;
25959
25960 TypeConstraint(OnnxType.TypeVariable typeVariable) {
25961 assert typeVariable.name().equals(name());
25962 this.typeVariable = typeVariable;
25963 }
25964
25965 @Override
25966 public OnnxType.TypeVariable typeVariable() {
25967 return typeVariable;
25968 }
25969 }
25970
25971 public enum InputParameter implements OnnxParameter {
25972 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
25973 ;
25974
25975 final OnnxType type;
25976 final Quantifier quantifier;
25977
25978 InputParameter(OnnxType type, Quantifier quantifier) {
25979 this.type = type;
25980 this.quantifier = quantifier;
25981 }
25982
25983 @Override
25984 public OnnxType type() {
25985 return type;
25986 }
25987
25988 @Override
25989 public Quantifier quantifier() {
25990 return quantifier;
25991 }
25992 }
25993
25994 public enum OutputParameter implements OnnxParameter {
25995 shape(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
25996 ;
25997
25998 final OnnxType type;
25999 final Quantifier quantifier;
26000
26001 OutputParameter(OnnxType type, Quantifier quantifier) {
26002 this.type = type;
26003 this.quantifier = quantifier;
26004 }
26005
26006 @Override
26007 public OnnxType type() {
26008 return type;
26009 }
26010
26011 @Override
26012 public Quantifier quantifier() {
26013 return quantifier;
26014 }
26015 }
26016
26017 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
26018 NAME,
26019 List.of(Attribute.values()),
26020 List.of(TypeConstraint.values()),
26021 List.of(InputParameter.values()),
26022 List.of(OutputParameter.values())
26023 );
26024
26025 public Shape(ExternalizedOp def) {
26026 super(SCHEMA, def);
26027 }
26028
26029 Shape(Shape that, CodeContext cc) {
26030 super(that, cc);
26031 }
26032
26033 @Override
26034 public Shape transform(CodeContext cc, CodeTransformer ot) {
26035 return new Shape(this, cc);
26036 }
26037
26038 Shape(TypeElement resultType, Value data, java.util.Optional<Long> start, java.util.Optional<Long> end) {
26039 super(SCHEMA, resultType, Set.of(), List.of(data), List.of(start, end));
26040 }
26041
26042 @Override
26043 public SequencedSet<OnnxParameter> onnxOutputs() {
26044 return onnxOutputs(SCHEMA);
26045 }
26046
26047 @Override
26048 public SequencedMap<OnnxParameter, Object> onnxInputs() {
26049 return onnxInputs(SCHEMA, List.of(data()));
26050 }
26051
26052 public Value data() {
26053 return operands().get(0);
26054 }
26055
26056 public java.util.Optional<Long> start() {
26057 Long start = Attribute.start.access(Long.class, onnxAttributes);
26058 return java.util.Optional.ofNullable(start);
26059 }
26060
26061 public java.util.Optional<Long> end() {
26062 Long end = Attribute.end.access(Long.class, onnxAttributes);
26063 return java.util.Optional.ofNullable(end);
26064 }
26065
26066 }
26067
26068 public static Shape Shape(TypeElement resultType, Value data, java.util.Optional<Long> start, java.util.Optional<Long> end) {
26069 return new Shape(resultType, data, start, end);
26070 }
26071
26072 @OpFactoryHelper.OpDeclaration(Shrink.NAME)
26073 public static final class Shrink extends OnnxOp {
26074 public static final String NAME = "Shrink";
26075
26076 public enum Attribute implements OnnxAttribute {
26077 lambd(Float.class, true, 0.5f),
26078 bias(Float.class, true, 0.0f),
26079 ;
26080
26081 final Class<?> t;
26082 final boolean optional;
26083 final Object defaultValue;
26084
26085 Attribute(Class<?> type, boolean optional, Object defaultValue) {
26086 this.t = type;
26087 this.optional = optional;
26088 this.defaultValue = defaultValue;
26089 assert optional || defaultValue == null;
26090 }
26091
26092 public Class<?> type() {
26093 return t;
26094 }
26095
26096 public boolean isOptional() {
26097 return optional;
26098 }
26099
26100 public Object defaultValue() {
26101 return defaultValue;
26102 }
26103 }
26104
26105 public enum TypeConstraint implements OnnxTypeConstraint {
26106 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
26107 ;
26108
26109 final OnnxType.TypeVariable typeVariable;
26110
26111 TypeConstraint(OnnxType.TypeVariable typeVariable) {
26112 assert typeVariable.name().equals(name());
26113 this.typeVariable = typeVariable;
26114 }
26115
26116 @Override
26117 public OnnxType.TypeVariable typeVariable() {
26118 return typeVariable;
26119 }
26120 }
26121
26122 public enum InputParameter implements OnnxParameter {
26123 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26124 ;
26125
26126 final OnnxType type;
26127 final Quantifier quantifier;
26128
26129 InputParameter(OnnxType type, Quantifier quantifier) {
26130 this.type = type;
26131 this.quantifier = quantifier;
26132 }
26133
26134 @Override
26135 public OnnxType type() {
26136 return type;
26137 }
26138
26139 @Override
26140 public Quantifier quantifier() {
26141 return quantifier;
26142 }
26143 }
26144
26145 public enum OutputParameter implements OnnxParameter {
26146 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26147 ;
26148
26149 final OnnxType type;
26150 final Quantifier quantifier;
26151
26152 OutputParameter(OnnxType type, Quantifier quantifier) {
26153 this.type = type;
26154 this.quantifier = quantifier;
26155 }
26156
26157 @Override
26158 public OnnxType type() {
26159 return type;
26160 }
26161
26162 @Override
26163 public Quantifier quantifier() {
26164 return quantifier;
26165 }
26166 }
26167
26168 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
26169 NAME,
26170 List.of(Attribute.values()),
26171 List.of(TypeConstraint.values()),
26172 List.of(InputParameter.values()),
26173 List.of(OutputParameter.values())
26174 );
26175
26176 public Shrink(ExternalizedOp def) {
26177 super(SCHEMA, def);
26178 }
26179
26180 Shrink(Shrink that, CodeContext cc) {
26181 super(that, cc);
26182 }
26183
26184 @Override
26185 public Shrink transform(CodeContext cc, CodeTransformer ot) {
26186 return new Shrink(this, cc);
26187 }
26188
26189 Shrink(TypeElement resultType, Value input, java.util.Optional<Float> lambd, java.util.Optional<Float> bias) {
26190 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(lambd, bias));
26191 }
26192
26193 @Override
26194 public SequencedSet<OnnxParameter> onnxOutputs() {
26195 return onnxOutputs(SCHEMA);
26196 }
26197
26198 @Override
26199 public SequencedMap<OnnxParameter, Object> onnxInputs() {
26200 return onnxInputs(SCHEMA, List.of(input()));
26201 }
26202
26203 public Value input() {
26204 return operands().get(0);
26205 }
26206
26207 public java.util.Optional<Float> lambd() {
26208 Float lambd = Attribute.lambd.access(Float.class, onnxAttributes);
26209 return java.util.Optional.ofNullable(lambd);
26210 }
26211
26212 public java.util.Optional<Float> bias() {
26213 Float bias = Attribute.bias.access(Float.class, onnxAttributes);
26214 return java.util.Optional.ofNullable(bias);
26215 }
26216
26217 }
26218
26219 public static Shrink Shrink(TypeElement resultType, Value input, java.util.Optional<Float> lambd, java.util.Optional<Float> bias) {
26220 return new Shrink(resultType, input, lambd, bias);
26221 }
26222
26223 @OpFactoryHelper.OpDeclaration(Sigmoid.NAME)
26224 public static final class Sigmoid extends OnnxOp {
26225 public static final String NAME = "Sigmoid";
26226
26227 public enum Attribute implements OnnxAttribute.None { }
26228
26229 public enum TypeConstraint implements OnnxTypeConstraint {
26230 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
26231 ;
26232
26233 final OnnxType.TypeVariable typeVariable;
26234
26235 TypeConstraint(OnnxType.TypeVariable typeVariable) {
26236 assert typeVariable.name().equals(name());
26237 this.typeVariable = typeVariable;
26238 }
26239
26240 @Override
26241 public OnnxType.TypeVariable typeVariable() {
26242 return typeVariable;
26243 }
26244 }
26245
26246 public enum InputParameter implements OnnxParameter {
26247 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26248 ;
26249
26250 final OnnxType type;
26251 final Quantifier quantifier;
26252
26253 InputParameter(OnnxType type, Quantifier quantifier) {
26254 this.type = type;
26255 this.quantifier = quantifier;
26256 }
26257
26258 @Override
26259 public OnnxType type() {
26260 return type;
26261 }
26262
26263 @Override
26264 public Quantifier quantifier() {
26265 return quantifier;
26266 }
26267 }
26268
26269 public enum OutputParameter implements OnnxParameter {
26270 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26271 ;
26272
26273 final OnnxType type;
26274 final Quantifier quantifier;
26275
26276 OutputParameter(OnnxType type, Quantifier quantifier) {
26277 this.type = type;
26278 this.quantifier = quantifier;
26279 }
26280
26281 @Override
26282 public OnnxType type() {
26283 return type;
26284 }
26285
26286 @Override
26287 public Quantifier quantifier() {
26288 return quantifier;
26289 }
26290 }
26291
26292 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
26293 NAME,
26294 List.of(Attribute.values()),
26295 List.of(TypeConstraint.values()),
26296 List.of(InputParameter.values()),
26297 List.of(OutputParameter.values())
26298 );
26299
26300 public Sigmoid(ExternalizedOp def) {
26301 super(SCHEMA, def);
26302 }
26303
26304 Sigmoid(Sigmoid that, CodeContext cc) {
26305 super(that, cc);
26306 }
26307
26308 @Override
26309 public Sigmoid transform(CodeContext cc, CodeTransformer ot) {
26310 return new Sigmoid(this, cc);
26311 }
26312
26313 Sigmoid(TypeElement resultType, Value X) {
26314 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
26315 }
26316
26317 @Override
26318 public SequencedSet<OnnxParameter> onnxOutputs() {
26319 return onnxOutputs(SCHEMA);
26320 }
26321
26322 @Override
26323 public SequencedMap<OnnxParameter, Object> onnxInputs() {
26324 return onnxInputs(SCHEMA, List.of(X()));
26325 }
26326
26327 public Value X() {
26328 return operands().get(0);
26329 }
26330
26331 }
26332
26333 public static Sigmoid Sigmoid(TypeElement resultType, Value X) {
26334 return new Sigmoid(resultType, X);
26335 }
26336
26337 @OpFactoryHelper.OpDeclaration(Sign.NAME)
26338 public static final class Sign extends OnnxOp {
26339 public static final String NAME = "Sign";
26340
26341 public enum Attribute implements OnnxAttribute.None { }
26342
26343 public enum TypeConstraint implements OnnxTypeConstraint {
26344 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
26345 ;
26346
26347 final OnnxType.TypeVariable typeVariable;
26348
26349 TypeConstraint(OnnxType.TypeVariable typeVariable) {
26350 assert typeVariable.name().equals(name());
26351 this.typeVariable = typeVariable;
26352 }
26353
26354 @Override
26355 public OnnxType.TypeVariable typeVariable() {
26356 return typeVariable;
26357 }
26358 }
26359
26360 public enum InputParameter implements OnnxParameter {
26361 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26362 ;
26363
26364 final OnnxType type;
26365 final Quantifier quantifier;
26366
26367 InputParameter(OnnxType type, Quantifier quantifier) {
26368 this.type = type;
26369 this.quantifier = quantifier;
26370 }
26371
26372 @Override
26373 public OnnxType type() {
26374 return type;
26375 }
26376
26377 @Override
26378 public Quantifier quantifier() {
26379 return quantifier;
26380 }
26381 }
26382
26383 public enum OutputParameter implements OnnxParameter {
26384 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26385 ;
26386
26387 final OnnxType type;
26388 final Quantifier quantifier;
26389
26390 OutputParameter(OnnxType type, Quantifier quantifier) {
26391 this.type = type;
26392 this.quantifier = quantifier;
26393 }
26394
26395 @Override
26396 public OnnxType type() {
26397 return type;
26398 }
26399
26400 @Override
26401 public Quantifier quantifier() {
26402 return quantifier;
26403 }
26404 }
26405
26406 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
26407 NAME,
26408 List.of(Attribute.values()),
26409 List.of(TypeConstraint.values()),
26410 List.of(InputParameter.values()),
26411 List.of(OutputParameter.values())
26412 );
26413
26414 public Sign(ExternalizedOp def) {
26415 super(SCHEMA, def);
26416 }
26417
26418 Sign(Sign that, CodeContext cc) {
26419 super(that, cc);
26420 }
26421
26422 @Override
26423 public Sign transform(CodeContext cc, CodeTransformer ot) {
26424 return new Sign(this, cc);
26425 }
26426
26427 Sign(TypeElement resultType, Value input) {
26428 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
26429 }
26430
26431 @Override
26432 public SequencedSet<OnnxParameter> onnxOutputs() {
26433 return onnxOutputs(SCHEMA);
26434 }
26435
26436 @Override
26437 public SequencedMap<OnnxParameter, Object> onnxInputs() {
26438 return onnxInputs(SCHEMA, List.of(input()));
26439 }
26440
26441 public Value input() {
26442 return operands().get(0);
26443 }
26444
26445 }
26446
26447 public static Sign Sign(TypeElement resultType, Value input) {
26448 return new Sign(resultType, input);
26449 }
26450
26451 @OpFactoryHelper.OpDeclaration(Sin.NAME)
26452 public static final class Sin extends OnnxOp {
26453 public static final String NAME = "Sin";
26454
26455 public enum Attribute implements OnnxAttribute.None { }
26456
26457 public enum TypeConstraint implements OnnxTypeConstraint {
26458 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
26459 ;
26460
26461 final OnnxType.TypeVariable typeVariable;
26462
26463 TypeConstraint(OnnxType.TypeVariable typeVariable) {
26464 assert typeVariable.name().equals(name());
26465 this.typeVariable = typeVariable;
26466 }
26467
26468 @Override
26469 public OnnxType.TypeVariable typeVariable() {
26470 return typeVariable;
26471 }
26472 }
26473
26474 public enum InputParameter implements OnnxParameter {
26475 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26476 ;
26477
26478 final OnnxType type;
26479 final Quantifier quantifier;
26480
26481 InputParameter(OnnxType type, Quantifier quantifier) {
26482 this.type = type;
26483 this.quantifier = quantifier;
26484 }
26485
26486 @Override
26487 public OnnxType type() {
26488 return type;
26489 }
26490
26491 @Override
26492 public Quantifier quantifier() {
26493 return quantifier;
26494 }
26495 }
26496
26497 public enum OutputParameter implements OnnxParameter {
26498 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26499 ;
26500
26501 final OnnxType type;
26502 final Quantifier quantifier;
26503
26504 OutputParameter(OnnxType type, Quantifier quantifier) {
26505 this.type = type;
26506 this.quantifier = quantifier;
26507 }
26508
26509 @Override
26510 public OnnxType type() {
26511 return type;
26512 }
26513
26514 @Override
26515 public Quantifier quantifier() {
26516 return quantifier;
26517 }
26518 }
26519
26520 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
26521 NAME,
26522 List.of(Attribute.values()),
26523 List.of(TypeConstraint.values()),
26524 List.of(InputParameter.values()),
26525 List.of(OutputParameter.values())
26526 );
26527
26528 public Sin(ExternalizedOp def) {
26529 super(SCHEMA, def);
26530 }
26531
26532 Sin(Sin that, CodeContext cc) {
26533 super(that, cc);
26534 }
26535
26536 @Override
26537 public Sin transform(CodeContext cc, CodeTransformer ot) {
26538 return new Sin(this, cc);
26539 }
26540
26541 Sin(TypeElement resultType, Value input) {
26542 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
26543 }
26544
26545 @Override
26546 public SequencedSet<OnnxParameter> onnxOutputs() {
26547 return onnxOutputs(SCHEMA);
26548 }
26549
26550 @Override
26551 public SequencedMap<OnnxParameter, Object> onnxInputs() {
26552 return onnxInputs(SCHEMA, List.of(input()));
26553 }
26554
26555 public Value input() {
26556 return operands().get(0);
26557 }
26558
26559 }
26560
26561 public static Sin Sin(TypeElement resultType, Value input) {
26562 return new Sin(resultType, input);
26563 }
26564
26565 @OpFactoryHelper.OpDeclaration(Sinh.NAME)
26566 public static final class Sinh extends OnnxOp {
26567 public static final String NAME = "Sinh";
26568
26569 public enum Attribute implements OnnxAttribute.None { }
26570
26571 public enum TypeConstraint implements OnnxTypeConstraint {
26572 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
26573 ;
26574
26575 final OnnxType.TypeVariable typeVariable;
26576
26577 TypeConstraint(OnnxType.TypeVariable typeVariable) {
26578 assert typeVariable.name().equals(name());
26579 this.typeVariable = typeVariable;
26580 }
26581
26582 @Override
26583 public OnnxType.TypeVariable typeVariable() {
26584 return typeVariable;
26585 }
26586 }
26587
26588 public enum InputParameter implements OnnxParameter {
26589 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26590 ;
26591
26592 final OnnxType type;
26593 final Quantifier quantifier;
26594
26595 InputParameter(OnnxType type, Quantifier quantifier) {
26596 this.type = type;
26597 this.quantifier = quantifier;
26598 }
26599
26600 @Override
26601 public OnnxType type() {
26602 return type;
26603 }
26604
26605 @Override
26606 public Quantifier quantifier() {
26607 return quantifier;
26608 }
26609 }
26610
26611 public enum OutputParameter implements OnnxParameter {
26612 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26613 ;
26614
26615 final OnnxType type;
26616 final Quantifier quantifier;
26617
26618 OutputParameter(OnnxType type, Quantifier quantifier) {
26619 this.type = type;
26620 this.quantifier = quantifier;
26621 }
26622
26623 @Override
26624 public OnnxType type() {
26625 return type;
26626 }
26627
26628 @Override
26629 public Quantifier quantifier() {
26630 return quantifier;
26631 }
26632 }
26633
26634 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
26635 NAME,
26636 List.of(Attribute.values()),
26637 List.of(TypeConstraint.values()),
26638 List.of(InputParameter.values()),
26639 List.of(OutputParameter.values())
26640 );
26641
26642 public Sinh(ExternalizedOp def) {
26643 super(SCHEMA, def);
26644 }
26645
26646 Sinh(Sinh that, CodeContext cc) {
26647 super(that, cc);
26648 }
26649
26650 @Override
26651 public Sinh transform(CodeContext cc, CodeTransformer ot) {
26652 return new Sinh(this, cc);
26653 }
26654
26655 Sinh(TypeElement resultType, Value input) {
26656 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
26657 }
26658
26659 @Override
26660 public SequencedSet<OnnxParameter> onnxOutputs() {
26661 return onnxOutputs(SCHEMA);
26662 }
26663
26664 @Override
26665 public SequencedMap<OnnxParameter, Object> onnxInputs() {
26666 return onnxInputs(SCHEMA, List.of(input()));
26667 }
26668
26669 public Value input() {
26670 return operands().get(0);
26671 }
26672
26673 }
26674
26675 public static Sinh Sinh(TypeElement resultType, Value input) {
26676 return new Sinh(resultType, input);
26677 }
26678
26679 @OpFactoryHelper.OpDeclaration(Size.NAME)
26680 public static final class Size extends OnnxOp {
26681 public static final String NAME = "Size";
26682
26683 public enum Attribute implements OnnxAttribute.None { }
26684
26685 public enum TypeConstraint implements OnnxTypeConstraint {
26686 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
26687 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int64())))),
26688 ;
26689
26690 final OnnxType.TypeVariable typeVariable;
26691
26692 TypeConstraint(OnnxType.TypeVariable typeVariable) {
26693 assert typeVariable.name().equals(name());
26694 this.typeVariable = typeVariable;
26695 }
26696
26697 @Override
26698 public OnnxType.TypeVariable typeVariable() {
26699 return typeVariable;
26700 }
26701 }
26702
26703 public enum InputParameter implements OnnxParameter {
26704 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26705 ;
26706
26707 final OnnxType type;
26708 final Quantifier quantifier;
26709
26710 InputParameter(OnnxType type, Quantifier quantifier) {
26711 this.type = type;
26712 this.quantifier = quantifier;
26713 }
26714
26715 @Override
26716 public OnnxType type() {
26717 return type;
26718 }
26719
26720 @Override
26721 public Quantifier quantifier() {
26722 return quantifier;
26723 }
26724 }
26725
26726 public enum OutputParameter implements OnnxParameter {
26727 size(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
26728 ;
26729
26730 final OnnxType type;
26731 final Quantifier quantifier;
26732
26733 OutputParameter(OnnxType type, Quantifier quantifier) {
26734 this.type = type;
26735 this.quantifier = quantifier;
26736 }
26737
26738 @Override
26739 public OnnxType type() {
26740 return type;
26741 }
26742
26743 @Override
26744 public Quantifier quantifier() {
26745 return quantifier;
26746 }
26747 }
26748
26749 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
26750 NAME,
26751 List.of(Attribute.values()),
26752 List.of(TypeConstraint.values()),
26753 List.of(InputParameter.values()),
26754 List.of(OutputParameter.values())
26755 );
26756
26757 public Size(ExternalizedOp def) {
26758 super(SCHEMA, def);
26759 }
26760
26761 Size(Size that, CodeContext cc) {
26762 super(that, cc);
26763 }
26764
26765 @Override
26766 public Size transform(CodeContext cc, CodeTransformer ot) {
26767 return new Size(this, cc);
26768 }
26769
26770 Size(TypeElement resultType, Value data) {
26771 super(SCHEMA, resultType, Set.of(), List.of(data), List.of());
26772 }
26773
26774 @Override
26775 public SequencedSet<OnnxParameter> onnxOutputs() {
26776 return onnxOutputs(SCHEMA);
26777 }
26778
26779 @Override
26780 public SequencedMap<OnnxParameter, Object> onnxInputs() {
26781 return onnxInputs(SCHEMA, List.of(data()));
26782 }
26783
26784 public Value data() {
26785 return operands().get(0);
26786 }
26787
26788 }
26789
26790 public static Size Size(TypeElement resultType, Value data) {
26791 return new Size(resultType, data);
26792 }
26793
26794 @OpFactoryHelper.OpDeclaration(Slice.NAME)
26795 public static final class Slice extends OnnxOp {
26796 public static final String NAME = "Slice";
26797
26798 public enum Attribute implements OnnxAttribute.None { }
26799
26800 public enum TypeConstraint implements OnnxTypeConstraint {
26801 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
26802 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
26803 ;
26804
26805 final OnnxType.TypeVariable typeVariable;
26806
26807 TypeConstraint(OnnxType.TypeVariable typeVariable) {
26808 assert typeVariable.name().equals(name());
26809 this.typeVariable = typeVariable;
26810 }
26811
26812 @Override
26813 public OnnxType.TypeVariable typeVariable() {
26814 return typeVariable;
26815 }
26816 }
26817
26818 public enum InputParameter implements OnnxParameter {
26819 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26820 starts(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
26821 ends(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
26822 axes(TypeConstraint.Tind.typeVariable(), Quantifier.OPTIONAL),
26823 steps(TypeConstraint.Tind.typeVariable(), Quantifier.OPTIONAL),
26824 ;
26825
26826 final OnnxType type;
26827 final Quantifier quantifier;
26828
26829 InputParameter(OnnxType type, Quantifier quantifier) {
26830 this.type = type;
26831 this.quantifier = quantifier;
26832 }
26833
26834 @Override
26835 public OnnxType type() {
26836 return type;
26837 }
26838
26839 @Override
26840 public Quantifier quantifier() {
26841 return quantifier;
26842 }
26843 }
26844
26845 public enum OutputParameter implements OnnxParameter {
26846 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26847 ;
26848
26849 final OnnxType type;
26850 final Quantifier quantifier;
26851
26852 OutputParameter(OnnxType type, Quantifier quantifier) {
26853 this.type = type;
26854 this.quantifier = quantifier;
26855 }
26856
26857 @Override
26858 public OnnxType type() {
26859 return type;
26860 }
26861
26862 @Override
26863 public Quantifier quantifier() {
26864 return quantifier;
26865 }
26866 }
26867
26868 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
26869 NAME,
26870 List.of(Attribute.values()),
26871 List.of(TypeConstraint.values()),
26872 List.of(InputParameter.values()),
26873 List.of(OutputParameter.values())
26874 );
26875
26876 public Slice(ExternalizedOp def) {
26877 super(SCHEMA, def);
26878 }
26879
26880 Slice(Slice that, CodeContext cc) {
26881 super(that, cc);
26882 }
26883
26884 @Override
26885 public Slice transform(CodeContext cc, CodeTransformer ot) {
26886 return new Slice(this, cc);
26887 }
26888
26889 Slice(TypeElement resultType, Value data, Value starts, Value ends, java.util.Optional<Value> axes, java.util.Optional<Value> steps) {
26890 super(SCHEMA, resultType, Set.of(), List.of(data, starts, ends, axes, steps), List.of());
26891 }
26892
26893 @Override
26894 public SequencedSet<OnnxParameter> onnxOutputs() {
26895 return onnxOutputs(SCHEMA);
26896 }
26897
26898 @Override
26899 public SequencedMap<OnnxParameter, Object> onnxInputs() {
26900 return onnxInputs(SCHEMA, List.of(data(), starts(), ends(), axes(), steps()));
26901 }
26902
26903 public Value data() {
26904 return operands().get(0);
26905 }
26906
26907 public Value starts() {
26908 return operands().get(1);
26909 }
26910
26911 public Value ends() {
26912 return operands().get(2);
26913 }
26914
26915 public java.util.Optional<Value> axes() {
26916 int i = optionalInputArguments.indexOf(InputParameter.axes);
26917 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
26918 }
26919
26920 public java.util.Optional<Value> steps() {
26921 int i = optionalInputArguments.indexOf(InputParameter.steps);
26922 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty();
26923 }
26924
26925 }
26926
26927 public static Slice Slice(TypeElement resultType, Value data, Value starts, Value ends, java.util.Optional<Value> axes, java.util.Optional<Value> steps) {
26928 return new Slice(resultType, data, starts, ends, axes, steps);
26929 }
26930
26931 @OpFactoryHelper.OpDeclaration(Softmax.NAME)
26932 public static final class Softmax extends OnnxOp {
26933 public static final String NAME = "Softmax";
26934
26935 public enum Attribute implements OnnxAttribute {
26936 axis(Long.class, true, -1),
26937 ;
26938
26939 final Class<?> t;
26940 final boolean optional;
26941 final Object defaultValue;
26942
26943 Attribute(Class<?> type, boolean optional, Object defaultValue) {
26944 this.t = type;
26945 this.optional = optional;
26946 this.defaultValue = defaultValue;
26947 assert optional || defaultValue == null;
26948 }
26949
26950 public Class<?> type() {
26951 return t;
26952 }
26953
26954 public boolean isOptional() {
26955 return optional;
26956 }
26957
26958 public Object defaultValue() {
26959 return defaultValue;
26960 }
26961 }
26962
26963 public enum TypeConstraint implements OnnxTypeConstraint {
26964 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
26965 ;
26966
26967 final OnnxType.TypeVariable typeVariable;
26968
26969 TypeConstraint(OnnxType.TypeVariable typeVariable) {
26970 assert typeVariable.name().equals(name());
26971 this.typeVariable = typeVariable;
26972 }
26973
26974 @Override
26975 public OnnxType.TypeVariable typeVariable() {
26976 return typeVariable;
26977 }
26978 }
26979
26980 public enum InputParameter implements OnnxParameter {
26981 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
26982 ;
26983
26984 final OnnxType type;
26985 final Quantifier quantifier;
26986
26987 InputParameter(OnnxType type, Quantifier quantifier) {
26988 this.type = type;
26989 this.quantifier = quantifier;
26990 }
26991
26992 @Override
26993 public OnnxType type() {
26994 return type;
26995 }
26996
26997 @Override
26998 public Quantifier quantifier() {
26999 return quantifier;
27000 }
27001 }
27002
27003 public enum OutputParameter implements OnnxParameter {
27004 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27005 ;
27006
27007 final OnnxType type;
27008 final Quantifier quantifier;
27009
27010 OutputParameter(OnnxType type, Quantifier quantifier) {
27011 this.type = type;
27012 this.quantifier = quantifier;
27013 }
27014
27015 @Override
27016 public OnnxType type() {
27017 return type;
27018 }
27019
27020 @Override
27021 public Quantifier quantifier() {
27022 return quantifier;
27023 }
27024 }
27025
27026 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
27027 NAME,
27028 List.of(Attribute.values()),
27029 List.of(TypeConstraint.values()),
27030 List.of(InputParameter.values()),
27031 List.of(OutputParameter.values())
27032 );
27033
27034 public Softmax(ExternalizedOp def) {
27035 super(SCHEMA, def);
27036 }
27037
27038 Softmax(Softmax that, CodeContext cc) {
27039 super(that, cc);
27040 }
27041
27042 @Override
27043 public Softmax transform(CodeContext cc, CodeTransformer ot) {
27044 return new Softmax(this, cc);
27045 }
27046
27047 Softmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) {
27048 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(axis));
27049 }
27050
27051 @Override
27052 public SequencedSet<OnnxParameter> onnxOutputs() {
27053 return onnxOutputs(SCHEMA);
27054 }
27055
27056 @Override
27057 public SequencedMap<OnnxParameter, Object> onnxInputs() {
27058 return onnxInputs(SCHEMA, List.of(input()));
27059 }
27060
27061 public Value input() {
27062 return operands().get(0);
27063 }
27064
27065 public java.util.Optional<Long> axis() {
27066 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
27067 return java.util.Optional.ofNullable(axis);
27068 }
27069
27070 }
27071
27072 public static Softmax Softmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) {
27073 return new Softmax(resultType, input, axis);
27074 }
27075
27076 @OpFactoryHelper.OpDeclaration(SoftmaxCrossEntropyLoss.NAME)
27077 public static final class SoftmaxCrossEntropyLoss extends OnnxOp {
27078 public static final String NAME = "SoftmaxCrossEntropyLoss";
27079
27080 public enum Attribute implements OnnxAttribute {
27081 ignore_index(Long.class, true, null),
27082 reduction(String.class, true, "mean"),
27083 ;
27084
27085 final Class<?> t;
27086 final boolean optional;
27087 final Object defaultValue;
27088
27089 Attribute(Class<?> type, boolean optional, Object defaultValue) {
27090 this.t = type;
27091 this.optional = optional;
27092 this.defaultValue = defaultValue;
27093 assert optional || defaultValue == null;
27094 }
27095
27096 public Class<?> type() {
27097 return t;
27098 }
27099
27100 public boolean isOptional() {
27101 return optional;
27102 }
27103
27104 public Object defaultValue() {
27105 return defaultValue;
27106 }
27107 }
27108
27109 public enum TypeConstraint implements OnnxTypeConstraint {
27110 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
27111 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
27112 ;
27113
27114 final OnnxType.TypeVariable typeVariable;
27115
27116 TypeConstraint(OnnxType.TypeVariable typeVariable) {
27117 assert typeVariable.name().equals(name());
27118 this.typeVariable = typeVariable;
27119 }
27120
27121 @Override
27122 public OnnxType.TypeVariable typeVariable() {
27123 return typeVariable;
27124 }
27125 }
27126
27127 public enum InputParameter implements OnnxParameter {
27128 scores(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27129 labels(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED),
27130 weights(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
27131 ;
27132
27133 final OnnxType type;
27134 final Quantifier quantifier;
27135
27136 InputParameter(OnnxType type, Quantifier quantifier) {
27137 this.type = type;
27138 this.quantifier = quantifier;
27139 }
27140
27141 @Override
27142 public OnnxType type() {
27143 return type;
27144 }
27145
27146 @Override
27147 public Quantifier quantifier() {
27148 return quantifier;
27149 }
27150 }
27151
27152 public enum OutputParameter implements OnnxParameter {
27153 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27154 log_prob(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL),
27155 ;
27156
27157 final OnnxType type;
27158 final Quantifier quantifier;
27159
27160 OutputParameter(OnnxType type, Quantifier quantifier) {
27161 this.type = type;
27162 this.quantifier = quantifier;
27163 }
27164
27165 @Override
27166 public OnnxType type() {
27167 return type;
27168 }
27169
27170 @Override
27171 public Quantifier quantifier() {
27172 return quantifier;
27173 }
27174 }
27175
27176 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
27177 NAME,
27178 List.of(Attribute.values()),
27179 List.of(TypeConstraint.values()),
27180 List.of(InputParameter.values()),
27181 List.of(OutputParameter.values())
27182 );
27183
27184 public SoftmaxCrossEntropyLoss(ExternalizedOp def) {
27185 super(SCHEMA, def);
27186 }
27187
27188 SoftmaxCrossEntropyLoss(SoftmaxCrossEntropyLoss that, CodeContext cc) {
27189 super(that, cc);
27190 }
27191
27192 @Override
27193 public SoftmaxCrossEntropyLoss transform(CodeContext cc, CodeTransformer ot) {
27194 return new SoftmaxCrossEntropyLoss(this, cc);
27195 }
27196
27197 SoftmaxCrossEntropyLoss(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value scores, Value labels, java.util.Optional<Value> weights, java.util.Optional<Long> ignore_index, java.util.Optional<String> reduction) {
27198 super(SCHEMA, resultType, optionalOutputs, List.of(scores, labels, weights), List.of(ignore_index, reduction));
27199 }
27200
27201 @Override
27202 public SequencedSet<OnnxParameter> onnxOutputs() {
27203 return onnxOutputs(SCHEMA);
27204 }
27205
27206 @Override
27207 public SequencedMap<OnnxParameter, Object> onnxInputs() {
27208 return onnxInputs(SCHEMA, List.of(scores(), labels(), weights()));
27209 }
27210
27211 public Value scores() {
27212 return operands().get(0);
27213 }
27214
27215 public Value labels() {
27216 return operands().get(1);
27217 }
27218
27219 public java.util.Optional<Value> weights() {
27220 int i = optionalInputArguments.indexOf(InputParameter.weights);
27221 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
27222 }
27223
27224 public java.util.Optional<Long> ignore_index() {
27225 Long ignore_index = Attribute.ignore_index.access(Long.class, onnxAttributes);
27226 return java.util.Optional.ofNullable(ignore_index);
27227 }
27228
27229 public java.util.Optional<String> reduction() {
27230 String reduction = Attribute.reduction.access(String.class, onnxAttributes);
27231 return java.util.Optional.ofNullable(reduction);
27232 }
27233
27234 }
27235
27236 public static SoftmaxCrossEntropyLoss SoftmaxCrossEntropyLoss(TypeElement resultType, Set<SoftmaxCrossEntropyLoss.OutputParameter> optionalOutputs, Value scores, Value labels, java.util.Optional<Value> weights, java.util.Optional<Long> ignore_index, java.util.Optional<String> reduction) {
27237 return new SoftmaxCrossEntropyLoss(resultType, optionalOutputs, scores, labels, weights, ignore_index, reduction);
27238 }
27239
27240 @OpFactoryHelper.OpDeclaration(Softplus.NAME)
27241 public static final class Softplus extends OnnxOp {
27242 public static final String NAME = "Softplus";
27243
27244 public enum Attribute implements OnnxAttribute.None { }
27245
27246 public enum TypeConstraint implements OnnxTypeConstraint {
27247 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
27248 ;
27249
27250 final OnnxType.TypeVariable typeVariable;
27251
27252 TypeConstraint(OnnxType.TypeVariable typeVariable) {
27253 assert typeVariable.name().equals(name());
27254 this.typeVariable = typeVariable;
27255 }
27256
27257 @Override
27258 public OnnxType.TypeVariable typeVariable() {
27259 return typeVariable;
27260 }
27261 }
27262
27263 public enum InputParameter implements OnnxParameter {
27264 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27265 ;
27266
27267 final OnnxType type;
27268 final Quantifier quantifier;
27269
27270 InputParameter(OnnxType type, Quantifier quantifier) {
27271 this.type = type;
27272 this.quantifier = quantifier;
27273 }
27274
27275 @Override
27276 public OnnxType type() {
27277 return type;
27278 }
27279
27280 @Override
27281 public Quantifier quantifier() {
27282 return quantifier;
27283 }
27284 }
27285
27286 public enum OutputParameter implements OnnxParameter {
27287 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27288 ;
27289
27290 final OnnxType type;
27291 final Quantifier quantifier;
27292
27293 OutputParameter(OnnxType type, Quantifier quantifier) {
27294 this.type = type;
27295 this.quantifier = quantifier;
27296 }
27297
27298 @Override
27299 public OnnxType type() {
27300 return type;
27301 }
27302
27303 @Override
27304 public Quantifier quantifier() {
27305 return quantifier;
27306 }
27307 }
27308
27309 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
27310 NAME,
27311 List.of(Attribute.values()),
27312 List.of(TypeConstraint.values()),
27313 List.of(InputParameter.values()),
27314 List.of(OutputParameter.values())
27315 );
27316
27317 public Softplus(ExternalizedOp def) {
27318 super(SCHEMA, def);
27319 }
27320
27321 Softplus(Softplus that, CodeContext cc) {
27322 super(that, cc);
27323 }
27324
27325 @Override
27326 public Softplus transform(CodeContext cc, CodeTransformer ot) {
27327 return new Softplus(this, cc);
27328 }
27329
27330 Softplus(TypeElement resultType, Value X) {
27331 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
27332 }
27333
27334 @Override
27335 public SequencedSet<OnnxParameter> onnxOutputs() {
27336 return onnxOutputs(SCHEMA);
27337 }
27338
27339 @Override
27340 public SequencedMap<OnnxParameter, Object> onnxInputs() {
27341 return onnxInputs(SCHEMA, List.of(X()));
27342 }
27343
27344 public Value X() {
27345 return operands().get(0);
27346 }
27347
27348 }
27349
27350 public static Softplus Softplus(TypeElement resultType, Value X) {
27351 return new Softplus(resultType, X);
27352 }
27353
27354 @OpFactoryHelper.OpDeclaration(Softsign.NAME)
27355 public static final class Softsign extends OnnxOp {
27356 public static final String NAME = "Softsign";
27357
27358 public enum Attribute implements OnnxAttribute.None { }
27359
27360 public enum TypeConstraint implements OnnxTypeConstraint {
27361 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
27362 ;
27363
27364 final OnnxType.TypeVariable typeVariable;
27365
27366 TypeConstraint(OnnxType.TypeVariable typeVariable) {
27367 assert typeVariable.name().equals(name());
27368 this.typeVariable = typeVariable;
27369 }
27370
27371 @Override
27372 public OnnxType.TypeVariable typeVariable() {
27373 return typeVariable;
27374 }
27375 }
27376
27377 public enum InputParameter implements OnnxParameter {
27378 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27379 ;
27380
27381 final OnnxType type;
27382 final Quantifier quantifier;
27383
27384 InputParameter(OnnxType type, Quantifier quantifier) {
27385 this.type = type;
27386 this.quantifier = quantifier;
27387 }
27388
27389 @Override
27390 public OnnxType type() {
27391 return type;
27392 }
27393
27394 @Override
27395 public Quantifier quantifier() {
27396 return quantifier;
27397 }
27398 }
27399
27400 public enum OutputParameter implements OnnxParameter {
27401 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27402 ;
27403
27404 final OnnxType type;
27405 final Quantifier quantifier;
27406
27407 OutputParameter(OnnxType type, Quantifier quantifier) {
27408 this.type = type;
27409 this.quantifier = quantifier;
27410 }
27411
27412 @Override
27413 public OnnxType type() {
27414 return type;
27415 }
27416
27417 @Override
27418 public Quantifier quantifier() {
27419 return quantifier;
27420 }
27421 }
27422
27423 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
27424 NAME,
27425 List.of(Attribute.values()),
27426 List.of(TypeConstraint.values()),
27427 List.of(InputParameter.values()),
27428 List.of(OutputParameter.values())
27429 );
27430
27431 public Softsign(ExternalizedOp def) {
27432 super(SCHEMA, def);
27433 }
27434
27435 Softsign(Softsign that, CodeContext cc) {
27436 super(that, cc);
27437 }
27438
27439 @Override
27440 public Softsign transform(CodeContext cc, CodeTransformer ot) {
27441 return new Softsign(this, cc);
27442 }
27443
27444 Softsign(TypeElement resultType, Value input) {
27445 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
27446 }
27447
27448 @Override
27449 public SequencedSet<OnnxParameter> onnxOutputs() {
27450 return onnxOutputs(SCHEMA);
27451 }
27452
27453 @Override
27454 public SequencedMap<OnnxParameter, Object> onnxInputs() {
27455 return onnxInputs(SCHEMA, List.of(input()));
27456 }
27457
27458 public Value input() {
27459 return operands().get(0);
27460 }
27461
27462 }
27463
27464 public static Softsign Softsign(TypeElement resultType, Value input) {
27465 return new Softsign(resultType, input);
27466 }
27467
27468 @OpFactoryHelper.OpDeclaration(SpaceToDepth.NAME)
27469 public static final class SpaceToDepth extends OnnxOp {
27470 public static final String NAME = "SpaceToDepth";
27471
27472 public enum Attribute implements OnnxAttribute {
27473 blocksize(Long.class, false, null),
27474 ;
27475
27476 final Class<?> t;
27477 final boolean optional;
27478 final Object defaultValue;
27479
27480 Attribute(Class<?> type, boolean optional, Object defaultValue) {
27481 this.t = type;
27482 this.optional = optional;
27483 this.defaultValue = defaultValue;
27484 assert optional || defaultValue == null;
27485 }
27486
27487 public Class<?> type() {
27488 return t;
27489 }
27490
27491 public boolean isOptional() {
27492 return optional;
27493 }
27494
27495 public Object defaultValue() {
27496 return defaultValue;
27497 }
27498 }
27499
27500 public enum TypeConstraint implements OnnxTypeConstraint {
27501 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
27502 ;
27503
27504 final OnnxType.TypeVariable typeVariable;
27505
27506 TypeConstraint(OnnxType.TypeVariable typeVariable) {
27507 assert typeVariable.name().equals(name());
27508 this.typeVariable = typeVariable;
27509 }
27510
27511 @Override
27512 public OnnxType.TypeVariable typeVariable() {
27513 return typeVariable;
27514 }
27515 }
27516
27517 public enum InputParameter implements OnnxParameter {
27518 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27519 ;
27520
27521 final OnnxType type;
27522 final Quantifier quantifier;
27523
27524 InputParameter(OnnxType type, Quantifier quantifier) {
27525 this.type = type;
27526 this.quantifier = quantifier;
27527 }
27528
27529 @Override
27530 public OnnxType type() {
27531 return type;
27532 }
27533
27534 @Override
27535 public Quantifier quantifier() {
27536 return quantifier;
27537 }
27538 }
27539
27540 public enum OutputParameter implements OnnxParameter {
27541 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27542 ;
27543
27544 final OnnxType type;
27545 final Quantifier quantifier;
27546
27547 OutputParameter(OnnxType type, Quantifier quantifier) {
27548 this.type = type;
27549 this.quantifier = quantifier;
27550 }
27551
27552 @Override
27553 public OnnxType type() {
27554 return type;
27555 }
27556
27557 @Override
27558 public Quantifier quantifier() {
27559 return quantifier;
27560 }
27561 }
27562
27563 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
27564 NAME,
27565 List.of(Attribute.values()),
27566 List.of(TypeConstraint.values()),
27567 List.of(InputParameter.values()),
27568 List.of(OutputParameter.values())
27569 );
27570
27571 public SpaceToDepth(ExternalizedOp def) {
27572 super(SCHEMA, def);
27573 }
27574
27575 SpaceToDepth(SpaceToDepth that, CodeContext cc) {
27576 super(that, cc);
27577 }
27578
27579 @Override
27580 public SpaceToDepth transform(CodeContext cc, CodeTransformer ot) {
27581 return new SpaceToDepth(this, cc);
27582 }
27583
27584 SpaceToDepth(TypeElement resultType, Value input, long blocksize) {
27585 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(blocksize));
27586 }
27587
27588 @Override
27589 public SequencedSet<OnnxParameter> onnxOutputs() {
27590 return onnxOutputs(SCHEMA);
27591 }
27592
27593 @Override
27594 public SequencedMap<OnnxParameter, Object> onnxInputs() {
27595 return onnxInputs(SCHEMA, List.of(input()));
27596 }
27597
27598 public Value input() {
27599 return operands().get(0);
27600 }
27601
27602 public long blocksize() {
27603 long blocksize = Attribute.blocksize.access(Long.class, onnxAttributes);
27604 return blocksize;
27605 }
27606
27607 }
27608
27609 public static SpaceToDepth SpaceToDepth(TypeElement resultType, Value input, long blocksize) {
27610 return new SpaceToDepth(resultType, input, blocksize);
27611 }
27612
27613 @OpFactoryHelper.OpDeclaration(Split.NAME)
27614 public static final class Split extends OnnxOp {
27615 public static final String NAME = "Split";
27616
27617 public enum Attribute implements OnnxAttribute {
27618 num_outputs(Long.class, true, null),
27619 axis(Long.class, true, 0),
27620 ;
27621
27622 final Class<?> t;
27623 final boolean optional;
27624 final Object defaultValue;
27625
27626 Attribute(Class<?> type, boolean optional, Object defaultValue) {
27627 this.t = type;
27628 this.optional = optional;
27629 this.defaultValue = defaultValue;
27630 assert optional || defaultValue == null;
27631 }
27632
27633 public Class<?> type() {
27634 return t;
27635 }
27636
27637 public boolean isOptional() {
27638 return optional;
27639 }
27640
27641 public Object defaultValue() {
27642 return defaultValue;
27643 }
27644 }
27645
27646 public enum TypeConstraint implements OnnxTypeConstraint {
27647 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
27648 ;
27649
27650 final OnnxType.TypeVariable typeVariable;
27651
27652 TypeConstraint(OnnxType.TypeVariable typeVariable) {
27653 assert typeVariable.name().equals(name());
27654 this.typeVariable = typeVariable;
27655 }
27656
27657 @Override
27658 public OnnxType.TypeVariable typeVariable() {
27659 return typeVariable;
27660 }
27661 }
27662
27663 public enum InputParameter implements OnnxParameter {
27664 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27665 split(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
27666 ;
27667
27668 final OnnxType type;
27669 final Quantifier quantifier;
27670
27671 InputParameter(OnnxType type, Quantifier quantifier) {
27672 this.type = type;
27673 this.quantifier = quantifier;
27674 }
27675
27676 @Override
27677 public OnnxType type() {
27678 return type;
27679 }
27680
27681 @Override
27682 public Quantifier quantifier() {
27683 return quantifier;
27684 }
27685 }
27686
27687 public enum OutputParameter implements OnnxParameter {
27688 outputs(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC),
27689 ;
27690
27691 final OnnxType type;
27692 final Quantifier quantifier;
27693
27694 OutputParameter(OnnxType type, Quantifier quantifier) {
27695 this.type = type;
27696 this.quantifier = quantifier;
27697 }
27698
27699 @Override
27700 public OnnxType type() {
27701 return type;
27702 }
27703
27704 @Override
27705 public Quantifier quantifier() {
27706 return quantifier;
27707 }
27708 }
27709
27710 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
27711 NAME,
27712 List.of(Attribute.values()),
27713 List.of(TypeConstraint.values()),
27714 List.of(InputParameter.values()),
27715 List.of(OutputParameter.values())
27716 );
27717
27718 public Split(ExternalizedOp def) {
27719 super(SCHEMA, def);
27720 }
27721
27722 Split(Split that, CodeContext cc) {
27723 super(that, cc);
27724 }
27725
27726 @Override
27727 public Split transform(CodeContext cc, CodeTransformer ot) {
27728 return new Split(this, cc);
27729 }
27730
27731 Split(TypeElement resultType, Value input, java.util.Optional<Value> split, java.util.Optional<Long> num_outputs, java.util.Optional<Long> axis) {
27732 super(SCHEMA, resultType, Set.of(), List.of(input, split), List.of(num_outputs, axis));
27733 }
27734
27735 @Override
27736 public SequencedSet<OnnxParameter> onnxOutputs() {
27737 return onnxOutputs(SCHEMA);
27738 }
27739
27740 @Override
27741 public SequencedMap<OnnxParameter, Object> onnxInputs() {
27742 return onnxInputs(SCHEMA, List.of(input(), split()));
27743 }
27744
27745 public Value input() {
27746 return operands().get(0);
27747 }
27748
27749 public java.util.Optional<Value> split() {
27750 int i = optionalInputArguments.indexOf(InputParameter.split);
27751 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
27752 }
27753
27754 public java.util.Optional<Long> num_outputs() {
27755 Long num_outputs = Attribute.num_outputs.access(Long.class, onnxAttributes);
27756 return java.util.Optional.ofNullable(num_outputs);
27757 }
27758
27759 public java.util.Optional<Long> axis() {
27760 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
27761 return java.util.Optional.ofNullable(axis);
27762 }
27763
27764 }
27765
27766 public static Split Split(TypeElement resultType, Value input, java.util.Optional<Value> split, java.util.Optional<Long> num_outputs, java.util.Optional<Long> axis) {
27767 return new Split(resultType, input, split, num_outputs, axis);
27768 }
27769
27770 @OpFactoryHelper.OpDeclaration(SplitToSequence.NAME)
27771 public static final class SplitToSequence extends OnnxOp {
27772 public static final String NAME = "SplitToSequence";
27773
27774 public enum Attribute implements OnnxAttribute {
27775 keepdims(Long.class, true, 1),
27776 axis(Long.class, true, 0),
27777 ;
27778
27779 final Class<?> t;
27780 final boolean optional;
27781 final Object defaultValue;
27782
27783 Attribute(Class<?> type, boolean optional, Object defaultValue) {
27784 this.t = type;
27785 this.optional = optional;
27786 this.defaultValue = defaultValue;
27787 assert optional || defaultValue == null;
27788 }
27789
27790 public Class<?> type() {
27791 return t;
27792 }
27793
27794 public boolean isOptional() {
27795 return optional;
27796 }
27797
27798 public Object defaultValue() {
27799 return defaultValue;
27800 }
27801 }
27802
27803 public enum TypeConstraint implements OnnxTypeConstraint {
27804 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
27805 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
27806 S(new OnnxType.TypeVariable("S", List.of(OnnxType.seq(OnnxType.tensor(OnnxType.uint8())), OnnxType.seq(OnnxType.tensor(OnnxType.uint16())), OnnxType.seq(OnnxType.tensor(OnnxType.uint32())), OnnxType.seq(OnnxType.tensor(OnnxType.uint64())), OnnxType.seq(OnnxType.tensor(OnnxType.int8())), OnnxType.seq(OnnxType.tensor(OnnxType.int16())), OnnxType.seq(OnnxType.tensor(OnnxType.int32())), OnnxType.seq(OnnxType.tensor(OnnxType.int64())), OnnxType.seq(OnnxType.tensor(OnnxType.bfloat16())), OnnxType.seq(OnnxType.tensor(OnnxType.float16())), OnnxType.seq(OnnxType.tensor(OnnxType.float32())), OnnxType.seq(OnnxType.tensor(OnnxType.float64())), OnnxType.seq(OnnxType.tensor(OnnxType.string())), OnnxType.seq(OnnxType.tensor(OnnxType.bool())), OnnxType.seq(OnnxType.tensor(OnnxType.complex64())), OnnxType.seq(OnnxType.tensor(OnnxType.complex128()))))),
27807 ;
27808
27809 final OnnxType.TypeVariable typeVariable;
27810
27811 TypeConstraint(OnnxType.TypeVariable typeVariable) {
27812 assert typeVariable.name().equals(name());
27813 this.typeVariable = typeVariable;
27814 }
27815
27816 @Override
27817 public OnnxType.TypeVariable typeVariable() {
27818 return typeVariable;
27819 }
27820 }
27821
27822 public enum InputParameter implements OnnxParameter {
27823 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27824 split(TypeConstraint.I.typeVariable(), Quantifier.OPTIONAL),
27825 ;
27826
27827 final OnnxType type;
27828 final Quantifier quantifier;
27829
27830 InputParameter(OnnxType type, Quantifier quantifier) {
27831 this.type = type;
27832 this.quantifier = quantifier;
27833 }
27834
27835 @Override
27836 public OnnxType type() {
27837 return type;
27838 }
27839
27840 @Override
27841 public Quantifier quantifier() {
27842 return quantifier;
27843 }
27844 }
27845
27846 public enum OutputParameter implements OnnxParameter {
27847 output_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED),
27848 ;
27849
27850 final OnnxType type;
27851 final Quantifier quantifier;
27852
27853 OutputParameter(OnnxType type, Quantifier quantifier) {
27854 this.type = type;
27855 this.quantifier = quantifier;
27856 }
27857
27858 @Override
27859 public OnnxType type() {
27860 return type;
27861 }
27862
27863 @Override
27864 public Quantifier quantifier() {
27865 return quantifier;
27866 }
27867 }
27868
27869 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
27870 NAME,
27871 List.of(Attribute.values()),
27872 List.of(TypeConstraint.values()),
27873 List.of(InputParameter.values()),
27874 List.of(OutputParameter.values())
27875 );
27876
27877 public SplitToSequence(ExternalizedOp def) {
27878 super(SCHEMA, def);
27879 }
27880
27881 SplitToSequence(SplitToSequence that, CodeContext cc) {
27882 super(that, cc);
27883 }
27884
27885 @Override
27886 public SplitToSequence transform(CodeContext cc, CodeTransformer ot) {
27887 return new SplitToSequence(this, cc);
27888 }
27889
27890 SplitToSequence(TypeElement resultType, Value input, java.util.Optional<Value> split, java.util.Optional<Long> keepdims, java.util.Optional<Long> axis) {
27891 super(SCHEMA, resultType, Set.of(), List.of(input, split), List.of(keepdims, axis));
27892 }
27893
27894 @Override
27895 public SequencedSet<OnnxParameter> onnxOutputs() {
27896 return onnxOutputs(SCHEMA);
27897 }
27898
27899 @Override
27900 public SequencedMap<OnnxParameter, Object> onnxInputs() {
27901 return onnxInputs(SCHEMA, List.of(input(), split()));
27902 }
27903
27904 public Value input() {
27905 return operands().get(0);
27906 }
27907
27908 public java.util.Optional<Value> split() {
27909 int i = optionalInputArguments.indexOf(InputParameter.split);
27910 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
27911 }
27912
27913 public java.util.Optional<Long> keepdims() {
27914 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes);
27915 return java.util.Optional.ofNullable(keepdims);
27916 }
27917
27918 public java.util.Optional<Long> axis() {
27919 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
27920 return java.util.Optional.ofNullable(axis);
27921 }
27922
27923 }
27924
27925 public static SplitToSequence SplitToSequence(TypeElement resultType, Value input, java.util.Optional<Value> split, java.util.Optional<Long> keepdims, java.util.Optional<Long> axis) {
27926 return new SplitToSequence(resultType, input, split, keepdims, axis);
27927 }
27928
27929 @OpFactoryHelper.OpDeclaration(Sqrt.NAME)
27930 public static final class Sqrt extends OnnxOp {
27931 public static final String NAME = "Sqrt";
27932
27933 public enum Attribute implements OnnxAttribute.None { }
27934
27935 public enum TypeConstraint implements OnnxTypeConstraint {
27936 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
27937 ;
27938
27939 final OnnxType.TypeVariable typeVariable;
27940
27941 TypeConstraint(OnnxType.TypeVariable typeVariable) {
27942 assert typeVariable.name().equals(name());
27943 this.typeVariable = typeVariable;
27944 }
27945
27946 @Override
27947 public OnnxType.TypeVariable typeVariable() {
27948 return typeVariable;
27949 }
27950 }
27951
27952 public enum InputParameter implements OnnxParameter {
27953 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27954 ;
27955
27956 final OnnxType type;
27957 final Quantifier quantifier;
27958
27959 InputParameter(OnnxType type, Quantifier quantifier) {
27960 this.type = type;
27961 this.quantifier = quantifier;
27962 }
27963
27964 @Override
27965 public OnnxType type() {
27966 return type;
27967 }
27968
27969 @Override
27970 public Quantifier quantifier() {
27971 return quantifier;
27972 }
27973 }
27974
27975 public enum OutputParameter implements OnnxParameter {
27976 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
27977 ;
27978
27979 final OnnxType type;
27980 final Quantifier quantifier;
27981
27982 OutputParameter(OnnxType type, Quantifier quantifier) {
27983 this.type = type;
27984 this.quantifier = quantifier;
27985 }
27986
27987 @Override
27988 public OnnxType type() {
27989 return type;
27990 }
27991
27992 @Override
27993 public Quantifier quantifier() {
27994 return quantifier;
27995 }
27996 }
27997
27998 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
27999 NAME,
28000 List.of(Attribute.values()),
28001 List.of(TypeConstraint.values()),
28002 List.of(InputParameter.values()),
28003 List.of(OutputParameter.values())
28004 );
28005
28006 public Sqrt(ExternalizedOp def) {
28007 super(SCHEMA, def);
28008 }
28009
28010 Sqrt(Sqrt that, CodeContext cc) {
28011 super(that, cc);
28012 }
28013
28014 @Override
28015 public Sqrt transform(CodeContext cc, CodeTransformer ot) {
28016 return new Sqrt(this, cc);
28017 }
28018
28019 Sqrt(TypeElement resultType, Value X) {
28020 super(SCHEMA, resultType, Set.of(), List.of(X), List.of());
28021 }
28022
28023 @Override
28024 public SequencedSet<OnnxParameter> onnxOutputs() {
28025 return onnxOutputs(SCHEMA);
28026 }
28027
28028 @Override
28029 public SequencedMap<OnnxParameter, Object> onnxInputs() {
28030 return onnxInputs(SCHEMA, List.of(X()));
28031 }
28032
28033 public Value X() {
28034 return operands().get(0);
28035 }
28036
28037 }
28038
28039 public static Sqrt Sqrt(TypeElement resultType, Value X) {
28040 return new Sqrt(resultType, X);
28041 }
28042
28043 @OpFactoryHelper.OpDeclaration(Squeeze.NAME)
28044 public static final class Squeeze extends OnnxOp {
28045 public static final String NAME = "Squeeze";
28046
28047 public enum Attribute implements OnnxAttribute.None { }
28048
28049 public enum TypeConstraint implements OnnxTypeConstraint {
28050 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
28051 ;
28052
28053 final OnnxType.TypeVariable typeVariable;
28054
28055 TypeConstraint(OnnxType.TypeVariable typeVariable) {
28056 assert typeVariable.name().equals(name());
28057 this.typeVariable = typeVariable;
28058 }
28059
28060 @Override
28061 public OnnxType.TypeVariable typeVariable() {
28062 return typeVariable;
28063 }
28064 }
28065
28066 public enum InputParameter implements OnnxParameter {
28067 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28068 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
28069 ;
28070
28071 final OnnxType type;
28072 final Quantifier quantifier;
28073
28074 InputParameter(OnnxType type, Quantifier quantifier) {
28075 this.type = type;
28076 this.quantifier = quantifier;
28077 }
28078
28079 @Override
28080 public OnnxType type() {
28081 return type;
28082 }
28083
28084 @Override
28085 public Quantifier quantifier() {
28086 return quantifier;
28087 }
28088 }
28089
28090 public enum OutputParameter implements OnnxParameter {
28091 squeezed(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28092 ;
28093
28094 final OnnxType type;
28095 final Quantifier quantifier;
28096
28097 OutputParameter(OnnxType type, Quantifier quantifier) {
28098 this.type = type;
28099 this.quantifier = quantifier;
28100 }
28101
28102 @Override
28103 public OnnxType type() {
28104 return type;
28105 }
28106
28107 @Override
28108 public Quantifier quantifier() {
28109 return quantifier;
28110 }
28111 }
28112
28113 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
28114 NAME,
28115 List.of(Attribute.values()),
28116 List.of(TypeConstraint.values()),
28117 List.of(InputParameter.values()),
28118 List.of(OutputParameter.values())
28119 );
28120
28121 public Squeeze(ExternalizedOp def) {
28122 super(SCHEMA, def);
28123 }
28124
28125 Squeeze(Squeeze that, CodeContext cc) {
28126 super(that, cc);
28127 }
28128
28129 @Override
28130 public Squeeze transform(CodeContext cc, CodeTransformer ot) {
28131 return new Squeeze(this, cc);
28132 }
28133
28134 Squeeze(TypeElement resultType, Value data, java.util.Optional<Value> axes) {
28135 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of());
28136 }
28137
28138 @Override
28139 public SequencedSet<OnnxParameter> onnxOutputs() {
28140 return onnxOutputs(SCHEMA);
28141 }
28142
28143 @Override
28144 public SequencedMap<OnnxParameter, Object> onnxInputs() {
28145 return onnxInputs(SCHEMA, List.of(data(), axes()));
28146 }
28147
28148 public Value data() {
28149 return operands().get(0);
28150 }
28151
28152 public java.util.Optional<Value> axes() {
28153 int i = optionalInputArguments.indexOf(InputParameter.axes);
28154 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
28155 }
28156
28157 }
28158
28159 public static Squeeze Squeeze(TypeElement resultType, Value data, java.util.Optional<Value> axes) {
28160 return new Squeeze(resultType, data, axes);
28161 }
28162
28163 @OpFactoryHelper.OpDeclaration(StringConcat.NAME)
28164 public static final class StringConcat extends OnnxOp {
28165 public static final String NAME = "StringConcat";
28166
28167 public enum Attribute implements OnnxAttribute.None { }
28168
28169 public enum TypeConstraint implements OnnxTypeConstraint {
28170 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.string())))),
28171 ;
28172
28173 final OnnxType.TypeVariable typeVariable;
28174
28175 TypeConstraint(OnnxType.TypeVariable typeVariable) {
28176 assert typeVariable.name().equals(name());
28177 this.typeVariable = typeVariable;
28178 }
28179
28180 @Override
28181 public OnnxType.TypeVariable typeVariable() {
28182 return typeVariable;
28183 }
28184 }
28185
28186 public enum InputParameter implements OnnxParameter {
28187 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28188 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28189 ;
28190
28191 final OnnxType type;
28192 final Quantifier quantifier;
28193
28194 InputParameter(OnnxType type, Quantifier quantifier) {
28195 this.type = type;
28196 this.quantifier = quantifier;
28197 }
28198
28199 @Override
28200 public OnnxType type() {
28201 return type;
28202 }
28203
28204 @Override
28205 public Quantifier quantifier() {
28206 return quantifier;
28207 }
28208 }
28209
28210 public enum OutputParameter implements OnnxParameter {
28211 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28212 ;
28213
28214 final OnnxType type;
28215 final Quantifier quantifier;
28216
28217 OutputParameter(OnnxType type, Quantifier quantifier) {
28218 this.type = type;
28219 this.quantifier = quantifier;
28220 }
28221
28222 @Override
28223 public OnnxType type() {
28224 return type;
28225 }
28226
28227 @Override
28228 public Quantifier quantifier() {
28229 return quantifier;
28230 }
28231 }
28232
28233 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
28234 NAME,
28235 List.of(Attribute.values()),
28236 List.of(TypeConstraint.values()),
28237 List.of(InputParameter.values()),
28238 List.of(OutputParameter.values())
28239 );
28240
28241 public StringConcat(ExternalizedOp def) {
28242 super(SCHEMA, def);
28243 }
28244
28245 StringConcat(StringConcat that, CodeContext cc) {
28246 super(that, cc);
28247 }
28248
28249 @Override
28250 public StringConcat transform(CodeContext cc, CodeTransformer ot) {
28251 return new StringConcat(this, cc);
28252 }
28253
28254 StringConcat(TypeElement resultType, Value X, Value Y) {
28255 super(SCHEMA, resultType, Set.of(), List.of(X, Y), List.of());
28256 }
28257
28258 @Override
28259 public SequencedSet<OnnxParameter> onnxOutputs() {
28260 return onnxOutputs(SCHEMA);
28261 }
28262
28263 @Override
28264 public SequencedMap<OnnxParameter, Object> onnxInputs() {
28265 return onnxInputs(SCHEMA, List.of(X(), Y()));
28266 }
28267
28268 public Value X() {
28269 return operands().get(0);
28270 }
28271
28272 public Value Y() {
28273 return operands().get(1);
28274 }
28275
28276 }
28277
28278 public static StringConcat StringConcat(TypeElement resultType, Value X, Value Y) {
28279 return new StringConcat(resultType, X, Y);
28280 }
28281
28282 @OpFactoryHelper.OpDeclaration(StringNormalizer.NAME)
28283 public static final class StringNormalizer extends OnnxOp {
28284 public static final String NAME = "StringNormalizer";
28285
28286 public enum Attribute implements OnnxAttribute {
28287 is_case_sensitive(Long.class, true, 0),
28288 locale(String.class, true, null),
28289 stopwords(String[].class, true, null),
28290 case_change_action(String.class, true, "NONE"),
28291 ;
28292
28293 final Class<?> t;
28294 final boolean optional;
28295 final Object defaultValue;
28296
28297 Attribute(Class<?> type, boolean optional, Object defaultValue) {
28298 this.t = type;
28299 this.optional = optional;
28300 this.defaultValue = defaultValue;
28301 assert optional || defaultValue == null;
28302 }
28303
28304 public Class<?> type() {
28305 return t;
28306 }
28307
28308 public boolean isOptional() {
28309 return optional;
28310 }
28311
28312 public Object defaultValue() {
28313 return defaultValue;
28314 }
28315 }
28316
28317 public enum TypeConstraint implements OnnxTypeConstraint.None { }
28318
28319 public enum InputParameter implements OnnxParameter {
28320 X(OnnxType.tensor(OnnxType.string()), Quantifier.REQUIRED),
28321 ;
28322
28323 final OnnxType type;
28324 final Quantifier quantifier;
28325
28326 InputParameter(OnnxType type, Quantifier quantifier) {
28327 this.type = type;
28328 this.quantifier = quantifier;
28329 }
28330
28331 @Override
28332 public OnnxType type() {
28333 return type;
28334 }
28335
28336 @Override
28337 public Quantifier quantifier() {
28338 return quantifier;
28339 }
28340 }
28341
28342 public enum OutputParameter implements OnnxParameter {
28343 Y(OnnxType.tensor(OnnxType.string()), Quantifier.REQUIRED),
28344 ;
28345
28346 final OnnxType type;
28347 final Quantifier quantifier;
28348
28349 OutputParameter(OnnxType type, Quantifier quantifier) {
28350 this.type = type;
28351 this.quantifier = quantifier;
28352 }
28353
28354 @Override
28355 public OnnxType type() {
28356 return type;
28357 }
28358
28359 @Override
28360 public Quantifier quantifier() {
28361 return quantifier;
28362 }
28363 }
28364
28365 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
28366 NAME,
28367 List.of(Attribute.values()),
28368 List.of(TypeConstraint.values()),
28369 List.of(InputParameter.values()),
28370 List.of(OutputParameter.values())
28371 );
28372
28373 public StringNormalizer(ExternalizedOp def) {
28374 super(SCHEMA, def);
28375 }
28376
28377 StringNormalizer(StringNormalizer that, CodeContext cc) {
28378 super(that, cc);
28379 }
28380
28381 @Override
28382 public StringNormalizer transform(CodeContext cc, CodeTransformer ot) {
28383 return new StringNormalizer(this, cc);
28384 }
28385
28386 StringNormalizer(TypeElement resultType, Value X, java.util.Optional<Long> is_case_sensitive, java.util.Optional<String> locale, java.util.Optional<String[]> stopwords, java.util.Optional<String> case_change_action) {
28387 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(is_case_sensitive, locale, stopwords, case_change_action));
28388 }
28389
28390 @Override
28391 public SequencedSet<OnnxParameter> onnxOutputs() {
28392 return onnxOutputs(SCHEMA);
28393 }
28394
28395 @Override
28396 public SequencedMap<OnnxParameter, Object> onnxInputs() {
28397 return onnxInputs(SCHEMA, List.of(X()));
28398 }
28399
28400 public Value X() {
28401 return operands().get(0);
28402 }
28403
28404 public java.util.Optional<Long> is_case_sensitive() {
28405 Long is_case_sensitive = Attribute.is_case_sensitive.access(Long.class, onnxAttributes);
28406 return java.util.Optional.ofNullable(is_case_sensitive);
28407 }
28408
28409 public java.util.Optional<String> locale() {
28410 String locale = Attribute.locale.access(String.class, onnxAttributes);
28411 return java.util.Optional.ofNullable(locale);
28412 }
28413
28414 public java.util.Optional<String[]> stopwords() {
28415 String[] stopwords = Attribute.stopwords.access(String[].class, onnxAttributes);
28416 return java.util.Optional.ofNullable(stopwords).map(String[]::clone);
28417 }
28418
28419 public java.util.Optional<String> case_change_action() {
28420 String case_change_action = Attribute.case_change_action.access(String.class, onnxAttributes);
28421 return java.util.Optional.ofNullable(case_change_action);
28422 }
28423
28424 }
28425
28426 public static StringNormalizer StringNormalizer(TypeElement resultType, Value X, java.util.Optional<Long> is_case_sensitive, java.util.Optional<String> locale, java.util.Optional<String[]> stopwords, java.util.Optional<String> case_change_action) {
28427 return new StringNormalizer(resultType, X, is_case_sensitive, locale, stopwords, case_change_action);
28428 }
28429
28430 @OpFactoryHelper.OpDeclaration(StringSplit.NAME)
28431 public static final class StringSplit extends OnnxOp {
28432 public static final String NAME = "StringSplit";
28433
28434 public enum Attribute implements OnnxAttribute {
28435 delimiter(String.class, true, null),
28436 maxsplit(Long.class, true, null),
28437 ;
28438
28439 final Class<?> t;
28440 final boolean optional;
28441 final Object defaultValue;
28442
28443 Attribute(Class<?> type, boolean optional, Object defaultValue) {
28444 this.t = type;
28445 this.optional = optional;
28446 this.defaultValue = defaultValue;
28447 assert optional || defaultValue == null;
28448 }
28449
28450 public Class<?> type() {
28451 return t;
28452 }
28453
28454 public boolean isOptional() {
28455 return optional;
28456 }
28457
28458 public Object defaultValue() {
28459 return defaultValue;
28460 }
28461 }
28462
28463 public enum TypeConstraint implements OnnxTypeConstraint {
28464 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.string())))),
28465 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string())))),
28466 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int64())))),
28467 ;
28468
28469 final OnnxType.TypeVariable typeVariable;
28470
28471 TypeConstraint(OnnxType.TypeVariable typeVariable) {
28472 assert typeVariable.name().equals(name());
28473 this.typeVariable = typeVariable;
28474 }
28475
28476 @Override
28477 public OnnxType.TypeVariable typeVariable() {
28478 return typeVariable;
28479 }
28480 }
28481
28482 public enum InputParameter implements OnnxParameter {
28483 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
28484 ;
28485
28486 final OnnxType type;
28487 final Quantifier quantifier;
28488
28489 InputParameter(OnnxType type, Quantifier quantifier) {
28490 this.type = type;
28491 this.quantifier = quantifier;
28492 }
28493
28494 @Override
28495 public OnnxType type() {
28496 return type;
28497 }
28498
28499 @Override
28500 public Quantifier quantifier() {
28501 return quantifier;
28502 }
28503 }
28504
28505 public enum OutputParameter implements OnnxParameter {
28506 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
28507 Z(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED),
28508 ;
28509
28510 final OnnxType type;
28511 final Quantifier quantifier;
28512
28513 OutputParameter(OnnxType type, Quantifier quantifier) {
28514 this.type = type;
28515 this.quantifier = quantifier;
28516 }
28517
28518 @Override
28519 public OnnxType type() {
28520 return type;
28521 }
28522
28523 @Override
28524 public Quantifier quantifier() {
28525 return quantifier;
28526 }
28527 }
28528
28529 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
28530 NAME,
28531 List.of(Attribute.values()),
28532 List.of(TypeConstraint.values()),
28533 List.of(InputParameter.values()),
28534 List.of(OutputParameter.values())
28535 );
28536
28537 public StringSplit(ExternalizedOp def) {
28538 super(SCHEMA, def);
28539 }
28540
28541 StringSplit(StringSplit that, CodeContext cc) {
28542 super(that, cc);
28543 }
28544
28545 @Override
28546 public StringSplit transform(CodeContext cc, CodeTransformer ot) {
28547 return new StringSplit(this, cc);
28548 }
28549
28550 StringSplit(TypeElement resultType, Value X, java.util.Optional<String> delimiter, java.util.Optional<Long> maxsplit) {
28551 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(delimiter, maxsplit));
28552 }
28553
28554 @Override
28555 public SequencedSet<OnnxParameter> onnxOutputs() {
28556 return onnxOutputs(SCHEMA);
28557 }
28558
28559 @Override
28560 public SequencedMap<OnnxParameter, Object> onnxInputs() {
28561 return onnxInputs(SCHEMA, List.of(X()));
28562 }
28563
28564 public Value X() {
28565 return operands().get(0);
28566 }
28567
28568 public java.util.Optional<String> delimiter() {
28569 String delimiter = Attribute.delimiter.access(String.class, onnxAttributes);
28570 return java.util.Optional.ofNullable(delimiter);
28571 }
28572
28573 public java.util.Optional<Long> maxsplit() {
28574 Long maxsplit = Attribute.maxsplit.access(Long.class, onnxAttributes);
28575 return java.util.Optional.ofNullable(maxsplit);
28576 }
28577
28578 }
28579
28580 public static StringSplit StringSplit(TypeElement resultType, Value X, java.util.Optional<String> delimiter, java.util.Optional<Long> maxsplit) {
28581 return new StringSplit(resultType, X, delimiter, maxsplit);
28582 }
28583
28584 @OpFactoryHelper.OpDeclaration(Sub.NAME)
28585 public static final class Sub extends OnnxOp {
28586 public static final String NAME = "Sub";
28587
28588 public enum Attribute implements OnnxAttribute.None { }
28589
28590 public enum TypeConstraint implements OnnxTypeConstraint {
28591 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
28592 ;
28593
28594 final OnnxType.TypeVariable typeVariable;
28595
28596 TypeConstraint(OnnxType.TypeVariable typeVariable) {
28597 assert typeVariable.name().equals(name());
28598 this.typeVariable = typeVariable;
28599 }
28600
28601 @Override
28602 public OnnxType.TypeVariable typeVariable() {
28603 return typeVariable;
28604 }
28605 }
28606
28607 public enum InputParameter implements OnnxParameter {
28608 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28609 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28610 ;
28611
28612 final OnnxType type;
28613 final Quantifier quantifier;
28614
28615 InputParameter(OnnxType type, Quantifier quantifier) {
28616 this.type = type;
28617 this.quantifier = quantifier;
28618 }
28619
28620 @Override
28621 public OnnxType type() {
28622 return type;
28623 }
28624
28625 @Override
28626 public Quantifier quantifier() {
28627 return quantifier;
28628 }
28629 }
28630
28631 public enum OutputParameter implements OnnxParameter {
28632 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28633 ;
28634
28635 final OnnxType type;
28636 final Quantifier quantifier;
28637
28638 OutputParameter(OnnxType type, Quantifier quantifier) {
28639 this.type = type;
28640 this.quantifier = quantifier;
28641 }
28642
28643 @Override
28644 public OnnxType type() {
28645 return type;
28646 }
28647
28648 @Override
28649 public Quantifier quantifier() {
28650 return quantifier;
28651 }
28652 }
28653
28654 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
28655 NAME,
28656 List.of(Attribute.values()),
28657 List.of(TypeConstraint.values()),
28658 List.of(InputParameter.values()),
28659 List.of(OutputParameter.values())
28660 );
28661
28662 public Sub(ExternalizedOp def) {
28663 super(SCHEMA, def);
28664 }
28665
28666 Sub(Sub that, CodeContext cc) {
28667 super(that, cc);
28668 }
28669
28670 @Override
28671 public Sub transform(CodeContext cc, CodeTransformer ot) {
28672 return new Sub(this, cc);
28673 }
28674
28675 Sub(TypeElement resultType, Value A, Value B) {
28676 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
28677 }
28678
28679 @Override
28680 public SequencedSet<OnnxParameter> onnxOutputs() {
28681 return onnxOutputs(SCHEMA);
28682 }
28683
28684 @Override
28685 public SequencedMap<OnnxParameter, Object> onnxInputs() {
28686 return onnxInputs(SCHEMA, List.of(A(), B()));
28687 }
28688
28689 public Value A() {
28690 return operands().get(0);
28691 }
28692
28693 public Value B() {
28694 return operands().get(1);
28695 }
28696
28697 }
28698
28699 public static Sub Sub(TypeElement resultType, Value A, Value B) {
28700 return new Sub(resultType, A, B);
28701 }
28702
28703 @OpFactoryHelper.OpDeclaration(Sum.NAME)
28704 public static final class Sum extends OnnxOp {
28705 public static final String NAME = "Sum";
28706
28707 public enum Attribute implements OnnxAttribute.None { }
28708
28709 public enum TypeConstraint implements OnnxTypeConstraint {
28710 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
28711 ;
28712
28713 final OnnxType.TypeVariable typeVariable;
28714
28715 TypeConstraint(OnnxType.TypeVariable typeVariable) {
28716 assert typeVariable.name().equals(name());
28717 this.typeVariable = typeVariable;
28718 }
28719
28720 @Override
28721 public OnnxType.TypeVariable typeVariable() {
28722 return typeVariable;
28723 }
28724 }
28725
28726 public enum InputParameter implements OnnxParameter {
28727 data_0(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC),
28728 ;
28729
28730 final OnnxType type;
28731 final Quantifier quantifier;
28732
28733 InputParameter(OnnxType type, Quantifier quantifier) {
28734 this.type = type;
28735 this.quantifier = quantifier;
28736 }
28737
28738 @Override
28739 public OnnxType type() {
28740 return type;
28741 }
28742
28743 @Override
28744 public Quantifier quantifier() {
28745 return quantifier;
28746 }
28747 }
28748
28749 public enum OutputParameter implements OnnxParameter {
28750 sum(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28751 ;
28752
28753 final OnnxType type;
28754 final Quantifier quantifier;
28755
28756 OutputParameter(OnnxType type, Quantifier quantifier) {
28757 this.type = type;
28758 this.quantifier = quantifier;
28759 }
28760
28761 @Override
28762 public OnnxType type() {
28763 return type;
28764 }
28765
28766 @Override
28767 public Quantifier quantifier() {
28768 return quantifier;
28769 }
28770 }
28771
28772 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
28773 NAME,
28774 List.of(Attribute.values()),
28775 List.of(TypeConstraint.values()),
28776 List.of(InputParameter.values()),
28777 List.of(OutputParameter.values())
28778 );
28779
28780 public Sum(ExternalizedOp def) {
28781 super(SCHEMA, def);
28782 }
28783
28784 Sum(Sum that, CodeContext cc) {
28785 super(that, cc);
28786 }
28787
28788 @Override
28789 public Sum transform(CodeContext cc, CodeTransformer ot) {
28790 return new Sum(this, cc);
28791 }
28792
28793 Sum(TypeElement resultType, List<Value> data_0) {
28794 super(SCHEMA, resultType, Set.of(), List.of(data_0), List.of());
28795 }
28796
28797 @Override
28798 public SequencedSet<OnnxParameter> onnxOutputs() {
28799 return onnxOutputs(SCHEMA);
28800 }
28801
28802 @Override
28803 public SequencedMap<OnnxParameter, Object> onnxInputs() {
28804 return onnxInputs(SCHEMA, List.of(data_0()));
28805 }
28806
28807 public List<Value> data_0() {
28808 return operands();
28809 }
28810
28811 }
28812
28813 public static Sum Sum(TypeElement resultType, List<Value> data_0) {
28814 return new Sum(resultType, data_0);
28815 }
28816
28817 @OpFactoryHelper.OpDeclaration(Swish.NAME)
28818 public static final class Swish extends OnnxOp {
28819 public static final String NAME = "Swish";
28820
28821 public enum Attribute implements OnnxAttribute {
28822 alpha(Float.class, true, 1.0f),
28823 ;
28824
28825 final Class<?> t;
28826 final boolean optional;
28827 final Object defaultValue;
28828
28829 Attribute(Class<?> type, boolean optional, Object defaultValue) {
28830 this.t = type;
28831 this.optional = optional;
28832 this.defaultValue = defaultValue;
28833 assert optional || defaultValue == null;
28834 }
28835
28836 public Class<?> type() {
28837 return t;
28838 }
28839
28840 public boolean isOptional() {
28841 return optional;
28842 }
28843
28844 public Object defaultValue() {
28845 return defaultValue;
28846 }
28847 }
28848
28849 public enum TypeConstraint implements OnnxTypeConstraint {
28850 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float64())))),
28851 ;
28852
28853 final OnnxType.TypeVariable typeVariable;
28854
28855 TypeConstraint(OnnxType.TypeVariable typeVariable) {
28856 assert typeVariable.name().equals(name());
28857 this.typeVariable = typeVariable;
28858 }
28859
28860 @Override
28861 public OnnxType.TypeVariable typeVariable() {
28862 return typeVariable;
28863 }
28864 }
28865
28866 public enum InputParameter implements OnnxParameter {
28867 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28868 ;
28869
28870 final OnnxType type;
28871 final Quantifier quantifier;
28872
28873 InputParameter(OnnxType type, Quantifier quantifier) {
28874 this.type = type;
28875 this.quantifier = quantifier;
28876 }
28877
28878 @Override
28879 public OnnxType type() {
28880 return type;
28881 }
28882
28883 @Override
28884 public Quantifier quantifier() {
28885 return quantifier;
28886 }
28887 }
28888
28889 public enum OutputParameter implements OnnxParameter {
28890 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28891 ;
28892
28893 final OnnxType type;
28894 final Quantifier quantifier;
28895
28896 OutputParameter(OnnxType type, Quantifier quantifier) {
28897 this.type = type;
28898 this.quantifier = quantifier;
28899 }
28900
28901 @Override
28902 public OnnxType type() {
28903 return type;
28904 }
28905
28906 @Override
28907 public Quantifier quantifier() {
28908 return quantifier;
28909 }
28910 }
28911
28912 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
28913 NAME,
28914 List.of(Attribute.values()),
28915 List.of(TypeConstraint.values()),
28916 List.of(InputParameter.values()),
28917 List.of(OutputParameter.values())
28918 );
28919
28920 public Swish(ExternalizedOp def) {
28921 super(SCHEMA, def);
28922 }
28923
28924 Swish(Swish that, CodeContext cc) {
28925 super(that, cc);
28926 }
28927
28928 @Override
28929 public Swish transform(CodeContext cc, CodeTransformer ot) {
28930 return new Swish(this, cc);
28931 }
28932
28933 Swish(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
28934 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha));
28935 }
28936
28937 @Override
28938 public SequencedSet<OnnxParameter> onnxOutputs() {
28939 return onnxOutputs(SCHEMA);
28940 }
28941
28942 @Override
28943 public SequencedMap<OnnxParameter, Object> onnxInputs() {
28944 return onnxInputs(SCHEMA, List.of(X()));
28945 }
28946
28947 public Value X() {
28948 return operands().get(0);
28949 }
28950
28951 public java.util.Optional<Float> alpha() {
28952 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
28953 return java.util.Optional.ofNullable(alpha);
28954 }
28955
28956 }
28957
28958 public static Swish Swish(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
28959 return new Swish(resultType, X, alpha);
28960 }
28961
28962 @OpFactoryHelper.OpDeclaration(Tan.NAME)
28963 public static final class Tan extends OnnxOp {
28964 public static final String NAME = "Tan";
28965
28966 public enum Attribute implements OnnxAttribute.None { }
28967
28968 public enum TypeConstraint implements OnnxTypeConstraint {
28969 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
28970 ;
28971
28972 final OnnxType.TypeVariable typeVariable;
28973
28974 TypeConstraint(OnnxType.TypeVariable typeVariable) {
28975 assert typeVariable.name().equals(name());
28976 this.typeVariable = typeVariable;
28977 }
28978
28979 @Override
28980 public OnnxType.TypeVariable typeVariable() {
28981 return typeVariable;
28982 }
28983 }
28984
28985 public enum InputParameter implements OnnxParameter {
28986 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
28987 ;
28988
28989 final OnnxType type;
28990 final Quantifier quantifier;
28991
28992 InputParameter(OnnxType type, Quantifier quantifier) {
28993 this.type = type;
28994 this.quantifier = quantifier;
28995 }
28996
28997 @Override
28998 public OnnxType type() {
28999 return type;
29000 }
29001
29002 @Override
29003 public Quantifier quantifier() {
29004 return quantifier;
29005 }
29006 }
29007
29008 public enum OutputParameter implements OnnxParameter {
29009 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29010 ;
29011
29012 final OnnxType type;
29013 final Quantifier quantifier;
29014
29015 OutputParameter(OnnxType type, Quantifier quantifier) {
29016 this.type = type;
29017 this.quantifier = quantifier;
29018 }
29019
29020 @Override
29021 public OnnxType type() {
29022 return type;
29023 }
29024
29025 @Override
29026 public Quantifier quantifier() {
29027 return quantifier;
29028 }
29029 }
29030
29031 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
29032 NAME,
29033 List.of(Attribute.values()),
29034 List.of(TypeConstraint.values()),
29035 List.of(InputParameter.values()),
29036 List.of(OutputParameter.values())
29037 );
29038
29039 public Tan(ExternalizedOp def) {
29040 super(SCHEMA, def);
29041 }
29042
29043 Tan(Tan that, CodeContext cc) {
29044 super(that, cc);
29045 }
29046
29047 @Override
29048 public Tan transform(CodeContext cc, CodeTransformer ot) {
29049 return new Tan(this, cc);
29050 }
29051
29052 Tan(TypeElement resultType, Value input) {
29053 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
29054 }
29055
29056 @Override
29057 public SequencedSet<OnnxParameter> onnxOutputs() {
29058 return onnxOutputs(SCHEMA);
29059 }
29060
29061 @Override
29062 public SequencedMap<OnnxParameter, Object> onnxInputs() {
29063 return onnxInputs(SCHEMA, List.of(input()));
29064 }
29065
29066 public Value input() {
29067 return operands().get(0);
29068 }
29069
29070 }
29071
29072 public static Tan Tan(TypeElement resultType, Value input) {
29073 return new Tan(resultType, input);
29074 }
29075
29076 @OpFactoryHelper.OpDeclaration(Tanh.NAME)
29077 public static final class Tanh extends OnnxOp {
29078 public static final String NAME = "Tanh";
29079
29080 public enum Attribute implements OnnxAttribute.None { }
29081
29082 public enum TypeConstraint implements OnnxTypeConstraint {
29083 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
29084 ;
29085
29086 final OnnxType.TypeVariable typeVariable;
29087
29088 TypeConstraint(OnnxType.TypeVariable typeVariable) {
29089 assert typeVariable.name().equals(name());
29090 this.typeVariable = typeVariable;
29091 }
29092
29093 @Override
29094 public OnnxType.TypeVariable typeVariable() {
29095 return typeVariable;
29096 }
29097 }
29098
29099 public enum InputParameter implements OnnxParameter {
29100 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29101 ;
29102
29103 final OnnxType type;
29104 final Quantifier quantifier;
29105
29106 InputParameter(OnnxType type, Quantifier quantifier) {
29107 this.type = type;
29108 this.quantifier = quantifier;
29109 }
29110
29111 @Override
29112 public OnnxType type() {
29113 return type;
29114 }
29115
29116 @Override
29117 public Quantifier quantifier() {
29118 return quantifier;
29119 }
29120 }
29121
29122 public enum OutputParameter implements OnnxParameter {
29123 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29124 ;
29125
29126 final OnnxType type;
29127 final Quantifier quantifier;
29128
29129 OutputParameter(OnnxType type, Quantifier quantifier) {
29130 this.type = type;
29131 this.quantifier = quantifier;
29132 }
29133
29134 @Override
29135 public OnnxType type() {
29136 return type;
29137 }
29138
29139 @Override
29140 public Quantifier quantifier() {
29141 return quantifier;
29142 }
29143 }
29144
29145 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
29146 NAME,
29147 List.of(Attribute.values()),
29148 List.of(TypeConstraint.values()),
29149 List.of(InputParameter.values()),
29150 List.of(OutputParameter.values())
29151 );
29152
29153 public Tanh(ExternalizedOp def) {
29154 super(SCHEMA, def);
29155 }
29156
29157 Tanh(Tanh that, CodeContext cc) {
29158 super(that, cc);
29159 }
29160
29161 @Override
29162 public Tanh transform(CodeContext cc, CodeTransformer ot) {
29163 return new Tanh(this, cc);
29164 }
29165
29166 Tanh(TypeElement resultType, Value input) {
29167 super(SCHEMA, resultType, Set.of(), List.of(input), List.of());
29168 }
29169
29170 @Override
29171 public SequencedSet<OnnxParameter> onnxOutputs() {
29172 return onnxOutputs(SCHEMA);
29173 }
29174
29175 @Override
29176 public SequencedMap<OnnxParameter, Object> onnxInputs() {
29177 return onnxInputs(SCHEMA, List.of(input()));
29178 }
29179
29180 public Value input() {
29181 return operands().get(0);
29182 }
29183
29184 }
29185
29186 public static Tanh Tanh(TypeElement resultType, Value input) {
29187 return new Tanh(resultType, input);
29188 }
29189
29190 @OpFactoryHelper.OpDeclaration(TensorScatter.NAME)
29191 public static final class TensorScatter extends OnnxOp {
29192 public static final String NAME = "TensorScatter";
29193
29194 public enum Attribute implements OnnxAttribute {
29195 mode(String.class, true, "linear"),
29196 axis(Long.class, true, -2),
29197 ;
29198
29199 final Class<?> t;
29200 final boolean optional;
29201 final Object defaultValue;
29202
29203 Attribute(Class<?> type, boolean optional, Object defaultValue) {
29204 this.t = type;
29205 this.optional = optional;
29206 this.defaultValue = defaultValue;
29207 assert optional || defaultValue == null;
29208 }
29209
29210 public Class<?> type() {
29211 return t;
29212 }
29213
29214 public boolean isOptional() {
29215 return optional;
29216 }
29217
29218 public Object defaultValue() {
29219 return defaultValue;
29220 }
29221 }
29222
29223 public enum TypeConstraint implements OnnxTypeConstraint {
29224 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
29225 ;
29226
29227 final OnnxType.TypeVariable typeVariable;
29228
29229 TypeConstraint(OnnxType.TypeVariable typeVariable) {
29230 assert typeVariable.name().equals(name());
29231 this.typeVariable = typeVariable;
29232 }
29233
29234 @Override
29235 public OnnxType.TypeVariable typeVariable() {
29236 return typeVariable;
29237 }
29238 }
29239
29240 public enum InputParameter implements OnnxParameter {
29241 past_cache(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29242 update(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29243 write_indices(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
29244 ;
29245
29246 final OnnxType type;
29247 final Quantifier quantifier;
29248
29249 InputParameter(OnnxType type, Quantifier quantifier) {
29250 this.type = type;
29251 this.quantifier = quantifier;
29252 }
29253
29254 @Override
29255 public OnnxType type() {
29256 return type;
29257 }
29258
29259 @Override
29260 public Quantifier quantifier() {
29261 return quantifier;
29262 }
29263 }
29264
29265 public enum OutputParameter implements OnnxParameter {
29266 present_cache(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29267 ;
29268
29269 final OnnxType type;
29270 final Quantifier quantifier;
29271
29272 OutputParameter(OnnxType type, Quantifier quantifier) {
29273 this.type = type;
29274 this.quantifier = quantifier;
29275 }
29276
29277 @Override
29278 public OnnxType type() {
29279 return type;
29280 }
29281
29282 @Override
29283 public Quantifier quantifier() {
29284 return quantifier;
29285 }
29286 }
29287
29288 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
29289 NAME,
29290 List.of(Attribute.values()),
29291 List.of(TypeConstraint.values()),
29292 List.of(InputParameter.values()),
29293 List.of(OutputParameter.values())
29294 );
29295
29296 public TensorScatter(ExternalizedOp def) {
29297 super(SCHEMA, def);
29298 }
29299
29300 TensorScatter(TensorScatter that, CodeContext cc) {
29301 super(that, cc);
29302 }
29303
29304 @Override
29305 public TensorScatter transform(CodeContext cc, CodeTransformer ot) {
29306 return new TensorScatter(this, cc);
29307 }
29308
29309 TensorScatter(TypeElement resultType, Value past_cache, Value update, java.util.Optional<Value> write_indices, java.util.Optional<String> mode, java.util.Optional<Long> axis) {
29310 super(SCHEMA, resultType, Set.of(), List.of(past_cache, update, write_indices), List.of(mode, axis));
29311 }
29312
29313 @Override
29314 public SequencedSet<OnnxParameter> onnxOutputs() {
29315 return onnxOutputs(SCHEMA);
29316 }
29317
29318 @Override
29319 public SequencedMap<OnnxParameter, Object> onnxInputs() {
29320 return onnxInputs(SCHEMA, List.of(past_cache(), update(), write_indices()));
29321 }
29322
29323 public Value past_cache() {
29324 return operands().get(0);
29325 }
29326
29327 public Value update() {
29328 return operands().get(1);
29329 }
29330
29331 public java.util.Optional<Value> write_indices() {
29332 int i = optionalInputArguments.indexOf(InputParameter.write_indices);
29333 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty();
29334 }
29335
29336 public java.util.Optional<String> mode() {
29337 String mode = Attribute.mode.access(String.class, onnxAttributes);
29338 return java.util.Optional.ofNullable(mode);
29339 }
29340
29341 public java.util.Optional<Long> axis() {
29342 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
29343 return java.util.Optional.ofNullable(axis);
29344 }
29345
29346 }
29347
29348 public static TensorScatter TensorScatter(TypeElement resultType, Value past_cache, Value update, java.util.Optional<Value> write_indices, java.util.Optional<String> mode, java.util.Optional<Long> axis) {
29349 return new TensorScatter(resultType, past_cache, update, write_indices, mode, axis);
29350 }
29351
29352 @OpFactoryHelper.OpDeclaration(TfIdfVectorizer.NAME)
29353 public static final class TfIdfVectorizer extends OnnxOp {
29354 public static final String NAME = "TfIdfVectorizer";
29355
29356 public enum Attribute implements OnnxAttribute {
29357 ngram_counts(long[].class, false, null),
29358 min_gram_length(Long.class, false, null),
29359 pool_strings(String[].class, true, null),
29360 mode(String.class, false, null),
29361 max_gram_length(Long.class, false, null),
29362 max_skip_count(Long.class, false, null),
29363 pool_int64s(long[].class, true, null),
29364 weights(float[].class, true, null),
29365 ngram_indexes(long[].class, false, null),
29366 ;
29367
29368 final Class<?> t;
29369 final boolean optional;
29370 final Object defaultValue;
29371
29372 Attribute(Class<?> type, boolean optional, Object defaultValue) {
29373 this.t = type;
29374 this.optional = optional;
29375 this.defaultValue = defaultValue;
29376 assert optional || defaultValue == null;
29377 }
29378
29379 public Class<?> type() {
29380 return t;
29381 }
29382
29383 public boolean isOptional() {
29384 return optional;
29385 }
29386
29387 public Object defaultValue() {
29388 return defaultValue;
29389 }
29390 }
29391
29392 public enum TypeConstraint implements OnnxTypeConstraint {
29393 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))),
29394 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32())))),
29395 ;
29396
29397 final OnnxType.TypeVariable typeVariable;
29398
29399 TypeConstraint(OnnxType.TypeVariable typeVariable) {
29400 assert typeVariable.name().equals(name());
29401 this.typeVariable = typeVariable;
29402 }
29403
29404 @Override
29405 public OnnxType.TypeVariable typeVariable() {
29406 return typeVariable;
29407 }
29408 }
29409
29410 public enum InputParameter implements OnnxParameter {
29411 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29412 ;
29413
29414 final OnnxType type;
29415 final Quantifier quantifier;
29416
29417 InputParameter(OnnxType type, Quantifier quantifier) {
29418 this.type = type;
29419 this.quantifier = quantifier;
29420 }
29421
29422 @Override
29423 public OnnxType type() {
29424 return type;
29425 }
29426
29427 @Override
29428 public Quantifier quantifier() {
29429 return quantifier;
29430 }
29431 }
29432
29433 public enum OutputParameter implements OnnxParameter {
29434 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
29435 ;
29436
29437 final OnnxType type;
29438 final Quantifier quantifier;
29439
29440 OutputParameter(OnnxType type, Quantifier quantifier) {
29441 this.type = type;
29442 this.quantifier = quantifier;
29443 }
29444
29445 @Override
29446 public OnnxType type() {
29447 return type;
29448 }
29449
29450 @Override
29451 public Quantifier quantifier() {
29452 return quantifier;
29453 }
29454 }
29455
29456 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
29457 NAME,
29458 List.of(Attribute.values()),
29459 List.of(TypeConstraint.values()),
29460 List.of(InputParameter.values()),
29461 List.of(OutputParameter.values())
29462 );
29463
29464 public TfIdfVectorizer(ExternalizedOp def) {
29465 super(SCHEMA, def);
29466 }
29467
29468 TfIdfVectorizer(TfIdfVectorizer that, CodeContext cc) {
29469 super(that, cc);
29470 }
29471
29472 @Override
29473 public TfIdfVectorizer transform(CodeContext cc, CodeTransformer ot) {
29474 return new TfIdfVectorizer(this, cc);
29475 }
29476
29477 TfIdfVectorizer(TypeElement resultType, Value X, long[] ngram_counts, long min_gram_length, java.util.Optional<String[]> pool_strings, String mode, long max_gram_length, long max_skip_count, java.util.Optional<long[]> pool_int64s, java.util.Optional<float[]> weights, long[] ngram_indexes) {
29478 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(ngram_counts, min_gram_length, pool_strings, mode, max_gram_length, max_skip_count, pool_int64s, weights, ngram_indexes));
29479 }
29480
29481 @Override
29482 public SequencedSet<OnnxParameter> onnxOutputs() {
29483 return onnxOutputs(SCHEMA);
29484 }
29485
29486 @Override
29487 public SequencedMap<OnnxParameter, Object> onnxInputs() {
29488 return onnxInputs(SCHEMA, List.of(X()));
29489 }
29490
29491 public Value X() {
29492 return operands().get(0);
29493 }
29494
29495 public long[] ngram_counts() {
29496 long[] ngram_counts = Attribute.ngram_counts.access(long[].class, onnxAttributes);
29497 return ngram_counts.clone();
29498 }
29499
29500 public long min_gram_length() {
29501 long min_gram_length = Attribute.min_gram_length.access(Long.class, onnxAttributes);
29502 return min_gram_length;
29503 }
29504
29505 public java.util.Optional<String[]> pool_strings() {
29506 String[] pool_strings = Attribute.pool_strings.access(String[].class, onnxAttributes);
29507 return java.util.Optional.ofNullable(pool_strings).map(String[]::clone);
29508 }
29509
29510 public String mode() {
29511 String mode = Attribute.mode.access(String.class, onnxAttributes);
29512 return mode;
29513 }
29514
29515 public long max_gram_length() {
29516 long max_gram_length = Attribute.max_gram_length.access(Long.class, onnxAttributes);
29517 return max_gram_length;
29518 }
29519
29520 public long max_skip_count() {
29521 long max_skip_count = Attribute.max_skip_count.access(Long.class, onnxAttributes);
29522 return max_skip_count;
29523 }
29524
29525 public java.util.Optional<long[]> pool_int64s() {
29526 long[] pool_int64s = Attribute.pool_int64s.access(long[].class, onnxAttributes);
29527 return java.util.Optional.ofNullable(pool_int64s).map(long[]::clone);
29528 }
29529
29530 public java.util.Optional<float[]> weights() {
29531 float[] weights = Attribute.weights.access(float[].class, onnxAttributes);
29532 return java.util.Optional.ofNullable(weights).map(float[]::clone);
29533 }
29534
29535 public long[] ngram_indexes() {
29536 long[] ngram_indexes = Attribute.ngram_indexes.access(long[].class, onnxAttributes);
29537 return ngram_indexes.clone();
29538 }
29539
29540 }
29541
29542 public static TfIdfVectorizer TfIdfVectorizer(TypeElement resultType, Value X, long[] ngram_counts, long min_gram_length, java.util.Optional<String[]> pool_strings, String mode, long max_gram_length, long max_skip_count, java.util.Optional<long[]> pool_int64s, java.util.Optional<float[]> weights, long[] ngram_indexes) {
29543 return new TfIdfVectorizer(resultType, X, ngram_counts, min_gram_length, pool_strings, mode, max_gram_length, max_skip_count, pool_int64s, weights, ngram_indexes);
29544 }
29545
29546 @OpFactoryHelper.OpDeclaration(ThresholdedRelu.NAME)
29547 public static final class ThresholdedRelu extends OnnxOp {
29548 public static final String NAME = "ThresholdedRelu";
29549
29550 public enum Attribute implements OnnxAttribute {
29551 alpha(Float.class, true, 1.0f),
29552 ;
29553
29554 final Class<?> t;
29555 final boolean optional;
29556 final Object defaultValue;
29557
29558 Attribute(Class<?> type, boolean optional, Object defaultValue) {
29559 this.t = type;
29560 this.optional = optional;
29561 this.defaultValue = defaultValue;
29562 assert optional || defaultValue == null;
29563 }
29564
29565 public Class<?> type() {
29566 return t;
29567 }
29568
29569 public boolean isOptional() {
29570 return optional;
29571 }
29572
29573 public Object defaultValue() {
29574 return defaultValue;
29575 }
29576 }
29577
29578 public enum TypeConstraint implements OnnxTypeConstraint {
29579 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))),
29580 ;
29581
29582 final OnnxType.TypeVariable typeVariable;
29583
29584 TypeConstraint(OnnxType.TypeVariable typeVariable) {
29585 assert typeVariable.name().equals(name());
29586 this.typeVariable = typeVariable;
29587 }
29588
29589 @Override
29590 public OnnxType.TypeVariable typeVariable() {
29591 return typeVariable;
29592 }
29593 }
29594
29595 public enum InputParameter implements OnnxParameter {
29596 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29597 ;
29598
29599 final OnnxType type;
29600 final Quantifier quantifier;
29601
29602 InputParameter(OnnxType type, Quantifier quantifier) {
29603 this.type = type;
29604 this.quantifier = quantifier;
29605 }
29606
29607 @Override
29608 public OnnxType type() {
29609 return type;
29610 }
29611
29612 @Override
29613 public Quantifier quantifier() {
29614 return quantifier;
29615 }
29616 }
29617
29618 public enum OutputParameter implements OnnxParameter {
29619 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29620 ;
29621
29622 final OnnxType type;
29623 final Quantifier quantifier;
29624
29625 OutputParameter(OnnxType type, Quantifier quantifier) {
29626 this.type = type;
29627 this.quantifier = quantifier;
29628 }
29629
29630 @Override
29631 public OnnxType type() {
29632 return type;
29633 }
29634
29635 @Override
29636 public Quantifier quantifier() {
29637 return quantifier;
29638 }
29639 }
29640
29641 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
29642 NAME,
29643 List.of(Attribute.values()),
29644 List.of(TypeConstraint.values()),
29645 List.of(InputParameter.values()),
29646 List.of(OutputParameter.values())
29647 );
29648
29649 public ThresholdedRelu(ExternalizedOp def) {
29650 super(SCHEMA, def);
29651 }
29652
29653 ThresholdedRelu(ThresholdedRelu that, CodeContext cc) {
29654 super(that, cc);
29655 }
29656
29657 @Override
29658 public ThresholdedRelu transform(CodeContext cc, CodeTransformer ot) {
29659 return new ThresholdedRelu(this, cc);
29660 }
29661
29662 ThresholdedRelu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
29663 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha));
29664 }
29665
29666 @Override
29667 public SequencedSet<OnnxParameter> onnxOutputs() {
29668 return onnxOutputs(SCHEMA);
29669 }
29670
29671 @Override
29672 public SequencedMap<OnnxParameter, Object> onnxInputs() {
29673 return onnxInputs(SCHEMA, List.of(X()));
29674 }
29675
29676 public Value X() {
29677 return operands().get(0);
29678 }
29679
29680 public java.util.Optional<Float> alpha() {
29681 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes);
29682 return java.util.Optional.ofNullable(alpha);
29683 }
29684
29685 }
29686
29687 public static ThresholdedRelu ThresholdedRelu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) {
29688 return new ThresholdedRelu(resultType, X, alpha);
29689 }
29690
29691 @OpFactoryHelper.OpDeclaration(Tile.NAME)
29692 public static final class Tile extends OnnxOp {
29693 public static final String NAME = "Tile";
29694
29695 public enum Attribute implements OnnxAttribute.None { }
29696
29697 public enum TypeConstraint implements OnnxTypeConstraint {
29698 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
29699 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int64())))),
29700 ;
29701
29702 final OnnxType.TypeVariable typeVariable;
29703
29704 TypeConstraint(OnnxType.TypeVariable typeVariable) {
29705 assert typeVariable.name().equals(name());
29706 this.typeVariable = typeVariable;
29707 }
29708
29709 @Override
29710 public OnnxType.TypeVariable typeVariable() {
29711 return typeVariable;
29712 }
29713 }
29714
29715 public enum InputParameter implements OnnxParameter {
29716 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29717 repeats(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
29718 ;
29719
29720 final OnnxType type;
29721 final Quantifier quantifier;
29722
29723 InputParameter(OnnxType type, Quantifier quantifier) {
29724 this.type = type;
29725 this.quantifier = quantifier;
29726 }
29727
29728 @Override
29729 public OnnxType type() {
29730 return type;
29731 }
29732
29733 @Override
29734 public Quantifier quantifier() {
29735 return quantifier;
29736 }
29737 }
29738
29739 public enum OutputParameter implements OnnxParameter {
29740 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29741 ;
29742
29743 final OnnxType type;
29744 final Quantifier quantifier;
29745
29746 OutputParameter(OnnxType type, Quantifier quantifier) {
29747 this.type = type;
29748 this.quantifier = quantifier;
29749 }
29750
29751 @Override
29752 public OnnxType type() {
29753 return type;
29754 }
29755
29756 @Override
29757 public Quantifier quantifier() {
29758 return quantifier;
29759 }
29760 }
29761
29762 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
29763 NAME,
29764 List.of(Attribute.values()),
29765 List.of(TypeConstraint.values()),
29766 List.of(InputParameter.values()),
29767 List.of(OutputParameter.values())
29768 );
29769
29770 public Tile(ExternalizedOp def) {
29771 super(SCHEMA, def);
29772 }
29773
29774 Tile(Tile that, CodeContext cc) {
29775 super(that, cc);
29776 }
29777
29778 @Override
29779 public Tile transform(CodeContext cc, CodeTransformer ot) {
29780 return new Tile(this, cc);
29781 }
29782
29783 Tile(TypeElement resultType, Value input, Value repeats) {
29784 super(SCHEMA, resultType, Set.of(), List.of(input, repeats), List.of());
29785 }
29786
29787 @Override
29788 public SequencedSet<OnnxParameter> onnxOutputs() {
29789 return onnxOutputs(SCHEMA);
29790 }
29791
29792 @Override
29793 public SequencedMap<OnnxParameter, Object> onnxInputs() {
29794 return onnxInputs(SCHEMA, List.of(input(), repeats()));
29795 }
29796
29797 public Value input() {
29798 return operands().get(0);
29799 }
29800
29801 public Value repeats() {
29802 return operands().get(1);
29803 }
29804
29805 }
29806
29807 public static Tile Tile(TypeElement resultType, Value input, Value repeats) {
29808 return new Tile(resultType, input, repeats);
29809 }
29810
29811 @OpFactoryHelper.OpDeclaration(TopK.NAME)
29812 public static final class TopK extends OnnxOp {
29813 public static final String NAME = "TopK";
29814
29815 public enum Attribute implements OnnxAttribute {
29816 largest(Long.class, true, 1),
29817 sorted(Long.class, true, 1),
29818 axis(Long.class, true, -1),
29819 ;
29820
29821 final Class<?> t;
29822 final boolean optional;
29823 final Object defaultValue;
29824
29825 Attribute(Class<?> type, boolean optional, Object defaultValue) {
29826 this.t = type;
29827 this.optional = optional;
29828 this.defaultValue = defaultValue;
29829 assert optional || defaultValue == null;
29830 }
29831
29832 public Class<?> type() {
29833 return t;
29834 }
29835
29836 public boolean isOptional() {
29837 return optional;
29838 }
29839
29840 public Object defaultValue() {
29841 return defaultValue;
29842 }
29843 }
29844
29845 public enum TypeConstraint implements OnnxTypeConstraint {
29846 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))),
29847 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int64())))),
29848 ;
29849
29850 final OnnxType.TypeVariable typeVariable;
29851
29852 TypeConstraint(OnnxType.TypeVariable typeVariable) {
29853 assert typeVariable.name().equals(name());
29854 this.typeVariable = typeVariable;
29855 }
29856
29857 @Override
29858 public OnnxType.TypeVariable typeVariable() {
29859 return typeVariable;
29860 }
29861 }
29862
29863 public enum InputParameter implements OnnxParameter {
29864 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29865 K(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
29866 ;
29867
29868 final OnnxType type;
29869 final Quantifier quantifier;
29870
29871 InputParameter(OnnxType type, Quantifier quantifier) {
29872 this.type = type;
29873 this.quantifier = quantifier;
29874 }
29875
29876 @Override
29877 public OnnxType type() {
29878 return type;
29879 }
29880
29881 @Override
29882 public Quantifier quantifier() {
29883 return quantifier;
29884 }
29885 }
29886
29887 public enum OutputParameter implements OnnxParameter {
29888 Values(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
29889 Indices(TypeConstraint.I.typeVariable(), Quantifier.REQUIRED),
29890 ;
29891
29892 final OnnxType type;
29893 final Quantifier quantifier;
29894
29895 OutputParameter(OnnxType type, Quantifier quantifier) {
29896 this.type = type;
29897 this.quantifier = quantifier;
29898 }
29899
29900 @Override
29901 public OnnxType type() {
29902 return type;
29903 }
29904
29905 @Override
29906 public Quantifier quantifier() {
29907 return quantifier;
29908 }
29909 }
29910
29911 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
29912 NAME,
29913 List.of(Attribute.values()),
29914 List.of(TypeConstraint.values()),
29915 List.of(InputParameter.values()),
29916 List.of(OutputParameter.values())
29917 );
29918
29919 public TopK(ExternalizedOp def) {
29920 super(SCHEMA, def);
29921 }
29922
29923 TopK(TopK that, CodeContext cc) {
29924 super(that, cc);
29925 }
29926
29927 @Override
29928 public TopK transform(CodeContext cc, CodeTransformer ot) {
29929 return new TopK(this, cc);
29930 }
29931
29932 TopK(TypeElement resultType, Value X, Value K, java.util.Optional<Long> largest, java.util.Optional<Long> sorted, java.util.Optional<Long> axis) {
29933 super(SCHEMA, resultType, Set.of(), List.of(X, K), List.of(largest, sorted, axis));
29934 }
29935
29936 @Override
29937 public SequencedSet<OnnxParameter> onnxOutputs() {
29938 return onnxOutputs(SCHEMA);
29939 }
29940
29941 @Override
29942 public SequencedMap<OnnxParameter, Object> onnxInputs() {
29943 return onnxInputs(SCHEMA, List.of(X(), K()));
29944 }
29945
29946 public Value X() {
29947 return operands().get(0);
29948 }
29949
29950 public Value K() {
29951 return operands().get(1);
29952 }
29953
29954 public java.util.Optional<Long> largest() {
29955 Long largest = Attribute.largest.access(Long.class, onnxAttributes);
29956 return java.util.Optional.ofNullable(largest);
29957 }
29958
29959 public java.util.Optional<Long> sorted() {
29960 Long sorted = Attribute.sorted.access(Long.class, onnxAttributes);
29961 return java.util.Optional.ofNullable(sorted);
29962 }
29963
29964 public java.util.Optional<Long> axis() {
29965 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
29966 return java.util.Optional.ofNullable(axis);
29967 }
29968
29969 }
29970
29971 public static TopK TopK(TypeElement resultType, Value X, Value K, java.util.Optional<Long> largest, java.util.Optional<Long> sorted, java.util.Optional<Long> axis) {
29972 return new TopK(resultType, X, K, largest, sorted, axis);
29973 }
29974
29975 @OpFactoryHelper.OpDeclaration(Transpose.NAME)
29976 public static final class Transpose extends OnnxOp {
29977 public static final String NAME = "Transpose";
29978
29979 public enum Attribute implements OnnxAttribute {
29980 perm(long[].class, true, null),
29981 ;
29982
29983 final Class<?> t;
29984 final boolean optional;
29985 final Object defaultValue;
29986
29987 Attribute(Class<?> type, boolean optional, Object defaultValue) {
29988 this.t = type;
29989 this.optional = optional;
29990 this.defaultValue = defaultValue;
29991 assert optional || defaultValue == null;
29992 }
29993
29994 public Class<?> type() {
29995 return t;
29996 }
29997
29998 public boolean isOptional() {
29999 return optional;
30000 }
30001
30002 public Object defaultValue() {
30003 return defaultValue;
30004 }
30005 }
30006
30007 public enum TypeConstraint implements OnnxTypeConstraint {
30008 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
30009 ;
30010
30011 final OnnxType.TypeVariable typeVariable;
30012
30013 TypeConstraint(OnnxType.TypeVariable typeVariable) {
30014 assert typeVariable.name().equals(name());
30015 this.typeVariable = typeVariable;
30016 }
30017
30018 @Override
30019 public OnnxType.TypeVariable typeVariable() {
30020 return typeVariable;
30021 }
30022 }
30023
30024 public enum InputParameter implements OnnxParameter {
30025 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
30026 ;
30027
30028 final OnnxType type;
30029 final Quantifier quantifier;
30030
30031 InputParameter(OnnxType type, Quantifier quantifier) {
30032 this.type = type;
30033 this.quantifier = quantifier;
30034 }
30035
30036 @Override
30037 public OnnxType type() {
30038 return type;
30039 }
30040
30041 @Override
30042 public Quantifier quantifier() {
30043 return quantifier;
30044 }
30045 }
30046
30047 public enum OutputParameter implements OnnxParameter {
30048 transposed(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
30049 ;
30050
30051 final OnnxType type;
30052 final Quantifier quantifier;
30053
30054 OutputParameter(OnnxType type, Quantifier quantifier) {
30055 this.type = type;
30056 this.quantifier = quantifier;
30057 }
30058
30059 @Override
30060 public OnnxType type() {
30061 return type;
30062 }
30063
30064 @Override
30065 public Quantifier quantifier() {
30066 return quantifier;
30067 }
30068 }
30069
30070 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
30071 NAME,
30072 List.of(Attribute.values()),
30073 List.of(TypeConstraint.values()),
30074 List.of(InputParameter.values()),
30075 List.of(OutputParameter.values())
30076 );
30077
30078 public Transpose(ExternalizedOp def) {
30079 super(SCHEMA, def);
30080 }
30081
30082 Transpose(Transpose that, CodeContext cc) {
30083 super(that, cc);
30084 }
30085
30086 @Override
30087 public Transpose transform(CodeContext cc, CodeTransformer ot) {
30088 return new Transpose(this, cc);
30089 }
30090
30091 Transpose(TypeElement resultType, Value data, java.util.Optional<long[]> perm) {
30092 super(SCHEMA, resultType, Set.of(), List.of(data), List.of(perm));
30093 }
30094
30095 @Override
30096 public SequencedSet<OnnxParameter> onnxOutputs() {
30097 return onnxOutputs(SCHEMA);
30098 }
30099
30100 @Override
30101 public SequencedMap<OnnxParameter, Object> onnxInputs() {
30102 return onnxInputs(SCHEMA, List.of(data()));
30103 }
30104
30105 public Value data() {
30106 return operands().get(0);
30107 }
30108
30109 public java.util.Optional<long[]> perm() {
30110 long[] perm = Attribute.perm.access(long[].class, onnxAttributes);
30111 return java.util.Optional.ofNullable(perm).map(long[]::clone);
30112 }
30113
30114 }
30115
30116 public static Transpose Transpose(TypeElement resultType, Value data, java.util.Optional<long[]> perm) {
30117 return new Transpose(resultType, data, perm);
30118 }
30119
30120 @OpFactoryHelper.OpDeclaration(TreeEnsemble.NAME)
30121 public static final class TreeEnsemble extends OnnxOp {
30122 public static final String NAME = "TreeEnsemble";
30123
30124 public enum Attribute implements OnnxAttribute {
30125 aggregate_function(Long.class, true, 1),
30126 nodes_hitrates(Tensor.class, true, null),
30127 nodes_featureids(long[].class, false, null),
30128 nodes_falseleafs(long[].class, false, null),
30129 post_transform(Long.class, true, 0),
30130 nodes_trueleafs(long[].class, false, null),
30131 nodes_modes(Tensor.class, false, null),
30132 nodes_falsenodeids(long[].class, false, null),
30133 nodes_truenodeids(long[].class, false, null),
30134 leaf_weights(Tensor.class, false, null),
30135 leaf_targetids(long[].class, false, null),
30136 tree_roots(long[].class, false, null),
30137 n_targets(Long.class, true, null),
30138 nodes_missing_value_tracks_true(long[].class, true, null),
30139 membership_values(Tensor.class, true, null),
30140 nodes_splits(Tensor.class, false, null),
30141 ;
30142
30143 final Class<?> t;
30144 final boolean optional;
30145 final Object defaultValue;
30146
30147 Attribute(Class<?> type, boolean optional, Object defaultValue) {
30148 this.t = type;
30149 this.optional = optional;
30150 this.defaultValue = defaultValue;
30151 assert optional || defaultValue == null;
30152 }
30153
30154 public Class<?> type() {
30155 return t;
30156 }
30157
30158 public boolean isOptional() {
30159 return optional;
30160 }
30161
30162 public Object defaultValue() {
30163 return defaultValue;
30164 }
30165 }
30166
30167 public enum TypeConstraint implements OnnxTypeConstraint {
30168 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.float16())))),
30169 ;
30170
30171 final OnnxType.TypeVariable typeVariable;
30172
30173 TypeConstraint(OnnxType.TypeVariable typeVariable) {
30174 assert typeVariable.name().equals(name());
30175 this.typeVariable = typeVariable;
30176 }
30177
30178 @Override
30179 public OnnxType.TypeVariable typeVariable() {
30180 return typeVariable;
30181 }
30182 }
30183
30184 public enum InputParameter implements OnnxParameter {
30185 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
30186 ;
30187
30188 final OnnxType type;
30189 final Quantifier quantifier;
30190
30191 InputParameter(OnnxType type, Quantifier quantifier) {
30192 this.type = type;
30193 this.quantifier = quantifier;
30194 }
30195
30196 @Override
30197 public OnnxType type() {
30198 return type;
30199 }
30200
30201 @Override
30202 public Quantifier quantifier() {
30203 return quantifier;
30204 }
30205 }
30206
30207 public enum OutputParameter implements OnnxParameter {
30208 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
30209 ;
30210
30211 final OnnxType type;
30212 final Quantifier quantifier;
30213
30214 OutputParameter(OnnxType type, Quantifier quantifier) {
30215 this.type = type;
30216 this.quantifier = quantifier;
30217 }
30218
30219 @Override
30220 public OnnxType type() {
30221 return type;
30222 }
30223
30224 @Override
30225 public Quantifier quantifier() {
30226 return quantifier;
30227 }
30228 }
30229
30230 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
30231 NAME,
30232 List.of(Attribute.values()),
30233 List.of(TypeConstraint.values()),
30234 List.of(InputParameter.values()),
30235 List.of(OutputParameter.values())
30236 );
30237
30238 public TreeEnsemble(ExternalizedOp def) {
30239 super(SCHEMA, def);
30240 }
30241
30242 TreeEnsemble(TreeEnsemble that, CodeContext cc) {
30243 super(that, cc);
30244 }
30245
30246 @Override
30247 public TreeEnsemble transform(CodeContext cc, CodeTransformer ot) {
30248 return new TreeEnsemble(this, cc);
30249 }
30250
30251 TreeEnsemble(TypeElement resultType, Value X, java.util.Optional<Long> aggregate_function, java.util.Optional<Tensor> nodes_hitrates, long[] nodes_featureids, long[] nodes_falseleafs, java.util.Optional<Long> post_transform, long[] nodes_trueleafs, Tensor nodes_modes, long[] nodes_falsenodeids, long[] nodes_truenodeids, Tensor leaf_weights, long[] leaf_targetids, long[] tree_roots, java.util.Optional<Long> n_targets, java.util.Optional<long[]> nodes_missing_value_tracks_true, java.util.Optional<Tensor> membership_values, Tensor nodes_splits) {
30252 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(aggregate_function, nodes_hitrates, nodes_featureids, nodes_falseleafs, post_transform, nodes_trueleafs, nodes_modes, nodes_falsenodeids, nodes_truenodeids, leaf_weights, leaf_targetids, tree_roots, n_targets, nodes_missing_value_tracks_true, membership_values, nodes_splits));
30253 }
30254
30255 @Override
30256 public SequencedSet<OnnxParameter> onnxOutputs() {
30257 return onnxOutputs(SCHEMA);
30258 }
30259
30260 @Override
30261 public SequencedMap<OnnxParameter, Object> onnxInputs() {
30262 return onnxInputs(SCHEMA, List.of(X()));
30263 }
30264
30265 public Value X() {
30266 return operands().get(0);
30267 }
30268
30269 public java.util.Optional<Long> aggregate_function() {
30270 Long aggregate_function = Attribute.aggregate_function.access(Long.class, onnxAttributes);
30271 return java.util.Optional.ofNullable(aggregate_function);
30272 }
30273
30274 public java.util.Optional<Tensor> nodes_hitrates() {
30275 Tensor nodes_hitrates = Attribute.nodes_hitrates.access(Tensor.class, onnxAttributes);
30276 return java.util.Optional.ofNullable(nodes_hitrates);
30277 }
30278
30279 public long[] nodes_featureids() {
30280 long[] nodes_featureids = Attribute.nodes_featureids.access(long[].class, onnxAttributes);
30281 return nodes_featureids.clone();
30282 }
30283
30284 public long[] nodes_falseleafs() {
30285 long[] nodes_falseleafs = Attribute.nodes_falseleafs.access(long[].class, onnxAttributes);
30286 return nodes_falseleafs.clone();
30287 }
30288
30289 public java.util.Optional<Long> post_transform() {
30290 Long post_transform = Attribute.post_transform.access(Long.class, onnxAttributes);
30291 return java.util.Optional.ofNullable(post_transform);
30292 }
30293
30294 public long[] nodes_trueleafs() {
30295 long[] nodes_trueleafs = Attribute.nodes_trueleafs.access(long[].class, onnxAttributes);
30296 return nodes_trueleafs.clone();
30297 }
30298
30299 public Tensor nodes_modes() {
30300 Tensor nodes_modes = Attribute.nodes_modes.access(Tensor.class, onnxAttributes);
30301 return nodes_modes;
30302 }
30303
30304 public long[] nodes_falsenodeids() {
30305 long[] nodes_falsenodeids = Attribute.nodes_falsenodeids.access(long[].class, onnxAttributes);
30306 return nodes_falsenodeids.clone();
30307 }
30308
30309 public long[] nodes_truenodeids() {
30310 long[] nodes_truenodeids = Attribute.nodes_truenodeids.access(long[].class, onnxAttributes);
30311 return nodes_truenodeids.clone();
30312 }
30313
30314 public Tensor leaf_weights() {
30315 Tensor leaf_weights = Attribute.leaf_weights.access(Tensor.class, onnxAttributes);
30316 return leaf_weights;
30317 }
30318
30319 public long[] leaf_targetids() {
30320 long[] leaf_targetids = Attribute.leaf_targetids.access(long[].class, onnxAttributes);
30321 return leaf_targetids.clone();
30322 }
30323
30324 public long[] tree_roots() {
30325 long[] tree_roots = Attribute.tree_roots.access(long[].class, onnxAttributes);
30326 return tree_roots.clone();
30327 }
30328
30329 public java.util.Optional<Long> n_targets() {
30330 Long n_targets = Attribute.n_targets.access(Long.class, onnxAttributes);
30331 return java.util.Optional.ofNullable(n_targets);
30332 }
30333
30334 public java.util.Optional<long[]> nodes_missing_value_tracks_true() {
30335 long[] nodes_missing_value_tracks_true = Attribute.nodes_missing_value_tracks_true.access(long[].class, onnxAttributes);
30336 return java.util.Optional.ofNullable(nodes_missing_value_tracks_true).map(long[]::clone);
30337 }
30338
30339 public java.util.Optional<Tensor> membership_values() {
30340 Tensor membership_values = Attribute.membership_values.access(Tensor.class, onnxAttributes);
30341 return java.util.Optional.ofNullable(membership_values);
30342 }
30343
30344 public Tensor nodes_splits() {
30345 Tensor nodes_splits = Attribute.nodes_splits.access(Tensor.class, onnxAttributes);
30346 return nodes_splits;
30347 }
30348
30349 }
30350
30351 public static TreeEnsemble TreeEnsemble(TypeElement resultType, Value X, java.util.Optional<Long> aggregate_function, java.util.Optional<Tensor> nodes_hitrates, long[] nodes_featureids, long[] nodes_falseleafs, java.util.Optional<Long> post_transform, long[] nodes_trueleafs, Tensor nodes_modes, long[] nodes_falsenodeids, long[] nodes_truenodeids, Tensor leaf_weights, long[] leaf_targetids, long[] tree_roots, java.util.Optional<Long> n_targets, java.util.Optional<long[]> nodes_missing_value_tracks_true, java.util.Optional<Tensor> membership_values, Tensor nodes_splits) {
30352 return new TreeEnsemble(resultType, X, aggregate_function, nodes_hitrates, nodes_featureids, nodes_falseleafs, post_transform, nodes_trueleafs, nodes_modes, nodes_falsenodeids, nodes_truenodeids, leaf_weights, leaf_targetids, tree_roots, n_targets, nodes_missing_value_tracks_true, membership_values, nodes_splits);
30353 }
30354
30355 @OpFactoryHelper.OpDeclaration(TreeEnsembleClassifier.NAME)
30356 public static final class TreeEnsembleClassifier extends OnnxOp {
30357 public static final String NAME = "TreeEnsembleClassifier";
30358
30359 public enum Attribute implements OnnxAttribute {
30360 classlabels_int64s(long[].class, true, null),
30361 class_ids(long[].class, true, null),
30362 nodes_hitrates(float[].class, true, null),
30363 nodes_featureids(long[].class, true, null),
30364 nodes_treeids(long[].class, true, null),
30365 class_weights_as_tensor(Tensor.class, true, null),
30366 post_transform(String.class, true, "NONE"),
30367 nodes_modes(String[].class, true, null),
30368 nodes_falsenodeids(long[].class, true, null),
30369 classlabels_strings(String[].class, true, null),
30370 nodes_truenodeids(long[].class, true, null),
30371 nodes_nodeids(long[].class, true, null),
30372 nodes_hitrates_as_tensor(Tensor.class, true, null),
30373 class_weights(float[].class, true, null),
30374 base_values_as_tensor(Tensor.class, true, null),
30375 nodes_missing_value_tracks_true(long[].class, true, null),
30376 class_nodeids(long[].class, true, null),
30377 class_treeids(long[].class, true, null),
30378 base_values(float[].class, true, null),
30379 nodes_values(float[].class, true, null),
30380 nodes_values_as_tensor(Tensor.class, true, null),
30381 ;
30382
30383 final Class<?> t;
30384 final boolean optional;
30385 final Object defaultValue;
30386
30387 Attribute(Class<?> type, boolean optional, Object defaultValue) {
30388 this.t = type;
30389 this.optional = optional;
30390 this.defaultValue = defaultValue;
30391 assert optional || defaultValue == null;
30392 }
30393
30394 public Class<?> type() {
30395 return t;
30396 }
30397
30398 public boolean isOptional() {
30399 return optional;
30400 }
30401
30402 public Object defaultValue() {
30403 return defaultValue;
30404 }
30405 }
30406
30407 public enum TypeConstraint implements OnnxTypeConstraint {
30408 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
30409 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))),
30410 ;
30411
30412 final OnnxType.TypeVariable typeVariable;
30413
30414 TypeConstraint(OnnxType.TypeVariable typeVariable) {
30415 assert typeVariable.name().equals(name());
30416 this.typeVariable = typeVariable;
30417 }
30418
30419 @Override
30420 public OnnxType.TypeVariable typeVariable() {
30421 return typeVariable;
30422 }
30423 }
30424
30425 public enum InputParameter implements OnnxParameter {
30426 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
30427 ;
30428
30429 final OnnxType type;
30430 final Quantifier quantifier;
30431
30432 InputParameter(OnnxType type, Quantifier quantifier) {
30433 this.type = type;
30434 this.quantifier = quantifier;
30435 }
30436
30437 @Override
30438 public OnnxType type() {
30439 return type;
30440 }
30441
30442 @Override
30443 public Quantifier quantifier() {
30444 return quantifier;
30445 }
30446 }
30447
30448 public enum OutputParameter implements OnnxParameter {
30449 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED),
30450 Z(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
30451 ;
30452
30453 final OnnxType type;
30454 final Quantifier quantifier;
30455
30456 OutputParameter(OnnxType type, Quantifier quantifier) {
30457 this.type = type;
30458 this.quantifier = quantifier;
30459 }
30460
30461 @Override
30462 public OnnxType type() {
30463 return type;
30464 }
30465
30466 @Override
30467 public Quantifier quantifier() {
30468 return quantifier;
30469 }
30470 }
30471
30472 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
30473 NAME,
30474 List.of(Attribute.values()),
30475 List.of(TypeConstraint.values()),
30476 List.of(InputParameter.values()),
30477 List.of(OutputParameter.values())
30478 );
30479
30480 public TreeEnsembleClassifier(ExternalizedOp def) {
30481 super(SCHEMA, def);
30482 }
30483
30484 TreeEnsembleClassifier(TreeEnsembleClassifier that, CodeContext cc) {
30485 super(that, cc);
30486 }
30487
30488 @Override
30489 public TreeEnsembleClassifier transform(CodeContext cc, CodeTransformer ot) {
30490 return new TreeEnsembleClassifier(this, cc);
30491 }
30492
30493 TreeEnsembleClassifier(TypeElement resultType, Value X, java.util.Optional<long[]> classlabels_int64s, java.util.Optional<long[]> class_ids, java.util.Optional<float[]> nodes_hitrates, java.util.Optional<long[]> nodes_featureids, java.util.Optional<long[]> nodes_treeids, java.util.Optional<Tensor> class_weights_as_tensor, java.util.Optional<String> post_transform, java.util.Optional<String[]> nodes_modes, java.util.Optional<long[]> nodes_falsenodeids, java.util.Optional<String[]> classlabels_strings, java.util.Optional<long[]> nodes_truenodeids, java.util.Optional<long[]> nodes_nodeids, java.util.Optional<Tensor> nodes_hitrates_as_tensor, java.util.Optional<float[]> class_weights, java.util.Optional<Tensor> base_values_as_tensor, java.util.Optional<long[]> nodes_missing_value_tracks_true, java.util.Optional<long[]> class_nodeids, java.util.Optional<long[]> class_treeids, java.util.Optional<float[]> base_values, java.util.Optional<float[]> nodes_values, java.util.Optional<Tensor> nodes_values_as_tensor) {
30494 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(classlabels_int64s, class_ids, nodes_hitrates, nodes_featureids, nodes_treeids, class_weights_as_tensor, post_transform, nodes_modes, nodes_falsenodeids, classlabels_strings, nodes_truenodeids, nodes_nodeids, nodes_hitrates_as_tensor, class_weights, base_values_as_tensor, nodes_missing_value_tracks_true, class_nodeids, class_treeids, base_values, nodes_values, nodes_values_as_tensor));
30495 }
30496
30497 @Override
30498 public SequencedSet<OnnxParameter> onnxOutputs() {
30499 return onnxOutputs(SCHEMA);
30500 }
30501
30502 @Override
30503 public SequencedMap<OnnxParameter, Object> onnxInputs() {
30504 return onnxInputs(SCHEMA, List.of(X()));
30505 }
30506
30507 public Value X() {
30508 return operands().get(0);
30509 }
30510
30511 public java.util.Optional<long[]> classlabels_int64s() {
30512 long[] classlabels_int64s = Attribute.classlabels_int64s.access(long[].class, onnxAttributes);
30513 return java.util.Optional.ofNullable(classlabels_int64s).map(long[]::clone);
30514 }
30515
30516 public java.util.Optional<long[]> class_ids() {
30517 long[] class_ids = Attribute.class_ids.access(long[].class, onnxAttributes);
30518 return java.util.Optional.ofNullable(class_ids).map(long[]::clone);
30519 }
30520
30521 public java.util.Optional<float[]> nodes_hitrates() {
30522 float[] nodes_hitrates = Attribute.nodes_hitrates.access(float[].class, onnxAttributes);
30523 return java.util.Optional.ofNullable(nodes_hitrates).map(float[]::clone);
30524 }
30525
30526 public java.util.Optional<long[]> nodes_featureids() {
30527 long[] nodes_featureids = Attribute.nodes_featureids.access(long[].class, onnxAttributes);
30528 return java.util.Optional.ofNullable(nodes_featureids).map(long[]::clone);
30529 }
30530
30531 public java.util.Optional<long[]> nodes_treeids() {
30532 long[] nodes_treeids = Attribute.nodes_treeids.access(long[].class, onnxAttributes);
30533 return java.util.Optional.ofNullable(nodes_treeids).map(long[]::clone);
30534 }
30535
30536 public java.util.Optional<Tensor> class_weights_as_tensor() {
30537 Tensor class_weights_as_tensor = Attribute.class_weights_as_tensor.access(Tensor.class, onnxAttributes);
30538 return java.util.Optional.ofNullable(class_weights_as_tensor);
30539 }
30540
30541 public java.util.Optional<String> post_transform() {
30542 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes);
30543 return java.util.Optional.ofNullable(post_transform);
30544 }
30545
30546 public java.util.Optional<String[]> nodes_modes() {
30547 String[] nodes_modes = Attribute.nodes_modes.access(String[].class, onnxAttributes);
30548 return java.util.Optional.ofNullable(nodes_modes).map(String[]::clone);
30549 }
30550
30551 public java.util.Optional<long[]> nodes_falsenodeids() {
30552 long[] nodes_falsenodeids = Attribute.nodes_falsenodeids.access(long[].class, onnxAttributes);
30553 return java.util.Optional.ofNullable(nodes_falsenodeids).map(long[]::clone);
30554 }
30555
30556 public java.util.Optional<String[]> classlabels_strings() {
30557 String[] classlabels_strings = Attribute.classlabels_strings.access(String[].class, onnxAttributes);
30558 return java.util.Optional.ofNullable(classlabels_strings).map(String[]::clone);
30559 }
30560
30561 public java.util.Optional<long[]> nodes_truenodeids() {
30562 long[] nodes_truenodeids = Attribute.nodes_truenodeids.access(long[].class, onnxAttributes);
30563 return java.util.Optional.ofNullable(nodes_truenodeids).map(long[]::clone);
30564 }
30565
30566 public java.util.Optional<long[]> nodes_nodeids() {
30567 long[] nodes_nodeids = Attribute.nodes_nodeids.access(long[].class, onnxAttributes);
30568 return java.util.Optional.ofNullable(nodes_nodeids).map(long[]::clone);
30569 }
30570
30571 public java.util.Optional<Tensor> nodes_hitrates_as_tensor() {
30572 Tensor nodes_hitrates_as_tensor = Attribute.nodes_hitrates_as_tensor.access(Tensor.class, onnxAttributes);
30573 return java.util.Optional.ofNullable(nodes_hitrates_as_tensor);
30574 }
30575
30576 public java.util.Optional<float[]> class_weights() {
30577 float[] class_weights = Attribute.class_weights.access(float[].class, onnxAttributes);
30578 return java.util.Optional.ofNullable(class_weights).map(float[]::clone);
30579 }
30580
30581 public java.util.Optional<Tensor> base_values_as_tensor() {
30582 Tensor base_values_as_tensor = Attribute.base_values_as_tensor.access(Tensor.class, onnxAttributes);
30583 return java.util.Optional.ofNullable(base_values_as_tensor);
30584 }
30585
30586 public java.util.Optional<long[]> nodes_missing_value_tracks_true() {
30587 long[] nodes_missing_value_tracks_true = Attribute.nodes_missing_value_tracks_true.access(long[].class, onnxAttributes);
30588 return java.util.Optional.ofNullable(nodes_missing_value_tracks_true).map(long[]::clone);
30589 }
30590
30591 public java.util.Optional<long[]> class_nodeids() {
30592 long[] class_nodeids = Attribute.class_nodeids.access(long[].class, onnxAttributes);
30593 return java.util.Optional.ofNullable(class_nodeids).map(long[]::clone);
30594 }
30595
30596 public java.util.Optional<long[]> class_treeids() {
30597 long[] class_treeids = Attribute.class_treeids.access(long[].class, onnxAttributes);
30598 return java.util.Optional.ofNullable(class_treeids).map(long[]::clone);
30599 }
30600
30601 public java.util.Optional<float[]> base_values() {
30602 float[] base_values = Attribute.base_values.access(float[].class, onnxAttributes);
30603 return java.util.Optional.ofNullable(base_values).map(float[]::clone);
30604 }
30605
30606 public java.util.Optional<float[]> nodes_values() {
30607 float[] nodes_values = Attribute.nodes_values.access(float[].class, onnxAttributes);
30608 return java.util.Optional.ofNullable(nodes_values).map(float[]::clone);
30609 }
30610
30611 public java.util.Optional<Tensor> nodes_values_as_tensor() {
30612 Tensor nodes_values_as_tensor = Attribute.nodes_values_as_tensor.access(Tensor.class, onnxAttributes);
30613 return java.util.Optional.ofNullable(nodes_values_as_tensor);
30614 }
30615
30616 }
30617
30618 public static TreeEnsembleClassifier TreeEnsembleClassifier(TypeElement resultType, Value X, java.util.Optional<long[]> classlabels_int64s, java.util.Optional<long[]> class_ids, java.util.Optional<float[]> nodes_hitrates, java.util.Optional<long[]> nodes_featureids, java.util.Optional<long[]> nodes_treeids, java.util.Optional<Tensor> class_weights_as_tensor, java.util.Optional<String> post_transform, java.util.Optional<String[]> nodes_modes, java.util.Optional<long[]> nodes_falsenodeids, java.util.Optional<String[]> classlabels_strings, java.util.Optional<long[]> nodes_truenodeids, java.util.Optional<long[]> nodes_nodeids, java.util.Optional<Tensor> nodes_hitrates_as_tensor, java.util.Optional<float[]> class_weights, java.util.Optional<Tensor> base_values_as_tensor, java.util.Optional<long[]> nodes_missing_value_tracks_true, java.util.Optional<long[]> class_nodeids, java.util.Optional<long[]> class_treeids, java.util.Optional<float[]> base_values, java.util.Optional<float[]> nodes_values, java.util.Optional<Tensor> nodes_values_as_tensor) {
30619 return new TreeEnsembleClassifier(resultType, X, classlabels_int64s, class_ids, nodes_hitrates, nodes_featureids, nodes_treeids, class_weights_as_tensor, post_transform, nodes_modes, nodes_falsenodeids, classlabels_strings, nodes_truenodeids, nodes_nodeids, nodes_hitrates_as_tensor, class_weights, base_values_as_tensor, nodes_missing_value_tracks_true, class_nodeids, class_treeids, base_values, nodes_values, nodes_values_as_tensor);
30620 }
30621
30622 @OpFactoryHelper.OpDeclaration(TreeEnsembleRegressor.NAME)
30623 public static final class TreeEnsembleRegressor extends OnnxOp {
30624 public static final String NAME = "TreeEnsembleRegressor";
30625
30626 public enum Attribute implements OnnxAttribute {
30627 aggregate_function(String.class, true, "SUM"),
30628 nodes_hitrates(float[].class, true, null),
30629 target_weights_as_tensor(Tensor.class, true, null),
30630 nodes_featureids(long[].class, true, null),
30631 target_treeids(long[].class, true, null),
30632 nodes_treeids(long[].class, true, null),
30633 post_transform(String.class, true, "NONE"),
30634 nodes_modes(String[].class, true, null),
30635 target_weights(float[].class, true, null),
30636 nodes_falsenodeids(long[].class, true, null),
30637 target_ids(long[].class, true, null),
30638 nodes_truenodeids(long[].class, true, null),
30639 target_nodeids(long[].class, true, null),
30640 nodes_nodeids(long[].class, true, null),
30641 nodes_hitrates_as_tensor(Tensor.class, true, null),
30642 base_values_as_tensor(Tensor.class, true, null),
30643 n_targets(Long.class, true, null),
30644 nodes_missing_value_tracks_true(long[].class, true, null),
30645 base_values(float[].class, true, null),
30646 nodes_values(float[].class, true, null),
30647 nodes_values_as_tensor(Tensor.class, true, null),
30648 ;
30649
30650 final Class<?> t;
30651 final boolean optional;
30652 final Object defaultValue;
30653
30654 Attribute(Class<?> type, boolean optional, Object defaultValue) {
30655 this.t = type;
30656 this.optional = optional;
30657 this.defaultValue = defaultValue;
30658 assert optional || defaultValue == null;
30659 }
30660
30661 public Class<?> type() {
30662 return t;
30663 }
30664
30665 public boolean isOptional() {
30666 return optional;
30667 }
30668
30669 public Object defaultValue() {
30670 return defaultValue;
30671 }
30672 }
30673
30674 public enum TypeConstraint implements OnnxTypeConstraint {
30675 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))),
30676 ;
30677
30678 final OnnxType.TypeVariable typeVariable;
30679
30680 TypeConstraint(OnnxType.TypeVariable typeVariable) {
30681 assert typeVariable.name().equals(name());
30682 this.typeVariable = typeVariable;
30683 }
30684
30685 @Override
30686 public OnnxType.TypeVariable typeVariable() {
30687 return typeVariable;
30688 }
30689 }
30690
30691 public enum InputParameter implements OnnxParameter {
30692 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
30693 ;
30694
30695 final OnnxType type;
30696 final Quantifier quantifier;
30697
30698 InputParameter(OnnxType type, Quantifier quantifier) {
30699 this.type = type;
30700 this.quantifier = quantifier;
30701 }
30702
30703 @Override
30704 public OnnxType type() {
30705 return type;
30706 }
30707
30708 @Override
30709 public Quantifier quantifier() {
30710 return quantifier;
30711 }
30712 }
30713
30714 public enum OutputParameter implements OnnxParameter {
30715 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
30716 ;
30717
30718 final OnnxType type;
30719 final Quantifier quantifier;
30720
30721 OutputParameter(OnnxType type, Quantifier quantifier) {
30722 this.type = type;
30723 this.quantifier = quantifier;
30724 }
30725
30726 @Override
30727 public OnnxType type() {
30728 return type;
30729 }
30730
30731 @Override
30732 public Quantifier quantifier() {
30733 return quantifier;
30734 }
30735 }
30736
30737 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
30738 NAME,
30739 List.of(Attribute.values()),
30740 List.of(TypeConstraint.values()),
30741 List.of(InputParameter.values()),
30742 List.of(OutputParameter.values())
30743 );
30744
30745 public TreeEnsembleRegressor(ExternalizedOp def) {
30746 super(SCHEMA, def);
30747 }
30748
30749 TreeEnsembleRegressor(TreeEnsembleRegressor that, CodeContext cc) {
30750 super(that, cc);
30751 }
30752
30753 @Override
30754 public TreeEnsembleRegressor transform(CodeContext cc, CodeTransformer ot) {
30755 return new TreeEnsembleRegressor(this, cc);
30756 }
30757
30758 TreeEnsembleRegressor(TypeElement resultType, Value X, java.util.Optional<String> aggregate_function, java.util.Optional<float[]> nodes_hitrates, java.util.Optional<Tensor> target_weights_as_tensor, java.util.Optional<long[]> nodes_featureids, java.util.Optional<long[]> target_treeids, java.util.Optional<long[]> nodes_treeids, java.util.Optional<String> post_transform, java.util.Optional<String[]> nodes_modes, java.util.Optional<float[]> target_weights, java.util.Optional<long[]> nodes_falsenodeids, java.util.Optional<long[]> target_ids, java.util.Optional<long[]> nodes_truenodeids, java.util.Optional<long[]> target_nodeids, java.util.Optional<long[]> nodes_nodeids, java.util.Optional<Tensor> nodes_hitrates_as_tensor, java.util.Optional<Tensor> base_values_as_tensor, java.util.Optional<Long> n_targets, java.util.Optional<long[]> nodes_missing_value_tracks_true, java.util.Optional<float[]> base_values, java.util.Optional<float[]> nodes_values, java.util.Optional<Tensor> nodes_values_as_tensor) {
30759 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(aggregate_function, nodes_hitrates, target_weights_as_tensor, nodes_featureids, target_treeids, nodes_treeids, post_transform, nodes_modes, target_weights, nodes_falsenodeids, target_ids, nodes_truenodeids, target_nodeids, nodes_nodeids, nodes_hitrates_as_tensor, base_values_as_tensor, n_targets, nodes_missing_value_tracks_true, base_values, nodes_values, nodes_values_as_tensor));
30760 }
30761
30762 @Override
30763 public SequencedSet<OnnxParameter> onnxOutputs() {
30764 return onnxOutputs(SCHEMA);
30765 }
30766
30767 @Override
30768 public SequencedMap<OnnxParameter, Object> onnxInputs() {
30769 return onnxInputs(SCHEMA, List.of(X()));
30770 }
30771
30772 public Value X() {
30773 return operands().get(0);
30774 }
30775
30776 public java.util.Optional<String> aggregate_function() {
30777 String aggregate_function = Attribute.aggregate_function.access(String.class, onnxAttributes);
30778 return java.util.Optional.ofNullable(aggregate_function);
30779 }
30780
30781 public java.util.Optional<float[]> nodes_hitrates() {
30782 float[] nodes_hitrates = Attribute.nodes_hitrates.access(float[].class, onnxAttributes);
30783 return java.util.Optional.ofNullable(nodes_hitrates).map(float[]::clone);
30784 }
30785
30786 public java.util.Optional<Tensor> target_weights_as_tensor() {
30787 Tensor target_weights_as_tensor = Attribute.target_weights_as_tensor.access(Tensor.class, onnxAttributes);
30788 return java.util.Optional.ofNullable(target_weights_as_tensor);
30789 }
30790
30791 public java.util.Optional<long[]> nodes_featureids() {
30792 long[] nodes_featureids = Attribute.nodes_featureids.access(long[].class, onnxAttributes);
30793 return java.util.Optional.ofNullable(nodes_featureids).map(long[]::clone);
30794 }
30795
30796 public java.util.Optional<long[]> target_treeids() {
30797 long[] target_treeids = Attribute.target_treeids.access(long[].class, onnxAttributes);
30798 return java.util.Optional.ofNullable(target_treeids).map(long[]::clone);
30799 }
30800
30801 public java.util.Optional<long[]> nodes_treeids() {
30802 long[] nodes_treeids = Attribute.nodes_treeids.access(long[].class, onnxAttributes);
30803 return java.util.Optional.ofNullable(nodes_treeids).map(long[]::clone);
30804 }
30805
30806 public java.util.Optional<String> post_transform() {
30807 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes);
30808 return java.util.Optional.ofNullable(post_transform);
30809 }
30810
30811 public java.util.Optional<String[]> nodes_modes() {
30812 String[] nodes_modes = Attribute.nodes_modes.access(String[].class, onnxAttributes);
30813 return java.util.Optional.ofNullable(nodes_modes).map(String[]::clone);
30814 }
30815
30816 public java.util.Optional<float[]> target_weights() {
30817 float[] target_weights = Attribute.target_weights.access(float[].class, onnxAttributes);
30818 return java.util.Optional.ofNullable(target_weights).map(float[]::clone);
30819 }
30820
30821 public java.util.Optional<long[]> nodes_falsenodeids() {
30822 long[] nodes_falsenodeids = Attribute.nodes_falsenodeids.access(long[].class, onnxAttributes);
30823 return java.util.Optional.ofNullable(nodes_falsenodeids).map(long[]::clone);
30824 }
30825
30826 public java.util.Optional<long[]> target_ids() {
30827 long[] target_ids = Attribute.target_ids.access(long[].class, onnxAttributes);
30828 return java.util.Optional.ofNullable(target_ids).map(long[]::clone);
30829 }
30830
30831 public java.util.Optional<long[]> nodes_truenodeids() {
30832 long[] nodes_truenodeids = Attribute.nodes_truenodeids.access(long[].class, onnxAttributes);
30833 return java.util.Optional.ofNullable(nodes_truenodeids).map(long[]::clone);
30834 }
30835
30836 public java.util.Optional<long[]> target_nodeids() {
30837 long[] target_nodeids = Attribute.target_nodeids.access(long[].class, onnxAttributes);
30838 return java.util.Optional.ofNullable(target_nodeids).map(long[]::clone);
30839 }
30840
30841 public java.util.Optional<long[]> nodes_nodeids() {
30842 long[] nodes_nodeids = Attribute.nodes_nodeids.access(long[].class, onnxAttributes);
30843 return java.util.Optional.ofNullable(nodes_nodeids).map(long[]::clone);
30844 }
30845
30846 public java.util.Optional<Tensor> nodes_hitrates_as_tensor() {
30847 Tensor nodes_hitrates_as_tensor = Attribute.nodes_hitrates_as_tensor.access(Tensor.class, onnxAttributes);
30848 return java.util.Optional.ofNullable(nodes_hitrates_as_tensor);
30849 }
30850
30851 public java.util.Optional<Tensor> base_values_as_tensor() {
30852 Tensor base_values_as_tensor = Attribute.base_values_as_tensor.access(Tensor.class, onnxAttributes);
30853 return java.util.Optional.ofNullable(base_values_as_tensor);
30854 }
30855
30856 public java.util.Optional<Long> n_targets() {
30857 Long n_targets = Attribute.n_targets.access(Long.class, onnxAttributes);
30858 return java.util.Optional.ofNullable(n_targets);
30859 }
30860
30861 public java.util.Optional<long[]> nodes_missing_value_tracks_true() {
30862 long[] nodes_missing_value_tracks_true = Attribute.nodes_missing_value_tracks_true.access(long[].class, onnxAttributes);
30863 return java.util.Optional.ofNullable(nodes_missing_value_tracks_true).map(long[]::clone);
30864 }
30865
30866 public java.util.Optional<float[]> base_values() {
30867 float[] base_values = Attribute.base_values.access(float[].class, onnxAttributes);
30868 return java.util.Optional.ofNullable(base_values).map(float[]::clone);
30869 }
30870
30871 public java.util.Optional<float[]> nodes_values() {
30872 float[] nodes_values = Attribute.nodes_values.access(float[].class, onnxAttributes);
30873 return java.util.Optional.ofNullable(nodes_values).map(float[]::clone);
30874 }
30875
30876 public java.util.Optional<Tensor> nodes_values_as_tensor() {
30877 Tensor nodes_values_as_tensor = Attribute.nodes_values_as_tensor.access(Tensor.class, onnxAttributes);
30878 return java.util.Optional.ofNullable(nodes_values_as_tensor);
30879 }
30880
30881 }
30882
30883 public static TreeEnsembleRegressor TreeEnsembleRegressor(TypeElement resultType, Value X, java.util.Optional<String> aggregate_function, java.util.Optional<float[]> nodes_hitrates, java.util.Optional<Tensor> target_weights_as_tensor, java.util.Optional<long[]> nodes_featureids, java.util.Optional<long[]> target_treeids, java.util.Optional<long[]> nodes_treeids, java.util.Optional<String> post_transform, java.util.Optional<String[]> nodes_modes, java.util.Optional<float[]> target_weights, java.util.Optional<long[]> nodes_falsenodeids, java.util.Optional<long[]> target_ids, java.util.Optional<long[]> nodes_truenodeids, java.util.Optional<long[]> target_nodeids, java.util.Optional<long[]> nodes_nodeids, java.util.Optional<Tensor> nodes_hitrates_as_tensor, java.util.Optional<Tensor> base_values_as_tensor, java.util.Optional<Long> n_targets, java.util.Optional<long[]> nodes_missing_value_tracks_true, java.util.Optional<float[]> base_values, java.util.Optional<float[]> nodes_values, java.util.Optional<Tensor> nodes_values_as_tensor) {
30884 return new TreeEnsembleRegressor(resultType, X, aggregate_function, nodes_hitrates, target_weights_as_tensor, nodes_featureids, target_treeids, nodes_treeids, post_transform, nodes_modes, target_weights, nodes_falsenodeids, target_ids, nodes_truenodeids, target_nodeids, nodes_nodeids, nodes_hitrates_as_tensor, base_values_as_tensor, n_targets, nodes_missing_value_tracks_true, base_values, nodes_values, nodes_values_as_tensor);
30885 }
30886
30887 @OpFactoryHelper.OpDeclaration(Trilu.NAME)
30888 public static final class Trilu extends OnnxOp {
30889 public static final String NAME = "Trilu";
30890
30891 public enum Attribute implements OnnxAttribute {
30892 upper(Long.class, true, 1),
30893 ;
30894
30895 final Class<?> t;
30896 final boolean optional;
30897 final Object defaultValue;
30898
30899 Attribute(Class<?> type, boolean optional, Object defaultValue) {
30900 this.t = type;
30901 this.optional = optional;
30902 this.defaultValue = defaultValue;
30903 assert optional || defaultValue == null;
30904 }
30905
30906 public Class<?> type() {
30907 return t;
30908 }
30909
30910 public boolean isOptional() {
30911 return optional;
30912 }
30913
30914 public Object defaultValue() {
30915 return defaultValue;
30916 }
30917 }
30918
30919 public enum TypeConstraint implements OnnxTypeConstraint {
30920 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
30921 ;
30922
30923 final OnnxType.TypeVariable typeVariable;
30924
30925 TypeConstraint(OnnxType.TypeVariable typeVariable) {
30926 assert typeVariable.name().equals(name());
30927 this.typeVariable = typeVariable;
30928 }
30929
30930 @Override
30931 public OnnxType.TypeVariable typeVariable() {
30932 return typeVariable;
30933 }
30934 }
30935
30936 public enum InputParameter implements OnnxParameter {
30937 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
30938 k(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
30939 ;
30940
30941 final OnnxType type;
30942 final Quantifier quantifier;
30943
30944 InputParameter(OnnxType type, Quantifier quantifier) {
30945 this.type = type;
30946 this.quantifier = quantifier;
30947 }
30948
30949 @Override
30950 public OnnxType type() {
30951 return type;
30952 }
30953
30954 @Override
30955 public Quantifier quantifier() {
30956 return quantifier;
30957 }
30958 }
30959
30960 public enum OutputParameter implements OnnxParameter {
30961 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
30962 ;
30963
30964 final OnnxType type;
30965 final Quantifier quantifier;
30966
30967 OutputParameter(OnnxType type, Quantifier quantifier) {
30968 this.type = type;
30969 this.quantifier = quantifier;
30970 }
30971
30972 @Override
30973 public OnnxType type() {
30974 return type;
30975 }
30976
30977 @Override
30978 public Quantifier quantifier() {
30979 return quantifier;
30980 }
30981 }
30982
30983 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
30984 NAME,
30985 List.of(Attribute.values()),
30986 List.of(TypeConstraint.values()),
30987 List.of(InputParameter.values()),
30988 List.of(OutputParameter.values())
30989 );
30990
30991 public Trilu(ExternalizedOp def) {
30992 super(SCHEMA, def);
30993 }
30994
30995 Trilu(Trilu that, CodeContext cc) {
30996 super(that, cc);
30997 }
30998
30999 @Override
31000 public Trilu transform(CodeContext cc, CodeTransformer ot) {
31001 return new Trilu(this, cc);
31002 }
31003
31004 Trilu(TypeElement resultType, Value input, java.util.Optional<Value> k, java.util.Optional<Long> upper) {
31005 super(SCHEMA, resultType, Set.of(), List.of(input, k), List.of(upper));
31006 }
31007
31008 @Override
31009 public SequencedSet<OnnxParameter> onnxOutputs() {
31010 return onnxOutputs(SCHEMA);
31011 }
31012
31013 @Override
31014 public SequencedMap<OnnxParameter, Object> onnxInputs() {
31015 return onnxInputs(SCHEMA, List.of(input(), k()));
31016 }
31017
31018 public Value input() {
31019 return operands().get(0);
31020 }
31021
31022 public java.util.Optional<Value> k() {
31023 int i = optionalInputArguments.indexOf(InputParameter.k);
31024 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty();
31025 }
31026
31027 public java.util.Optional<Long> upper() {
31028 Long upper = Attribute.upper.access(Long.class, onnxAttributes);
31029 return java.util.Optional.ofNullable(upper);
31030 }
31031
31032 }
31033
31034 public static Trilu Trilu(TypeElement resultType, Value input, java.util.Optional<Value> k, java.util.Optional<Long> upper) {
31035 return new Trilu(resultType, input, k, upper);
31036 }
31037
31038 @OpFactoryHelper.OpDeclaration(Unique.NAME)
31039 public static final class Unique extends OnnxOp {
31040 public static final String NAME = "Unique";
31041
31042 public enum Attribute implements OnnxAttribute {
31043 sorted(Long.class, true, 1),
31044 axis(Long.class, true, null),
31045 ;
31046
31047 final Class<?> t;
31048 final boolean optional;
31049 final Object defaultValue;
31050
31051 Attribute(Class<?> type, boolean optional, Object defaultValue) {
31052 this.t = type;
31053 this.optional = optional;
31054 this.defaultValue = defaultValue;
31055 assert optional || defaultValue == null;
31056 }
31057
31058 public Class<?> type() {
31059 return t;
31060 }
31061
31062 public boolean isOptional() {
31063 return optional;
31064 }
31065
31066 public Object defaultValue() {
31067 return defaultValue;
31068 }
31069 }
31070
31071 public enum TypeConstraint implements OnnxTypeConstraint {
31072 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
31073 ;
31074
31075 final OnnxType.TypeVariable typeVariable;
31076
31077 TypeConstraint(OnnxType.TypeVariable typeVariable) {
31078 assert typeVariable.name().equals(name());
31079 this.typeVariable = typeVariable;
31080 }
31081
31082 @Override
31083 public OnnxType.TypeVariable typeVariable() {
31084 return typeVariable;
31085 }
31086 }
31087
31088 public enum InputParameter implements OnnxParameter {
31089 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31090 ;
31091
31092 final OnnxType type;
31093 final Quantifier quantifier;
31094
31095 InputParameter(OnnxType type, Quantifier quantifier) {
31096 this.type = type;
31097 this.quantifier = quantifier;
31098 }
31099
31100 @Override
31101 public OnnxType type() {
31102 return type;
31103 }
31104
31105 @Override
31106 public Quantifier quantifier() {
31107 return quantifier;
31108 }
31109 }
31110
31111 public enum OutputParameter implements OnnxParameter {
31112 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31113 indices(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
31114 inverse_indices(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
31115 counts(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL),
31116 ;
31117
31118 final OnnxType type;
31119 final Quantifier quantifier;
31120
31121 OutputParameter(OnnxType type, Quantifier quantifier) {
31122 this.type = type;
31123 this.quantifier = quantifier;
31124 }
31125
31126 @Override
31127 public OnnxType type() {
31128 return type;
31129 }
31130
31131 @Override
31132 public Quantifier quantifier() {
31133 return quantifier;
31134 }
31135 }
31136
31137 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
31138 NAME,
31139 List.of(Attribute.values()),
31140 List.of(TypeConstraint.values()),
31141 List.of(InputParameter.values()),
31142 List.of(OutputParameter.values())
31143 );
31144
31145 public Unique(ExternalizedOp def) {
31146 super(SCHEMA, def);
31147 }
31148
31149 Unique(Unique that, CodeContext cc) {
31150 super(that, cc);
31151 }
31152
31153 @Override
31154 public Unique transform(CodeContext cc, CodeTransformer ot) {
31155 return new Unique(this, cc);
31156 }
31157
31158 Unique(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value X, java.util.Optional<Long> sorted, java.util.Optional<Long> axis) {
31159 super(SCHEMA, resultType, optionalOutputs, List.of(X), List.of(sorted, axis));
31160 }
31161
31162 @Override
31163 public SequencedSet<OnnxParameter> onnxOutputs() {
31164 return onnxOutputs(SCHEMA);
31165 }
31166
31167 @Override
31168 public SequencedMap<OnnxParameter, Object> onnxInputs() {
31169 return onnxInputs(SCHEMA, List.of(X()));
31170 }
31171
31172 public Value X() {
31173 return operands().get(0);
31174 }
31175
31176 public java.util.Optional<Long> sorted() {
31177 Long sorted = Attribute.sorted.access(Long.class, onnxAttributes);
31178 return java.util.Optional.ofNullable(sorted);
31179 }
31180
31181 public java.util.Optional<Long> axis() {
31182 Long axis = Attribute.axis.access(Long.class, onnxAttributes);
31183 return java.util.Optional.ofNullable(axis);
31184 }
31185
31186 }
31187
31188 public static Unique Unique(TypeElement resultType, Set<Unique.OutputParameter> optionalOutputs, Value X, java.util.Optional<Long> sorted, java.util.Optional<Long> axis) {
31189 return new Unique(resultType, optionalOutputs, X, sorted, axis);
31190 }
31191
31192 @OpFactoryHelper.OpDeclaration(Unsqueeze.NAME)
31193 public static final class Unsqueeze extends OnnxOp {
31194 public static final String NAME = "Unsqueeze";
31195
31196 public enum Attribute implements OnnxAttribute.None { }
31197
31198 public enum TypeConstraint implements OnnxTypeConstraint {
31199 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128()), OnnxType.tensor(OnnxType.float8e4m3fn()), OnnxType.tensor(OnnxType.float8e4m3fnuz()), OnnxType.tensor(OnnxType.float8e5m2()), OnnxType.tensor(OnnxType.float8e5m2fnuz()), OnnxType.tensor(OnnxType.uint4()), OnnxType.tensor(OnnxType.int4()), OnnxType.tensor(OnnxType.float4e2m1()), OnnxType.tensor(OnnxType.float8e8m0())))),
31200 ;
31201
31202 final OnnxType.TypeVariable typeVariable;
31203
31204 TypeConstraint(OnnxType.TypeVariable typeVariable) {
31205 assert typeVariable.name().equals(name());
31206 this.typeVariable = typeVariable;
31207 }
31208
31209 @Override
31210 public OnnxType.TypeVariable typeVariable() {
31211 return typeVariable;
31212 }
31213 }
31214
31215 public enum InputParameter implements OnnxParameter {
31216 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31217 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED),
31218 ;
31219
31220 final OnnxType type;
31221 final Quantifier quantifier;
31222
31223 InputParameter(OnnxType type, Quantifier quantifier) {
31224 this.type = type;
31225 this.quantifier = quantifier;
31226 }
31227
31228 @Override
31229 public OnnxType type() {
31230 return type;
31231 }
31232
31233 @Override
31234 public Quantifier quantifier() {
31235 return quantifier;
31236 }
31237 }
31238
31239 public enum OutputParameter implements OnnxParameter {
31240 expanded(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31241 ;
31242
31243 final OnnxType type;
31244 final Quantifier quantifier;
31245
31246 OutputParameter(OnnxType type, Quantifier quantifier) {
31247 this.type = type;
31248 this.quantifier = quantifier;
31249 }
31250
31251 @Override
31252 public OnnxType type() {
31253 return type;
31254 }
31255
31256 @Override
31257 public Quantifier quantifier() {
31258 return quantifier;
31259 }
31260 }
31261
31262 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
31263 NAME,
31264 List.of(Attribute.values()),
31265 List.of(TypeConstraint.values()),
31266 List.of(InputParameter.values()),
31267 List.of(OutputParameter.values())
31268 );
31269
31270 public Unsqueeze(ExternalizedOp def) {
31271 super(SCHEMA, def);
31272 }
31273
31274 Unsqueeze(Unsqueeze that, CodeContext cc) {
31275 super(that, cc);
31276 }
31277
31278 @Override
31279 public Unsqueeze transform(CodeContext cc, CodeTransformer ot) {
31280 return new Unsqueeze(this, cc);
31281 }
31282
31283 Unsqueeze(TypeElement resultType, Value data, Value axes) {
31284 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of());
31285 }
31286
31287 @Override
31288 public SequencedSet<OnnxParameter> onnxOutputs() {
31289 return onnxOutputs(SCHEMA);
31290 }
31291
31292 @Override
31293 public SequencedMap<OnnxParameter, Object> onnxInputs() {
31294 return onnxInputs(SCHEMA, List.of(data(), axes()));
31295 }
31296
31297 public Value data() {
31298 return operands().get(0);
31299 }
31300
31301 public Value axes() {
31302 return operands().get(1);
31303 }
31304
31305 }
31306
31307 public static Unsqueeze Unsqueeze(TypeElement resultType, Value data, Value axes) {
31308 return new Unsqueeze(resultType, data, axes);
31309 }
31310
31311 @OpFactoryHelper.OpDeclaration(Upsample.NAME)
31312 public static final class Upsample extends OnnxOp {
31313 public static final String NAME = "Upsample";
31314
31315 public enum Attribute implements OnnxAttribute {
31316 mode(String.class, true, "nearest"),
31317 ;
31318
31319 final Class<?> t;
31320 final boolean optional;
31321 final Object defaultValue;
31322
31323 Attribute(Class<?> type, boolean optional, Object defaultValue) {
31324 this.t = type;
31325 this.optional = optional;
31326 this.defaultValue = defaultValue;
31327 assert optional || defaultValue == null;
31328 }
31329
31330 public Class<?> type() {
31331 return t;
31332 }
31333
31334 public boolean isOptional() {
31335 return optional;
31336 }
31337
31338 public Object defaultValue() {
31339 return defaultValue;
31340 }
31341 }
31342
31343 public enum TypeConstraint implements OnnxTypeConstraint {
31344 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
31345 ;
31346
31347 final OnnxType.TypeVariable typeVariable;
31348
31349 TypeConstraint(OnnxType.TypeVariable typeVariable) {
31350 assert typeVariable.name().equals(name());
31351 this.typeVariable = typeVariable;
31352 }
31353
31354 @Override
31355 public OnnxType.TypeVariable typeVariable() {
31356 return typeVariable;
31357 }
31358 }
31359
31360 public enum InputParameter implements OnnxParameter {
31361 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31362 scales(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
31363 ;
31364
31365 final OnnxType type;
31366 final Quantifier quantifier;
31367
31368 InputParameter(OnnxType type, Quantifier quantifier) {
31369 this.type = type;
31370 this.quantifier = quantifier;
31371 }
31372
31373 @Override
31374 public OnnxType type() {
31375 return type;
31376 }
31377
31378 @Override
31379 public Quantifier quantifier() {
31380 return quantifier;
31381 }
31382 }
31383
31384 public enum OutputParameter implements OnnxParameter {
31385 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31386 ;
31387
31388 final OnnxType type;
31389 final Quantifier quantifier;
31390
31391 OutputParameter(OnnxType type, Quantifier quantifier) {
31392 this.type = type;
31393 this.quantifier = quantifier;
31394 }
31395
31396 @Override
31397 public OnnxType type() {
31398 return type;
31399 }
31400
31401 @Override
31402 public Quantifier quantifier() {
31403 return quantifier;
31404 }
31405 }
31406
31407 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
31408 NAME,
31409 List.of(Attribute.values()),
31410 List.of(TypeConstraint.values()),
31411 List.of(InputParameter.values()),
31412 List.of(OutputParameter.values())
31413 );
31414
31415 public Upsample(ExternalizedOp def) {
31416 super(SCHEMA, def);
31417 }
31418
31419 Upsample(Upsample that, CodeContext cc) {
31420 super(that, cc);
31421 }
31422
31423 @Override
31424 public Upsample transform(CodeContext cc, CodeTransformer ot) {
31425 return new Upsample(this, cc);
31426 }
31427
31428 Upsample(TypeElement resultType, Value X, Value scales, java.util.Optional<String> mode) {
31429 super(SCHEMA, resultType, Set.of(), List.of(X, scales), List.of(mode));
31430 }
31431
31432 @Override
31433 public SequencedSet<OnnxParameter> onnxOutputs() {
31434 return onnxOutputs(SCHEMA);
31435 }
31436
31437 @Override
31438 public SequencedMap<OnnxParameter, Object> onnxInputs() {
31439 return onnxInputs(SCHEMA, List.of(X(), scales()));
31440 }
31441
31442 public Value X() {
31443 return operands().get(0);
31444 }
31445
31446 public Value scales() {
31447 return operands().get(1);
31448 }
31449
31450 public java.util.Optional<String> mode() {
31451 String mode = Attribute.mode.access(String.class, onnxAttributes);
31452 return java.util.Optional.ofNullable(mode);
31453 }
31454
31455 }
31456
31457 public static Upsample Upsample(TypeElement resultType, Value X, Value scales, java.util.Optional<String> mode) {
31458 return new Upsample(resultType, X, scales, mode);
31459 }
31460
31461 @OpFactoryHelper.OpDeclaration(Where.NAME)
31462 public static final class Where extends OnnxOp {
31463 public static final String NAME = "Where";
31464
31465 public enum Attribute implements OnnxAttribute.None { }
31466
31467 public enum TypeConstraint implements OnnxTypeConstraint {
31468 B(new OnnxType.TypeVariable("B", List.of(OnnxType.tensor(OnnxType.bool())))),
31469 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64()), OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.int16()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.bool()), OnnxType.tensor(OnnxType.complex64()), OnnxType.tensor(OnnxType.complex128())))),
31470 ;
31471
31472 final OnnxType.TypeVariable typeVariable;
31473
31474 TypeConstraint(OnnxType.TypeVariable typeVariable) {
31475 assert typeVariable.name().equals(name());
31476 this.typeVariable = typeVariable;
31477 }
31478
31479 @Override
31480 public OnnxType.TypeVariable typeVariable() {
31481 return typeVariable;
31482 }
31483 }
31484
31485 public enum InputParameter implements OnnxParameter {
31486 condition(TypeConstraint.B.typeVariable(), Quantifier.REQUIRED),
31487 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31488 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31489 ;
31490
31491 final OnnxType type;
31492 final Quantifier quantifier;
31493
31494 InputParameter(OnnxType type, Quantifier quantifier) {
31495 this.type = type;
31496 this.quantifier = quantifier;
31497 }
31498
31499 @Override
31500 public OnnxType type() {
31501 return type;
31502 }
31503
31504 @Override
31505 public Quantifier quantifier() {
31506 return quantifier;
31507 }
31508 }
31509
31510 public enum OutputParameter implements OnnxParameter {
31511 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31512 ;
31513
31514 final OnnxType type;
31515 final Quantifier quantifier;
31516
31517 OutputParameter(OnnxType type, Quantifier quantifier) {
31518 this.type = type;
31519 this.quantifier = quantifier;
31520 }
31521
31522 @Override
31523 public OnnxType type() {
31524 return type;
31525 }
31526
31527 @Override
31528 public Quantifier quantifier() {
31529 return quantifier;
31530 }
31531 }
31532
31533 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
31534 NAME,
31535 List.of(Attribute.values()),
31536 List.of(TypeConstraint.values()),
31537 List.of(InputParameter.values()),
31538 List.of(OutputParameter.values())
31539 );
31540
31541 public Where(ExternalizedOp def) {
31542 super(SCHEMA, def);
31543 }
31544
31545 Where(Where that, CodeContext cc) {
31546 super(that, cc);
31547 }
31548
31549 @Override
31550 public Where transform(CodeContext cc, CodeTransformer ot) {
31551 return new Where(this, cc);
31552 }
31553
31554 Where(TypeElement resultType, Value condition, Value X, Value Y) {
31555 super(SCHEMA, resultType, Set.of(), List.of(condition, X, Y), List.of());
31556 }
31557
31558 @Override
31559 public SequencedSet<OnnxParameter> onnxOutputs() {
31560 return onnxOutputs(SCHEMA);
31561 }
31562
31563 @Override
31564 public SequencedMap<OnnxParameter, Object> onnxInputs() {
31565 return onnxInputs(SCHEMA, List.of(condition(), X(), Y()));
31566 }
31567
31568 public Value condition() {
31569 return operands().get(0);
31570 }
31571
31572 public Value X() {
31573 return operands().get(1);
31574 }
31575
31576 public Value Y() {
31577 return operands().get(2);
31578 }
31579
31580 }
31581
31582 public static Where Where(TypeElement resultType, Value condition, Value X, Value Y) {
31583 return new Where(resultType, condition, X, Y);
31584 }
31585
31586 @OpFactoryHelper.OpDeclaration(Xor.NAME)
31587 public static final class Xor extends OnnxOp {
31588 public static final String NAME = "Xor";
31589
31590 public enum Attribute implements OnnxAttribute.None { }
31591
31592 public enum TypeConstraint implements OnnxTypeConstraint {
31593 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bool())))),
31594 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))),
31595 ;
31596
31597 final OnnxType.TypeVariable typeVariable;
31598
31599 TypeConstraint(OnnxType.TypeVariable typeVariable) {
31600 assert typeVariable.name().equals(name());
31601 this.typeVariable = typeVariable;
31602 }
31603
31604 @Override
31605 public OnnxType.TypeVariable typeVariable() {
31606 return typeVariable;
31607 }
31608 }
31609
31610 public enum InputParameter implements OnnxParameter {
31611 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31612 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31613 ;
31614
31615 final OnnxType type;
31616 final Quantifier quantifier;
31617
31618 InputParameter(OnnxType type, Quantifier quantifier) {
31619 this.type = type;
31620 this.quantifier = quantifier;
31621 }
31622
31623 @Override
31624 public OnnxType type() {
31625 return type;
31626 }
31627
31628 @Override
31629 public Quantifier quantifier() {
31630 return quantifier;
31631 }
31632 }
31633
31634 public enum OutputParameter implements OnnxParameter {
31635 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED),
31636 ;
31637
31638 final OnnxType type;
31639 final Quantifier quantifier;
31640
31641 OutputParameter(OnnxType type, Quantifier quantifier) {
31642 this.type = type;
31643 this.quantifier = quantifier;
31644 }
31645
31646 @Override
31647 public OnnxType type() {
31648 return type;
31649 }
31650
31651 @Override
31652 public Quantifier quantifier() {
31653 return quantifier;
31654 }
31655 }
31656
31657 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
31658 NAME,
31659 List.of(Attribute.values()),
31660 List.of(TypeConstraint.values()),
31661 List.of(InputParameter.values()),
31662 List.of(OutputParameter.values())
31663 );
31664
31665 public Xor(ExternalizedOp def) {
31666 super(SCHEMA, def);
31667 }
31668
31669 Xor(Xor that, CodeContext cc) {
31670 super(that, cc);
31671 }
31672
31673 @Override
31674 public Xor transform(CodeContext cc, CodeTransformer ot) {
31675 return new Xor(this, cc);
31676 }
31677
31678 Xor(TypeElement resultType, Value A, Value B) {
31679 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of());
31680 }
31681
31682 @Override
31683 public SequencedSet<OnnxParameter> onnxOutputs() {
31684 return onnxOutputs(SCHEMA);
31685 }
31686
31687 @Override
31688 public SequencedMap<OnnxParameter, Object> onnxInputs() {
31689 return onnxInputs(SCHEMA, List.of(A(), B()));
31690 }
31691
31692 public Value A() {
31693 return operands().get(0);
31694 }
31695
31696 public Value B() {
31697 return operands().get(1);
31698 }
31699
31700 }
31701
31702 public static Xor Xor(TypeElement resultType, Value A, Value B) {
31703 return new Xor(resultType, A, B);
31704 }
31705
31706 @OpFactoryHelper.OpDeclaration(ZipMap.NAME)
31707 public static final class ZipMap extends OnnxOp {
31708 public static final String NAME = "ZipMap";
31709
31710 public enum Attribute implements OnnxAttribute {
31711 classlabels_int64s(long[].class, true, null),
31712 classlabels_strings(String[].class, true, null),
31713 ;
31714
31715 final Class<?> t;
31716 final boolean optional;
31717 final Object defaultValue;
31718
31719 Attribute(Class<?> type, boolean optional, Object defaultValue) {
31720 this.t = type;
31721 this.optional = optional;
31722 this.defaultValue = defaultValue;
31723 assert optional || defaultValue == null;
31724 }
31725
31726 public Class<?> type() {
31727 return t;
31728 }
31729
31730 public boolean isOptional() {
31731 return optional;
31732 }
31733
31734 public Object defaultValue() {
31735 return defaultValue;
31736 }
31737 }
31738
31739 public enum TypeConstraint implements OnnxTypeConstraint {
31740 T(new OnnxType.TypeVariable("T", List.of(OnnxType.seq(OnnxType.map(OnnxType.string(), OnnxType.float32())), OnnxType.seq(OnnxType.map(OnnxType.int64(), OnnxType.float32()))))),
31741 ;
31742
31743 final OnnxType.TypeVariable typeVariable;
31744
31745 TypeConstraint(OnnxType.TypeVariable typeVariable) {
31746 assert typeVariable.name().equals(name());
31747 this.typeVariable = typeVariable;
31748 }
31749
31750 @Override
31751 public OnnxType.TypeVariable typeVariable() {
31752 return typeVariable;
31753 }
31754 }
31755
31756 public enum InputParameter implements OnnxParameter {
31757 X(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED),
31758 ;
31759
31760 final OnnxType type;
31761 final Quantifier quantifier;
31762
31763 InputParameter(OnnxType type, Quantifier quantifier) {
31764 this.type = type;
31765 this.quantifier = quantifier;
31766 }
31767
31768 @Override
31769 public OnnxType type() {
31770 return type;
31771 }
31772
31773 @Override
31774 public Quantifier quantifier() {
31775 return quantifier;
31776 }
31777 }
31778
31779 public enum OutputParameter implements OnnxParameter {
31780 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED),
31781 ;
31782
31783 final OnnxType type;
31784 final Quantifier quantifier;
31785
31786 OutputParameter(OnnxType type, Quantifier quantifier) {
31787 this.type = type;
31788 this.quantifier = quantifier;
31789 }
31790
31791 @Override
31792 public OnnxType type() {
31793 return type;
31794 }
31795
31796 @Override
31797 public Quantifier quantifier() {
31798 return quantifier;
31799 }
31800 }
31801
31802 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord(
31803 NAME,
31804 List.of(Attribute.values()),
31805 List.of(TypeConstraint.values()),
31806 List.of(InputParameter.values()),
31807 List.of(OutputParameter.values())
31808 );
31809
31810 public ZipMap(ExternalizedOp def) {
31811 super(SCHEMA, def);
31812 }
31813
31814 ZipMap(ZipMap that, CodeContext cc) {
31815 super(that, cc);
31816 }
31817
31818 @Override
31819 public ZipMap transform(CodeContext cc, CodeTransformer ot) {
31820 return new ZipMap(this, cc);
31821 }
31822
31823 ZipMap(TypeElement resultType, Value X, java.util.Optional<long[]> classlabels_int64s, java.util.Optional<String[]> classlabels_strings) {
31824 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(classlabels_int64s, classlabels_strings));
31825 }
31826
31827 @Override
31828 public SequencedSet<OnnxParameter> onnxOutputs() {
31829 return onnxOutputs(SCHEMA);
31830 }
31831
31832 @Override
31833 public SequencedMap<OnnxParameter, Object> onnxInputs() {
31834 return onnxInputs(SCHEMA, List.of(X()));
31835 }
31836
31837 public Value X() {
31838 return operands().get(0);
31839 }
31840
31841 public java.util.Optional<long[]> classlabels_int64s() {
31842 long[] classlabels_int64s = Attribute.classlabels_int64s.access(long[].class, onnxAttributes);
31843 return java.util.Optional.ofNullable(classlabels_int64s).map(long[]::clone);
31844 }
31845
31846 public java.util.Optional<String[]> classlabels_strings() {
31847 String[] classlabels_strings = Attribute.classlabels_strings.access(String[].class, onnxAttributes);
31848 return java.util.Optional.ofNullable(classlabels_strings).map(String[]::clone);
31849 }
31850
31851 }
31852
31853 public static ZipMap ZipMap(TypeElement resultType, Value X, java.util.Optional<long[]> classlabels_int64s, java.util.Optional<String[]> classlabels_strings) {
31854 return new ZipMap(resultType, X, classlabels_int64s, classlabels_strings);
31855 }
31856
31857 }