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.op.OpFactory; 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 @OpFactory.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, CopyContext cc) { 122 super(that, cc); 123 } 124 125 @Override 126 public Abs transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 236 super(that, cc); 237 } 238 239 @Override 240 public Acos transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 350 super(that, cc); 351 } 352 353 @Override 354 public Acosh transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 496 super(that, cc); 497 } 498 499 @Override 500 public Adagrad transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 667 super(that, cc); 668 } 669 670 @Override 671 public Adam transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 815 super(that, cc); 816 } 817 818 @Override 819 public Add transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 961 super(that, cc); 962 } 963 964 @Override 965 public AffineGrid transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 1086 super(that, cc); 1087 } 1088 1089 @Override 1090 public And transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 1232 super(that, cc); 1233 } 1234 1235 @Override 1236 public ArgMax transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 1389 super(that, cc); 1390 } 1391 1392 @Override 1393 public ArgMin transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 1519 super(that, cc); 1520 } 1521 1522 @Override 1523 public ArrayFeatureExtractor transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 1637 super(that, cc); 1638 } 1639 1640 @Override 1641 public Asin transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 1751 super(that, cc); 1752 } 1753 1754 @Override 1755 public Asinh transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 1865 super(that, cc); 1866 } 1867 1868 @Override 1869 public Atan transform(CopyContext cc, OpTransformer 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 @OpFactory.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, CopyContext cc) { 1979 super(that, cc); 1980 } 1981 1982 @Override 1983 public Atanh transform(CopyContext cc, OpTransformer 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 @OpFactory.OpDeclaration(AveragePool.NAME) 2012 public static final class AveragePool extends OnnxOp { 2013 public static final String NAME = "AveragePool"; 2014 2015 public enum Attribute implements OnnxAttribute { 2016 pads(long[].class, true, null), 2017 dilations(long[].class, true, null), 2018 auto_pad(String.class, true, "NOTSET"), 2019 count_include_pad(Long.class, true, 0), 2020 ceil_mode(Long.class, true, 0), 2021 strides(long[].class, true, null), 2022 kernel_shape(long[].class, false, 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 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 2051 ; 2052 2053 final OnnxType.TypeVariable typeVariable; 2054 2055 TypeConstraint(OnnxType.TypeVariable typeVariable) { 2056 assert typeVariable.name().equals(name()); 2057 this.typeVariable = typeVariable; 2058 } 2059 2060 @Override 2061 public OnnxType.TypeVariable typeVariable() { 2062 return typeVariable; 2063 } 2064 } 2065 2066 public enum InputParameter implements OnnxParameter { 2067 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2068 ; 2069 2070 final OnnxType type; 2071 final Quantifier quantifier; 2072 2073 InputParameter(OnnxType type, Quantifier quantifier) { 2074 this.type = type; 2075 this.quantifier = quantifier; 2076 } 2077 2078 @Override 2079 public OnnxType type() { 2080 return type; 2081 } 2082 2083 @Override 2084 public Quantifier quantifier() { 2085 return quantifier; 2086 } 2087 } 2088 2089 public enum OutputParameter implements OnnxParameter { 2090 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2091 ; 2092 2093 final OnnxType type; 2094 final Quantifier quantifier; 2095 2096 OutputParameter(OnnxType type, Quantifier quantifier) { 2097 this.type = type; 2098 this.quantifier = quantifier; 2099 } 2100 2101 @Override 2102 public OnnxType type() { 2103 return type; 2104 } 2105 2106 @Override 2107 public Quantifier quantifier() { 2108 return quantifier; 2109 } 2110 } 2111 2112 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 2113 NAME, 2114 List.of(Attribute.values()), 2115 List.of(TypeConstraint.values()), 2116 List.of(InputParameter.values()), 2117 List.of(OutputParameter.values()) 2118 ); 2119 2120 public AveragePool(ExternalizedOp def) { 2121 super(SCHEMA, def); 2122 } 2123 2124 AveragePool(AveragePool that, CopyContext cc) { 2125 super(that, cc); 2126 } 2127 2128 @Override 2129 public AveragePool transform(CopyContext cc, OpTransformer ot) { 2130 return new AveragePool(this, cc); 2131 } 2132 2133 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) { 2134 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(pads, dilations, auto_pad, count_include_pad, ceil_mode, strides, kernel_shape)); 2135 } 2136 2137 @Override 2138 public SequencedSet<OnnxParameter> onnxOutputs() { 2139 return onnxOutputs(SCHEMA); 2140 } 2141 2142 @Override 2143 public SequencedMap<OnnxParameter, Object> onnxInputs() { 2144 return onnxInputs(SCHEMA, List.of(X())); 2145 } 2146 2147 public Value X() { 2148 return operands().get(0); 2149 } 2150 2151 public java.util.Optional<long[]> pads() { 2152 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 2153 return java.util.Optional.ofNullable(pads).map(long[]::clone); 2154 } 2155 2156 public java.util.Optional<long[]> dilations() { 2157 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 2158 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 2159 } 2160 2161 public java.util.Optional<String> auto_pad() { 2162 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes); 2163 return java.util.Optional.ofNullable(auto_pad); 2164 } 2165 2166 public java.util.Optional<Long> count_include_pad() { 2167 Long count_include_pad = Attribute.count_include_pad.access(Long.class, onnxAttributes); 2168 return java.util.Optional.ofNullable(count_include_pad); 2169 } 2170 2171 public java.util.Optional<Long> ceil_mode() { 2172 Long ceil_mode = Attribute.ceil_mode.access(Long.class, onnxAttributes); 2173 return java.util.Optional.ofNullable(ceil_mode); 2174 } 2175 2176 public java.util.Optional<long[]> strides() { 2177 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 2178 return java.util.Optional.ofNullable(strides).map(long[]::clone); 2179 } 2180 2181 public long[] kernel_shape() { 2182 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 2183 return kernel_shape.clone(); 2184 } 2185 2186 } 2187 2188 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) { 2189 return new AveragePool(resultType, X, pads, dilations, auto_pad, count_include_pad, ceil_mode, strides, kernel_shape); 2190 } 2191 2192 @OpFactory.OpDeclaration(BatchNormalization.NAME) 2193 public static final class BatchNormalization extends OnnxOp { 2194 public static final String NAME = "BatchNormalization"; 2195 2196 public enum Attribute implements OnnxAttribute { 2197 epsilon(Float.class, true, 1.0E-5f), 2198 training_mode(Long.class, true, 0), 2199 momentum(Float.class, true, 0.9f), 2200 ; 2201 2202 final Class<?> t; 2203 final boolean optional; 2204 final Object defaultValue; 2205 2206 Attribute(Class<?> type, boolean optional, Object defaultValue) { 2207 this.t = type; 2208 this.optional = optional; 2209 this.defaultValue = defaultValue; 2210 assert optional || defaultValue == null; 2211 } 2212 2213 public Class<?> type() { 2214 return t; 2215 } 2216 2217 public boolean isOptional() { 2218 return optional; 2219 } 2220 2221 public Object defaultValue() { 2222 return defaultValue; 2223 } 2224 } 2225 2226 public enum TypeConstraint implements OnnxTypeConstraint { 2227 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 2228 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 2229 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 2230 ; 2231 2232 final OnnxType.TypeVariable typeVariable; 2233 2234 TypeConstraint(OnnxType.TypeVariable typeVariable) { 2235 assert typeVariable.name().equals(name()); 2236 this.typeVariable = typeVariable; 2237 } 2238 2239 @Override 2240 public OnnxType.TypeVariable typeVariable() { 2241 return typeVariable; 2242 } 2243 } 2244 2245 public enum InputParameter implements OnnxParameter { 2246 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2247 scale(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 2248 B(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 2249 input_mean(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 2250 input_var(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 2251 ; 2252 2253 final OnnxType type; 2254 final Quantifier quantifier; 2255 2256 InputParameter(OnnxType type, Quantifier quantifier) { 2257 this.type = type; 2258 this.quantifier = quantifier; 2259 } 2260 2261 @Override 2262 public OnnxType type() { 2263 return type; 2264 } 2265 2266 @Override 2267 public Quantifier quantifier() { 2268 return quantifier; 2269 } 2270 } 2271 2272 public enum OutputParameter implements OnnxParameter { 2273 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2274 running_mean(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 2275 running_var(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 2276 ; 2277 2278 final OnnxType type; 2279 final Quantifier quantifier; 2280 2281 OutputParameter(OnnxType type, Quantifier quantifier) { 2282 this.type = type; 2283 this.quantifier = quantifier; 2284 } 2285 2286 @Override 2287 public OnnxType type() { 2288 return type; 2289 } 2290 2291 @Override 2292 public Quantifier quantifier() { 2293 return quantifier; 2294 } 2295 } 2296 2297 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 2298 NAME, 2299 List.of(Attribute.values()), 2300 List.of(TypeConstraint.values()), 2301 List.of(InputParameter.values()), 2302 List.of(OutputParameter.values()) 2303 ); 2304 2305 public BatchNormalization(ExternalizedOp def) { 2306 super(SCHEMA, def); 2307 } 2308 2309 BatchNormalization(BatchNormalization that, CopyContext cc) { 2310 super(that, cc); 2311 } 2312 2313 @Override 2314 public BatchNormalization transform(CopyContext cc, OpTransformer ot) { 2315 return new BatchNormalization(this, cc); 2316 } 2317 2318 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) { 2319 super(SCHEMA, resultType, optionalOutputs, List.of(X, scale, B, input_mean, input_var), List.of(epsilon, training_mode, momentum)); 2320 } 2321 2322 @Override 2323 public SequencedSet<OnnxParameter> onnxOutputs() { 2324 return onnxOutputs(SCHEMA); 2325 } 2326 2327 @Override 2328 public SequencedMap<OnnxParameter, Object> onnxInputs() { 2329 return onnxInputs(SCHEMA, List.of(X(), scale(), B(), input_mean(), input_var())); 2330 } 2331 2332 public Value X() { 2333 return operands().get(0); 2334 } 2335 2336 public Value scale() { 2337 return operands().get(1); 2338 } 2339 2340 public Value B() { 2341 return operands().get(2); 2342 } 2343 2344 public Value input_mean() { 2345 return operands().get(3); 2346 } 2347 2348 public Value input_var() { 2349 return operands().get(4); 2350 } 2351 2352 public java.util.Optional<Float> epsilon() { 2353 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes); 2354 return java.util.Optional.ofNullable(epsilon); 2355 } 2356 2357 public java.util.Optional<Long> training_mode() { 2358 Long training_mode = Attribute.training_mode.access(Long.class, onnxAttributes); 2359 return java.util.Optional.ofNullable(training_mode); 2360 } 2361 2362 public java.util.Optional<Float> momentum() { 2363 Float momentum = Attribute.momentum.access(Float.class, onnxAttributes); 2364 return java.util.Optional.ofNullable(momentum); 2365 } 2366 2367 } 2368 2369 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) { 2370 return new BatchNormalization(resultType, optionalOutputs, X, scale, B, input_mean, input_var, epsilon, training_mode, momentum); 2371 } 2372 2373 @OpFactory.OpDeclaration(Bernoulli.NAME) 2374 public static final class Bernoulli extends OnnxOp { 2375 public static final String NAME = "Bernoulli"; 2376 2377 public enum Attribute implements OnnxAttribute { 2378 seed(Float.class, true, null), 2379 dtype(Long.class, true, null), 2380 ; 2381 2382 final Class<?> t; 2383 final boolean optional; 2384 final Object defaultValue; 2385 2386 Attribute(Class<?> type, boolean optional, Object defaultValue) { 2387 this.t = type; 2388 this.optional = optional; 2389 this.defaultValue = defaultValue; 2390 assert optional || defaultValue == null; 2391 } 2392 2393 public Class<?> type() { 2394 return t; 2395 } 2396 2397 public boolean isOptional() { 2398 return optional; 2399 } 2400 2401 public Object defaultValue() { 2402 return defaultValue; 2403 } 2404 } 2405 2406 public enum TypeConstraint implements OnnxTypeConstraint { 2407 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 2408 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())))), 2409 ; 2410 2411 final OnnxType.TypeVariable typeVariable; 2412 2413 TypeConstraint(OnnxType.TypeVariable typeVariable) { 2414 assert typeVariable.name().equals(name()); 2415 this.typeVariable = typeVariable; 2416 } 2417 2418 @Override 2419 public OnnxType.TypeVariable typeVariable() { 2420 return typeVariable; 2421 } 2422 } 2423 2424 public enum InputParameter implements OnnxParameter { 2425 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 2426 ; 2427 2428 final OnnxType type; 2429 final Quantifier quantifier; 2430 2431 InputParameter(OnnxType type, Quantifier quantifier) { 2432 this.type = type; 2433 this.quantifier = quantifier; 2434 } 2435 2436 @Override 2437 public OnnxType type() { 2438 return type; 2439 } 2440 2441 @Override 2442 public Quantifier quantifier() { 2443 return quantifier; 2444 } 2445 } 2446 2447 public enum OutputParameter implements OnnxParameter { 2448 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 2449 ; 2450 2451 final OnnxType type; 2452 final Quantifier quantifier; 2453 2454 OutputParameter(OnnxType type, Quantifier quantifier) { 2455 this.type = type; 2456 this.quantifier = quantifier; 2457 } 2458 2459 @Override 2460 public OnnxType type() { 2461 return type; 2462 } 2463 2464 @Override 2465 public Quantifier quantifier() { 2466 return quantifier; 2467 } 2468 } 2469 2470 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 2471 NAME, 2472 List.of(Attribute.values()), 2473 List.of(TypeConstraint.values()), 2474 List.of(InputParameter.values()), 2475 List.of(OutputParameter.values()) 2476 ); 2477 2478 public Bernoulli(ExternalizedOp def) { 2479 super(SCHEMA, def); 2480 } 2481 2482 Bernoulli(Bernoulli that, CopyContext cc) { 2483 super(that, cc); 2484 } 2485 2486 @Override 2487 public Bernoulli transform(CopyContext cc, OpTransformer ot) { 2488 return new Bernoulli(this, cc); 2489 } 2490 2491 Bernoulli(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Long> dtype) { 2492 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(seed, dtype)); 2493 } 2494 2495 @Override 2496 public SequencedSet<OnnxParameter> onnxOutputs() { 2497 return onnxOutputs(SCHEMA); 2498 } 2499 2500 @Override 2501 public SequencedMap<OnnxParameter, Object> onnxInputs() { 2502 return onnxInputs(SCHEMA, List.of(input())); 2503 } 2504 2505 public Value input() { 2506 return operands().get(0); 2507 } 2508 2509 public java.util.Optional<Float> seed() { 2510 Float seed = Attribute.seed.access(Float.class, onnxAttributes); 2511 return java.util.Optional.ofNullable(seed); 2512 } 2513 2514 public java.util.Optional<Long> dtype() { 2515 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes); 2516 return java.util.Optional.ofNullable(dtype); 2517 } 2518 2519 } 2520 2521 public static Bernoulli Bernoulli(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Long> dtype) { 2522 return new Bernoulli(resultType, input, seed, dtype); 2523 } 2524 2525 @OpFactory.OpDeclaration(Binarizer.NAME) 2526 public static final class Binarizer extends OnnxOp { 2527 public static final String NAME = "Binarizer"; 2528 2529 public enum Attribute implements OnnxAttribute { 2530 threshold(Float.class, true, 0.0f), 2531 ; 2532 2533 final Class<?> t; 2534 final boolean optional; 2535 final Object defaultValue; 2536 2537 Attribute(Class<?> type, boolean optional, Object defaultValue) { 2538 this.t = type; 2539 this.optional = optional; 2540 this.defaultValue = defaultValue; 2541 assert optional || defaultValue == null; 2542 } 2543 2544 public Class<?> type() { 2545 return t; 2546 } 2547 2548 public boolean isOptional() { 2549 return optional; 2550 } 2551 2552 public Object defaultValue() { 2553 return defaultValue; 2554 } 2555 } 2556 2557 public enum TypeConstraint implements OnnxTypeConstraint { 2558 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 2559 ; 2560 2561 final OnnxType.TypeVariable typeVariable; 2562 2563 TypeConstraint(OnnxType.TypeVariable typeVariable) { 2564 assert typeVariable.name().equals(name()); 2565 this.typeVariable = typeVariable; 2566 } 2567 2568 @Override 2569 public OnnxType.TypeVariable typeVariable() { 2570 return typeVariable; 2571 } 2572 } 2573 2574 public enum InputParameter implements OnnxParameter { 2575 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2576 ; 2577 2578 final OnnxType type; 2579 final Quantifier quantifier; 2580 2581 InputParameter(OnnxType type, Quantifier quantifier) { 2582 this.type = type; 2583 this.quantifier = quantifier; 2584 } 2585 2586 @Override 2587 public OnnxType type() { 2588 return type; 2589 } 2590 2591 @Override 2592 public Quantifier quantifier() { 2593 return quantifier; 2594 } 2595 } 2596 2597 public enum OutputParameter implements OnnxParameter { 2598 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2599 ; 2600 2601 final OnnxType type; 2602 final Quantifier quantifier; 2603 2604 OutputParameter(OnnxType type, Quantifier quantifier) { 2605 this.type = type; 2606 this.quantifier = quantifier; 2607 } 2608 2609 @Override 2610 public OnnxType type() { 2611 return type; 2612 } 2613 2614 @Override 2615 public Quantifier quantifier() { 2616 return quantifier; 2617 } 2618 } 2619 2620 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 2621 NAME, 2622 List.of(Attribute.values()), 2623 List.of(TypeConstraint.values()), 2624 List.of(InputParameter.values()), 2625 List.of(OutputParameter.values()) 2626 ); 2627 2628 public Binarizer(ExternalizedOp def) { 2629 super(SCHEMA, def); 2630 } 2631 2632 Binarizer(Binarizer that, CopyContext cc) { 2633 super(that, cc); 2634 } 2635 2636 @Override 2637 public Binarizer transform(CopyContext cc, OpTransformer ot) { 2638 return new Binarizer(this, cc); 2639 } 2640 2641 Binarizer(TypeElement resultType, Value X, java.util.Optional<Float> threshold) { 2642 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(threshold)); 2643 } 2644 2645 @Override 2646 public SequencedSet<OnnxParameter> onnxOutputs() { 2647 return onnxOutputs(SCHEMA); 2648 } 2649 2650 @Override 2651 public SequencedMap<OnnxParameter, Object> onnxInputs() { 2652 return onnxInputs(SCHEMA, List.of(X())); 2653 } 2654 2655 public Value X() { 2656 return operands().get(0); 2657 } 2658 2659 public java.util.Optional<Float> threshold() { 2660 Float threshold = Attribute.threshold.access(Float.class, onnxAttributes); 2661 return java.util.Optional.ofNullable(threshold); 2662 } 2663 2664 } 2665 2666 public static Binarizer Binarizer(TypeElement resultType, Value X, java.util.Optional<Float> threshold) { 2667 return new Binarizer(resultType, X, threshold); 2668 } 2669 2670 @OpFactory.OpDeclaration(BitShift.NAME) 2671 public static final class BitShift extends OnnxOp { 2672 public static final String NAME = "BitShift"; 2673 2674 public enum Attribute implements OnnxAttribute { 2675 direction(String.class, false, null), 2676 ; 2677 2678 final Class<?> t; 2679 final boolean optional; 2680 final Object defaultValue; 2681 2682 Attribute(Class<?> type, boolean optional, Object defaultValue) { 2683 this.t = type; 2684 this.optional = optional; 2685 this.defaultValue = defaultValue; 2686 assert optional || defaultValue == null; 2687 } 2688 2689 public Class<?> type() { 2690 return t; 2691 } 2692 2693 public boolean isOptional() { 2694 return optional; 2695 } 2696 2697 public Object defaultValue() { 2698 return defaultValue; 2699 } 2700 } 2701 2702 public enum TypeConstraint implements OnnxTypeConstraint { 2703 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.uint8()), OnnxType.tensor(OnnxType.uint16()), OnnxType.tensor(OnnxType.uint32()), OnnxType.tensor(OnnxType.uint64())))), 2704 ; 2705 2706 final OnnxType.TypeVariable typeVariable; 2707 2708 TypeConstraint(OnnxType.TypeVariable typeVariable) { 2709 assert typeVariable.name().equals(name()); 2710 this.typeVariable = typeVariable; 2711 } 2712 2713 @Override 2714 public OnnxType.TypeVariable typeVariable() { 2715 return typeVariable; 2716 } 2717 } 2718 2719 public enum InputParameter implements OnnxParameter { 2720 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2721 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2722 ; 2723 2724 final OnnxType type; 2725 final Quantifier quantifier; 2726 2727 InputParameter(OnnxType type, Quantifier quantifier) { 2728 this.type = type; 2729 this.quantifier = quantifier; 2730 } 2731 2732 @Override 2733 public OnnxType type() { 2734 return type; 2735 } 2736 2737 @Override 2738 public Quantifier quantifier() { 2739 return quantifier; 2740 } 2741 } 2742 2743 public enum OutputParameter implements OnnxParameter { 2744 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2745 ; 2746 2747 final OnnxType type; 2748 final Quantifier quantifier; 2749 2750 OutputParameter(OnnxType type, Quantifier quantifier) { 2751 this.type = type; 2752 this.quantifier = quantifier; 2753 } 2754 2755 @Override 2756 public OnnxType type() { 2757 return type; 2758 } 2759 2760 @Override 2761 public Quantifier quantifier() { 2762 return quantifier; 2763 } 2764 } 2765 2766 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 2767 NAME, 2768 List.of(Attribute.values()), 2769 List.of(TypeConstraint.values()), 2770 List.of(InputParameter.values()), 2771 List.of(OutputParameter.values()) 2772 ); 2773 2774 public BitShift(ExternalizedOp def) { 2775 super(SCHEMA, def); 2776 } 2777 2778 BitShift(BitShift that, CopyContext cc) { 2779 super(that, cc); 2780 } 2781 2782 @Override 2783 public BitShift transform(CopyContext cc, OpTransformer ot) { 2784 return new BitShift(this, cc); 2785 } 2786 2787 BitShift(TypeElement resultType, Value X, Value Y, String direction) { 2788 super(SCHEMA, resultType, Set.of(), List.of(X, Y), List.of(direction)); 2789 } 2790 2791 @Override 2792 public SequencedSet<OnnxParameter> onnxOutputs() { 2793 return onnxOutputs(SCHEMA); 2794 } 2795 2796 @Override 2797 public SequencedMap<OnnxParameter, Object> onnxInputs() { 2798 return onnxInputs(SCHEMA, List.of(X(), Y())); 2799 } 2800 2801 public Value X() { 2802 return operands().get(0); 2803 } 2804 2805 public Value Y() { 2806 return operands().get(1); 2807 } 2808 2809 public String direction() { 2810 String direction = Attribute.direction.access(String.class, onnxAttributes); 2811 return direction; 2812 } 2813 2814 } 2815 2816 public static BitShift BitShift(TypeElement resultType, Value X, Value Y, String direction) { 2817 return new BitShift(resultType, X, Y, direction); 2818 } 2819 2820 @OpFactory.OpDeclaration(BitwiseAnd.NAME) 2821 public static final class BitwiseAnd extends OnnxOp { 2822 public static final String NAME = "BitwiseAnd"; 2823 2824 public enum Attribute implements OnnxAttribute.None { } 2825 2826 public enum TypeConstraint implements OnnxTypeConstraint { 2827 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())))), 2828 ; 2829 2830 final OnnxType.TypeVariable typeVariable; 2831 2832 TypeConstraint(OnnxType.TypeVariable typeVariable) { 2833 assert typeVariable.name().equals(name()); 2834 this.typeVariable = typeVariable; 2835 } 2836 2837 @Override 2838 public OnnxType.TypeVariable typeVariable() { 2839 return typeVariable; 2840 } 2841 } 2842 2843 public enum InputParameter implements OnnxParameter { 2844 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2845 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2846 ; 2847 2848 final OnnxType type; 2849 final Quantifier quantifier; 2850 2851 InputParameter(OnnxType type, Quantifier quantifier) { 2852 this.type = type; 2853 this.quantifier = quantifier; 2854 } 2855 2856 @Override 2857 public OnnxType type() { 2858 return type; 2859 } 2860 2861 @Override 2862 public Quantifier quantifier() { 2863 return quantifier; 2864 } 2865 } 2866 2867 public enum OutputParameter implements OnnxParameter { 2868 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2869 ; 2870 2871 final OnnxType type; 2872 final Quantifier quantifier; 2873 2874 OutputParameter(OnnxType type, Quantifier quantifier) { 2875 this.type = type; 2876 this.quantifier = quantifier; 2877 } 2878 2879 @Override 2880 public OnnxType type() { 2881 return type; 2882 } 2883 2884 @Override 2885 public Quantifier quantifier() { 2886 return quantifier; 2887 } 2888 } 2889 2890 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 2891 NAME, 2892 List.of(Attribute.values()), 2893 List.of(TypeConstraint.values()), 2894 List.of(InputParameter.values()), 2895 List.of(OutputParameter.values()) 2896 ); 2897 2898 public BitwiseAnd(ExternalizedOp def) { 2899 super(SCHEMA, def); 2900 } 2901 2902 BitwiseAnd(BitwiseAnd that, CopyContext cc) { 2903 super(that, cc); 2904 } 2905 2906 @Override 2907 public BitwiseAnd transform(CopyContext cc, OpTransformer ot) { 2908 return new BitwiseAnd(this, cc); 2909 } 2910 2911 BitwiseAnd(TypeElement resultType, Value A, Value B) { 2912 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 2913 } 2914 2915 @Override 2916 public SequencedSet<OnnxParameter> onnxOutputs() { 2917 return onnxOutputs(SCHEMA); 2918 } 2919 2920 @Override 2921 public SequencedMap<OnnxParameter, Object> onnxInputs() { 2922 return onnxInputs(SCHEMA, List.of(A(), B())); 2923 } 2924 2925 public Value A() { 2926 return operands().get(0); 2927 } 2928 2929 public Value B() { 2930 return operands().get(1); 2931 } 2932 2933 } 2934 2935 public static BitwiseAnd BitwiseAnd(TypeElement resultType, Value A, Value B) { 2936 return new BitwiseAnd(resultType, A, B); 2937 } 2938 2939 @OpFactory.OpDeclaration(BitwiseNot.NAME) 2940 public static final class BitwiseNot extends OnnxOp { 2941 public static final String NAME = "BitwiseNot"; 2942 2943 public enum Attribute implements OnnxAttribute.None { } 2944 2945 public enum TypeConstraint implements OnnxTypeConstraint { 2946 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())))), 2947 ; 2948 2949 final OnnxType.TypeVariable typeVariable; 2950 2951 TypeConstraint(OnnxType.TypeVariable typeVariable) { 2952 assert typeVariable.name().equals(name()); 2953 this.typeVariable = typeVariable; 2954 } 2955 2956 @Override 2957 public OnnxType.TypeVariable typeVariable() { 2958 return typeVariable; 2959 } 2960 } 2961 2962 public enum InputParameter implements OnnxParameter { 2963 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2964 ; 2965 2966 final OnnxType type; 2967 final Quantifier quantifier; 2968 2969 InputParameter(OnnxType type, Quantifier quantifier) { 2970 this.type = type; 2971 this.quantifier = quantifier; 2972 } 2973 2974 @Override 2975 public OnnxType type() { 2976 return type; 2977 } 2978 2979 @Override 2980 public Quantifier quantifier() { 2981 return quantifier; 2982 } 2983 } 2984 2985 public enum OutputParameter implements OnnxParameter { 2986 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 2987 ; 2988 2989 final OnnxType type; 2990 final Quantifier quantifier; 2991 2992 OutputParameter(OnnxType type, Quantifier quantifier) { 2993 this.type = type; 2994 this.quantifier = quantifier; 2995 } 2996 2997 @Override 2998 public OnnxType type() { 2999 return type; 3000 } 3001 3002 @Override 3003 public Quantifier quantifier() { 3004 return quantifier; 3005 } 3006 } 3007 3008 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 3009 NAME, 3010 List.of(Attribute.values()), 3011 List.of(TypeConstraint.values()), 3012 List.of(InputParameter.values()), 3013 List.of(OutputParameter.values()) 3014 ); 3015 3016 public BitwiseNot(ExternalizedOp def) { 3017 super(SCHEMA, def); 3018 } 3019 3020 BitwiseNot(BitwiseNot that, CopyContext cc) { 3021 super(that, cc); 3022 } 3023 3024 @Override 3025 public BitwiseNot transform(CopyContext cc, OpTransformer ot) { 3026 return new BitwiseNot(this, cc); 3027 } 3028 3029 BitwiseNot(TypeElement resultType, Value X) { 3030 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 3031 } 3032 3033 @Override 3034 public SequencedSet<OnnxParameter> onnxOutputs() { 3035 return onnxOutputs(SCHEMA); 3036 } 3037 3038 @Override 3039 public SequencedMap<OnnxParameter, Object> onnxInputs() { 3040 return onnxInputs(SCHEMA, List.of(X())); 3041 } 3042 3043 public Value X() { 3044 return operands().get(0); 3045 } 3046 3047 } 3048 3049 public static BitwiseNot BitwiseNot(TypeElement resultType, Value X) { 3050 return new BitwiseNot(resultType, X); 3051 } 3052 3053 @OpFactory.OpDeclaration(BitwiseOr.NAME) 3054 public static final class BitwiseOr extends OnnxOp { 3055 public static final String NAME = "BitwiseOr"; 3056 3057 public enum Attribute implements OnnxAttribute.None { } 3058 3059 public enum TypeConstraint implements OnnxTypeConstraint { 3060 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())))), 3061 ; 3062 3063 final OnnxType.TypeVariable typeVariable; 3064 3065 TypeConstraint(OnnxType.TypeVariable typeVariable) { 3066 assert typeVariable.name().equals(name()); 3067 this.typeVariable = typeVariable; 3068 } 3069 3070 @Override 3071 public OnnxType.TypeVariable typeVariable() { 3072 return typeVariable; 3073 } 3074 } 3075 3076 public enum InputParameter implements OnnxParameter { 3077 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 3078 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 3079 ; 3080 3081 final OnnxType type; 3082 final Quantifier quantifier; 3083 3084 InputParameter(OnnxType type, Quantifier quantifier) { 3085 this.type = type; 3086 this.quantifier = quantifier; 3087 } 3088 3089 @Override 3090 public OnnxType type() { 3091 return type; 3092 } 3093 3094 @Override 3095 public Quantifier quantifier() { 3096 return quantifier; 3097 } 3098 } 3099 3100 public enum OutputParameter implements OnnxParameter { 3101 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 3102 ; 3103 3104 final OnnxType type; 3105 final Quantifier quantifier; 3106 3107 OutputParameter(OnnxType type, Quantifier quantifier) { 3108 this.type = type; 3109 this.quantifier = quantifier; 3110 } 3111 3112 @Override 3113 public OnnxType type() { 3114 return type; 3115 } 3116 3117 @Override 3118 public Quantifier quantifier() { 3119 return quantifier; 3120 } 3121 } 3122 3123 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 3124 NAME, 3125 List.of(Attribute.values()), 3126 List.of(TypeConstraint.values()), 3127 List.of(InputParameter.values()), 3128 List.of(OutputParameter.values()) 3129 ); 3130 3131 public BitwiseOr(ExternalizedOp def) { 3132 super(SCHEMA, def); 3133 } 3134 3135 BitwiseOr(BitwiseOr that, CopyContext cc) { 3136 super(that, cc); 3137 } 3138 3139 @Override 3140 public BitwiseOr transform(CopyContext cc, OpTransformer ot) { 3141 return new BitwiseOr(this, cc); 3142 } 3143 3144 BitwiseOr(TypeElement resultType, Value A, Value B) { 3145 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 3146 } 3147 3148 @Override 3149 public SequencedSet<OnnxParameter> onnxOutputs() { 3150 return onnxOutputs(SCHEMA); 3151 } 3152 3153 @Override 3154 public SequencedMap<OnnxParameter, Object> onnxInputs() { 3155 return onnxInputs(SCHEMA, List.of(A(), B())); 3156 } 3157 3158 public Value A() { 3159 return operands().get(0); 3160 } 3161 3162 public Value B() { 3163 return operands().get(1); 3164 } 3165 3166 } 3167 3168 public static BitwiseOr BitwiseOr(TypeElement resultType, Value A, Value B) { 3169 return new BitwiseOr(resultType, A, B); 3170 } 3171 3172 @OpFactory.OpDeclaration(BitwiseXor.NAME) 3173 public static final class BitwiseXor extends OnnxOp { 3174 public static final String NAME = "BitwiseXor"; 3175 3176 public enum Attribute implements OnnxAttribute.None { } 3177 3178 public enum TypeConstraint implements OnnxTypeConstraint { 3179 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())))), 3180 ; 3181 3182 final OnnxType.TypeVariable typeVariable; 3183 3184 TypeConstraint(OnnxType.TypeVariable typeVariable) { 3185 assert typeVariable.name().equals(name()); 3186 this.typeVariable = typeVariable; 3187 } 3188 3189 @Override 3190 public OnnxType.TypeVariable typeVariable() { 3191 return typeVariable; 3192 } 3193 } 3194 3195 public enum InputParameter implements OnnxParameter { 3196 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 3197 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 3198 ; 3199 3200 final OnnxType type; 3201 final Quantifier quantifier; 3202 3203 InputParameter(OnnxType type, Quantifier quantifier) { 3204 this.type = type; 3205 this.quantifier = quantifier; 3206 } 3207 3208 @Override 3209 public OnnxType type() { 3210 return type; 3211 } 3212 3213 @Override 3214 public Quantifier quantifier() { 3215 return quantifier; 3216 } 3217 } 3218 3219 public enum OutputParameter implements OnnxParameter { 3220 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 3221 ; 3222 3223 final OnnxType type; 3224 final Quantifier quantifier; 3225 3226 OutputParameter(OnnxType type, Quantifier quantifier) { 3227 this.type = type; 3228 this.quantifier = quantifier; 3229 } 3230 3231 @Override 3232 public OnnxType type() { 3233 return type; 3234 } 3235 3236 @Override 3237 public Quantifier quantifier() { 3238 return quantifier; 3239 } 3240 } 3241 3242 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 3243 NAME, 3244 List.of(Attribute.values()), 3245 List.of(TypeConstraint.values()), 3246 List.of(InputParameter.values()), 3247 List.of(OutputParameter.values()) 3248 ); 3249 3250 public BitwiseXor(ExternalizedOp def) { 3251 super(SCHEMA, def); 3252 } 3253 3254 BitwiseXor(BitwiseXor that, CopyContext cc) { 3255 super(that, cc); 3256 } 3257 3258 @Override 3259 public BitwiseXor transform(CopyContext cc, OpTransformer ot) { 3260 return new BitwiseXor(this, cc); 3261 } 3262 3263 BitwiseXor(TypeElement resultType, Value A, Value B) { 3264 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 3265 } 3266 3267 @Override 3268 public SequencedSet<OnnxParameter> onnxOutputs() { 3269 return onnxOutputs(SCHEMA); 3270 } 3271 3272 @Override 3273 public SequencedMap<OnnxParameter, Object> onnxInputs() { 3274 return onnxInputs(SCHEMA, List.of(A(), B())); 3275 } 3276 3277 public Value A() { 3278 return operands().get(0); 3279 } 3280 3281 public Value B() { 3282 return operands().get(1); 3283 } 3284 3285 } 3286 3287 public static BitwiseXor BitwiseXor(TypeElement resultType, Value A, Value B) { 3288 return new BitwiseXor(resultType, A, B); 3289 } 3290 3291 @OpFactory.OpDeclaration(BlackmanWindow.NAME) 3292 public static final class BlackmanWindow extends OnnxOp { 3293 public static final String NAME = "BlackmanWindow"; 3294 3295 public enum Attribute implements OnnxAttribute { 3296 periodic(Long.class, true, 1), 3297 output_datatype(Long.class, true, 1), 3298 ; 3299 3300 final Class<?> t; 3301 final boolean optional; 3302 final Object defaultValue; 3303 3304 Attribute(Class<?> type, boolean optional, Object defaultValue) { 3305 this.t = type; 3306 this.optional = optional; 3307 this.defaultValue = defaultValue; 3308 assert optional || defaultValue == null; 3309 } 3310 3311 public Class<?> type() { 3312 return t; 3313 } 3314 3315 public boolean isOptional() { 3316 return optional; 3317 } 3318 3319 public Object defaultValue() { 3320 return defaultValue; 3321 } 3322 } 3323 3324 public enum TypeConstraint implements OnnxTypeConstraint { 3325 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 3326 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())))), 3327 ; 3328 3329 final OnnxType.TypeVariable typeVariable; 3330 3331 TypeConstraint(OnnxType.TypeVariable typeVariable) { 3332 assert typeVariable.name().equals(name()); 3333 this.typeVariable = typeVariable; 3334 } 3335 3336 @Override 3337 public OnnxType.TypeVariable typeVariable() { 3338 return typeVariable; 3339 } 3340 } 3341 3342 public enum InputParameter implements OnnxParameter { 3343 size(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 3344 ; 3345 3346 final OnnxType type; 3347 final Quantifier quantifier; 3348 3349 InputParameter(OnnxType type, Quantifier quantifier) { 3350 this.type = type; 3351 this.quantifier = quantifier; 3352 } 3353 3354 @Override 3355 public OnnxType type() { 3356 return type; 3357 } 3358 3359 @Override 3360 public Quantifier quantifier() { 3361 return quantifier; 3362 } 3363 } 3364 3365 public enum OutputParameter implements OnnxParameter { 3366 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 3367 ; 3368 3369 final OnnxType type; 3370 final Quantifier quantifier; 3371 3372 OutputParameter(OnnxType type, Quantifier quantifier) { 3373 this.type = type; 3374 this.quantifier = quantifier; 3375 } 3376 3377 @Override 3378 public OnnxType type() { 3379 return type; 3380 } 3381 3382 @Override 3383 public Quantifier quantifier() { 3384 return quantifier; 3385 } 3386 } 3387 3388 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 3389 NAME, 3390 List.of(Attribute.values()), 3391 List.of(TypeConstraint.values()), 3392 List.of(InputParameter.values()), 3393 List.of(OutputParameter.values()) 3394 ); 3395 3396 public BlackmanWindow(ExternalizedOp def) { 3397 super(SCHEMA, def); 3398 } 3399 3400 BlackmanWindow(BlackmanWindow that, CopyContext cc) { 3401 super(that, cc); 3402 } 3403 3404 @Override 3405 public BlackmanWindow transform(CopyContext cc, OpTransformer ot) { 3406 return new BlackmanWindow(this, cc); 3407 } 3408 3409 BlackmanWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) { 3410 super(SCHEMA, resultType, Set.of(), List.of(size), List.of(periodic, output_datatype)); 3411 } 3412 3413 @Override 3414 public SequencedSet<OnnxParameter> onnxOutputs() { 3415 return onnxOutputs(SCHEMA); 3416 } 3417 3418 @Override 3419 public SequencedMap<OnnxParameter, Object> onnxInputs() { 3420 return onnxInputs(SCHEMA, List.of(size())); 3421 } 3422 3423 public Value size() { 3424 return operands().get(0); 3425 } 3426 3427 public java.util.Optional<Long> periodic() { 3428 Long periodic = Attribute.periodic.access(Long.class, onnxAttributes); 3429 return java.util.Optional.ofNullable(periodic); 3430 } 3431 3432 public java.util.Optional<Long> output_datatype() { 3433 Long output_datatype = Attribute.output_datatype.access(Long.class, onnxAttributes); 3434 return java.util.Optional.ofNullable(output_datatype); 3435 } 3436 3437 } 3438 3439 public static BlackmanWindow BlackmanWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) { 3440 return new BlackmanWindow(resultType, size, periodic, output_datatype); 3441 } 3442 3443 @OpFactory.OpDeclaration(Cast.NAME) 3444 public static final class Cast extends OnnxOp { 3445 public static final String NAME = "Cast"; 3446 3447 public enum Attribute implements OnnxAttribute { 3448 saturate(Long.class, true, 1), 3449 to(Long.class, false, null), 3450 ; 3451 3452 final Class<?> t; 3453 final boolean optional; 3454 final Object defaultValue; 3455 3456 Attribute(Class<?> type, boolean optional, Object defaultValue) { 3457 this.t = type; 3458 this.optional = optional; 3459 this.defaultValue = defaultValue; 3460 assert optional || defaultValue == null; 3461 } 3462 3463 public Class<?> type() { 3464 return t; 3465 } 3466 3467 public boolean isOptional() { 3468 return optional; 3469 } 3470 3471 public Object defaultValue() { 3472 return defaultValue; 3473 } 3474 } 3475 3476 public enum TypeConstraint implements OnnxTypeConstraint { 3477 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())))), 3478 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())))), 3479 ; 3480 3481 final OnnxType.TypeVariable typeVariable; 3482 3483 TypeConstraint(OnnxType.TypeVariable typeVariable) { 3484 assert typeVariable.name().equals(name()); 3485 this.typeVariable = typeVariable; 3486 } 3487 3488 @Override 3489 public OnnxType.TypeVariable typeVariable() { 3490 return typeVariable; 3491 } 3492 } 3493 3494 public enum InputParameter implements OnnxParameter { 3495 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 3496 ; 3497 3498 final OnnxType type; 3499 final Quantifier quantifier; 3500 3501 InputParameter(OnnxType type, Quantifier quantifier) { 3502 this.type = type; 3503 this.quantifier = quantifier; 3504 } 3505 3506 @Override 3507 public OnnxType type() { 3508 return type; 3509 } 3510 3511 @Override 3512 public Quantifier quantifier() { 3513 return quantifier; 3514 } 3515 } 3516 3517 public enum OutputParameter implements OnnxParameter { 3518 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 3519 ; 3520 3521 final OnnxType type; 3522 final Quantifier quantifier; 3523 3524 OutputParameter(OnnxType type, Quantifier quantifier) { 3525 this.type = type; 3526 this.quantifier = quantifier; 3527 } 3528 3529 @Override 3530 public OnnxType type() { 3531 return type; 3532 } 3533 3534 @Override 3535 public Quantifier quantifier() { 3536 return quantifier; 3537 } 3538 } 3539 3540 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 3541 NAME, 3542 List.of(Attribute.values()), 3543 List.of(TypeConstraint.values()), 3544 List.of(InputParameter.values()), 3545 List.of(OutputParameter.values()) 3546 ); 3547 3548 public Cast(ExternalizedOp def) { 3549 super(SCHEMA, def); 3550 } 3551 3552 Cast(Cast that, CopyContext cc) { 3553 super(that, cc); 3554 } 3555 3556 @Override 3557 public Cast transform(CopyContext cc, OpTransformer ot) { 3558 return new Cast(this, cc); 3559 } 3560 3561 Cast(TypeElement resultType, Value input, java.util.Optional<Long> saturate, long to) { 3562 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(saturate, to)); 3563 } 3564 3565 @Override 3566 public SequencedSet<OnnxParameter> onnxOutputs() { 3567 return onnxOutputs(SCHEMA); 3568 } 3569 3570 @Override 3571 public SequencedMap<OnnxParameter, Object> onnxInputs() { 3572 return onnxInputs(SCHEMA, List.of(input())); 3573 } 3574 3575 public Value input() { 3576 return operands().get(0); 3577 } 3578 3579 public java.util.Optional<Long> saturate() { 3580 Long saturate = Attribute.saturate.access(Long.class, onnxAttributes); 3581 return java.util.Optional.ofNullable(saturate); 3582 } 3583 3584 public long to() { 3585 long to = Attribute.to.access(Long.class, onnxAttributes); 3586 return to; 3587 } 3588 3589 } 3590 3591 public static Cast Cast(TypeElement resultType, Value input, java.util.Optional<Long> saturate, long to) { 3592 return new Cast(resultType, input, saturate, to); 3593 } 3594 3595 @OpFactory.OpDeclaration(CastLike.NAME) 3596 public static final class CastLike extends OnnxOp { 3597 public static final String NAME = "CastLike"; 3598 3599 public enum Attribute implements OnnxAttribute { 3600 saturate(Long.class, true, 1), 3601 ; 3602 3603 final Class<?> t; 3604 final boolean optional; 3605 final Object defaultValue; 3606 3607 Attribute(Class<?> type, boolean optional, Object defaultValue) { 3608 this.t = type; 3609 this.optional = optional; 3610 this.defaultValue = defaultValue; 3611 assert optional || defaultValue == null; 3612 } 3613 3614 public Class<?> type() { 3615 return t; 3616 } 3617 3618 public boolean isOptional() { 3619 return optional; 3620 } 3621 3622 public Object defaultValue() { 3623 return defaultValue; 3624 } 3625 } 3626 3627 public enum TypeConstraint implements OnnxTypeConstraint { 3628 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())))), 3629 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())))), 3630 ; 3631 3632 final OnnxType.TypeVariable typeVariable; 3633 3634 TypeConstraint(OnnxType.TypeVariable typeVariable) { 3635 assert typeVariable.name().equals(name()); 3636 this.typeVariable = typeVariable; 3637 } 3638 3639 @Override 3640 public OnnxType.TypeVariable typeVariable() { 3641 return typeVariable; 3642 } 3643 } 3644 3645 public enum InputParameter implements OnnxParameter { 3646 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 3647 target_type(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 3648 ; 3649 3650 final OnnxType type; 3651 final Quantifier quantifier; 3652 3653 InputParameter(OnnxType type, Quantifier quantifier) { 3654 this.type = type; 3655 this.quantifier = quantifier; 3656 } 3657 3658 @Override 3659 public OnnxType type() { 3660 return type; 3661 } 3662 3663 @Override 3664 public Quantifier quantifier() { 3665 return quantifier; 3666 } 3667 } 3668 3669 public enum OutputParameter implements OnnxParameter { 3670 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 3671 ; 3672 3673 final OnnxType type; 3674 final Quantifier quantifier; 3675 3676 OutputParameter(OnnxType type, Quantifier quantifier) { 3677 this.type = type; 3678 this.quantifier = quantifier; 3679 } 3680 3681 @Override 3682 public OnnxType type() { 3683 return type; 3684 } 3685 3686 @Override 3687 public Quantifier quantifier() { 3688 return quantifier; 3689 } 3690 } 3691 3692 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 3693 NAME, 3694 List.of(Attribute.values()), 3695 List.of(TypeConstraint.values()), 3696 List.of(InputParameter.values()), 3697 List.of(OutputParameter.values()) 3698 ); 3699 3700 public CastLike(ExternalizedOp def) { 3701 super(SCHEMA, def); 3702 } 3703 3704 CastLike(CastLike that, CopyContext cc) { 3705 super(that, cc); 3706 } 3707 3708 @Override 3709 public CastLike transform(CopyContext cc, OpTransformer ot) { 3710 return new CastLike(this, cc); 3711 } 3712 3713 CastLike(TypeElement resultType, Value input, Value target_type, java.util.Optional<Long> saturate) { 3714 super(SCHEMA, resultType, Set.of(), List.of(input, target_type), List.of(saturate)); 3715 } 3716 3717 @Override 3718 public SequencedSet<OnnxParameter> onnxOutputs() { 3719 return onnxOutputs(SCHEMA); 3720 } 3721 3722 @Override 3723 public SequencedMap<OnnxParameter, Object> onnxInputs() { 3724 return onnxInputs(SCHEMA, List.of(input(), target_type())); 3725 } 3726 3727 public Value input() { 3728 return operands().get(0); 3729 } 3730 3731 public Value target_type() { 3732 return operands().get(1); 3733 } 3734 3735 public java.util.Optional<Long> saturate() { 3736 Long saturate = Attribute.saturate.access(Long.class, onnxAttributes); 3737 return java.util.Optional.ofNullable(saturate); 3738 } 3739 3740 } 3741 3742 public static CastLike CastLike(TypeElement resultType, Value input, Value target_type, java.util.Optional<Long> saturate) { 3743 return new CastLike(resultType, input, target_type, saturate); 3744 } 3745 3746 @OpFactory.OpDeclaration(CastMap.NAME) 3747 public static final class CastMap extends OnnxOp { 3748 public static final String NAME = "CastMap"; 3749 3750 public enum Attribute implements OnnxAttribute { 3751 map_form(String.class, true, "DENSE"), 3752 cast_to(String.class, true, "TO_FLOAT"), 3753 max_map(Long.class, true, 1), 3754 ; 3755 3756 final Class<?> t; 3757 final boolean optional; 3758 final Object defaultValue; 3759 3760 Attribute(Class<?> type, boolean optional, Object defaultValue) { 3761 this.t = type; 3762 this.optional = optional; 3763 this.defaultValue = defaultValue; 3764 assert optional || defaultValue == null; 3765 } 3766 3767 public Class<?> type() { 3768 return t; 3769 } 3770 3771 public boolean isOptional() { 3772 return optional; 3773 } 3774 3775 public Object defaultValue() { 3776 return defaultValue; 3777 } 3778 } 3779 3780 public enum TypeConstraint implements OnnxTypeConstraint { 3781 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.map(OnnxType.int64(), OnnxType.string()), OnnxType.map(OnnxType.int64(), OnnxType.float32())))), 3782 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.int64())))), 3783 ; 3784 3785 final OnnxType.TypeVariable typeVariable; 3786 3787 TypeConstraint(OnnxType.TypeVariable typeVariable) { 3788 assert typeVariable.name().equals(name()); 3789 this.typeVariable = typeVariable; 3790 } 3791 3792 @Override 3793 public OnnxType.TypeVariable typeVariable() { 3794 return typeVariable; 3795 } 3796 } 3797 3798 public enum InputParameter implements OnnxParameter { 3799 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 3800 ; 3801 3802 final OnnxType type; 3803 final Quantifier quantifier; 3804 3805 InputParameter(OnnxType type, Quantifier quantifier) { 3806 this.type = type; 3807 this.quantifier = quantifier; 3808 } 3809 3810 @Override 3811 public OnnxType type() { 3812 return type; 3813 } 3814 3815 @Override 3816 public Quantifier quantifier() { 3817 return quantifier; 3818 } 3819 } 3820 3821 public enum OutputParameter implements OnnxParameter { 3822 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 3823 ; 3824 3825 final OnnxType type; 3826 final Quantifier quantifier; 3827 3828 OutputParameter(OnnxType type, Quantifier quantifier) { 3829 this.type = type; 3830 this.quantifier = quantifier; 3831 } 3832 3833 @Override 3834 public OnnxType type() { 3835 return type; 3836 } 3837 3838 @Override 3839 public Quantifier quantifier() { 3840 return quantifier; 3841 } 3842 } 3843 3844 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 3845 NAME, 3846 List.of(Attribute.values()), 3847 List.of(TypeConstraint.values()), 3848 List.of(InputParameter.values()), 3849 List.of(OutputParameter.values()) 3850 ); 3851 3852 public CastMap(ExternalizedOp def) { 3853 super(SCHEMA, def); 3854 } 3855 3856 CastMap(CastMap that, CopyContext cc) { 3857 super(that, cc); 3858 } 3859 3860 @Override 3861 public CastMap transform(CopyContext cc, OpTransformer ot) { 3862 return new CastMap(this, cc); 3863 } 3864 3865 CastMap(TypeElement resultType, Value X, java.util.Optional<String> map_form, java.util.Optional<String> cast_to, java.util.Optional<Long> max_map) { 3866 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(map_form, cast_to, max_map)); 3867 } 3868 3869 @Override 3870 public SequencedSet<OnnxParameter> onnxOutputs() { 3871 return onnxOutputs(SCHEMA); 3872 } 3873 3874 @Override 3875 public SequencedMap<OnnxParameter, Object> onnxInputs() { 3876 return onnxInputs(SCHEMA, List.of(X())); 3877 } 3878 3879 public Value X() { 3880 return operands().get(0); 3881 } 3882 3883 public java.util.Optional<String> map_form() { 3884 String map_form = Attribute.map_form.access(String.class, onnxAttributes); 3885 return java.util.Optional.ofNullable(map_form); 3886 } 3887 3888 public java.util.Optional<String> cast_to() { 3889 String cast_to = Attribute.cast_to.access(String.class, onnxAttributes); 3890 return java.util.Optional.ofNullable(cast_to); 3891 } 3892 3893 public java.util.Optional<Long> max_map() { 3894 Long max_map = Attribute.max_map.access(Long.class, onnxAttributes); 3895 return java.util.Optional.ofNullable(max_map); 3896 } 3897 3898 } 3899 3900 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) { 3901 return new CastMap(resultType, X, map_form, cast_to, max_map); 3902 } 3903 3904 @OpFactory.OpDeclaration(CategoryMapper.NAME) 3905 public static final class CategoryMapper extends OnnxOp { 3906 public static final String NAME = "CategoryMapper"; 3907 3908 public enum Attribute implements OnnxAttribute { 3909 cats_int64s(long[].class, true, null), 3910 cats_strings(String[].class, true, null), 3911 default_int64(Long.class, true, -1), 3912 default_string(String.class, true, "_Unused"), 3913 ; 3914 3915 final Class<?> t; 3916 final boolean optional; 3917 final Object defaultValue; 3918 3919 Attribute(Class<?> type, boolean optional, Object defaultValue) { 3920 this.t = type; 3921 this.optional = optional; 3922 this.defaultValue = defaultValue; 3923 assert optional || defaultValue == null; 3924 } 3925 3926 public Class<?> type() { 3927 return t; 3928 } 3929 3930 public boolean isOptional() { 3931 return optional; 3932 } 3933 3934 public Object defaultValue() { 3935 return defaultValue; 3936 } 3937 } 3938 3939 public enum TypeConstraint implements OnnxTypeConstraint { 3940 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))), 3941 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))), 3942 ; 3943 3944 final OnnxType.TypeVariable typeVariable; 3945 3946 TypeConstraint(OnnxType.TypeVariable typeVariable) { 3947 assert typeVariable.name().equals(name()); 3948 this.typeVariable = typeVariable; 3949 } 3950 3951 @Override 3952 public OnnxType.TypeVariable typeVariable() { 3953 return typeVariable; 3954 } 3955 } 3956 3957 public enum InputParameter implements OnnxParameter { 3958 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 3959 ; 3960 3961 final OnnxType type; 3962 final Quantifier quantifier; 3963 3964 InputParameter(OnnxType type, Quantifier quantifier) { 3965 this.type = type; 3966 this.quantifier = quantifier; 3967 } 3968 3969 @Override 3970 public OnnxType type() { 3971 return type; 3972 } 3973 3974 @Override 3975 public Quantifier quantifier() { 3976 return quantifier; 3977 } 3978 } 3979 3980 public enum OutputParameter implements OnnxParameter { 3981 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 3982 ; 3983 3984 final OnnxType type; 3985 final Quantifier quantifier; 3986 3987 OutputParameter(OnnxType type, Quantifier quantifier) { 3988 this.type = type; 3989 this.quantifier = quantifier; 3990 } 3991 3992 @Override 3993 public OnnxType type() { 3994 return type; 3995 } 3996 3997 @Override 3998 public Quantifier quantifier() { 3999 return quantifier; 4000 } 4001 } 4002 4003 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 4004 NAME, 4005 List.of(Attribute.values()), 4006 List.of(TypeConstraint.values()), 4007 List.of(InputParameter.values()), 4008 List.of(OutputParameter.values()) 4009 ); 4010 4011 public CategoryMapper(ExternalizedOp def) { 4012 super(SCHEMA, def); 4013 } 4014 4015 CategoryMapper(CategoryMapper that, CopyContext cc) { 4016 super(that, cc); 4017 } 4018 4019 @Override 4020 public CategoryMapper transform(CopyContext cc, OpTransformer ot) { 4021 return new CategoryMapper(this, cc); 4022 } 4023 4024 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) { 4025 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(cats_int64s, cats_strings, default_int64, default_string)); 4026 } 4027 4028 @Override 4029 public SequencedSet<OnnxParameter> onnxOutputs() { 4030 return onnxOutputs(SCHEMA); 4031 } 4032 4033 @Override 4034 public SequencedMap<OnnxParameter, Object> onnxInputs() { 4035 return onnxInputs(SCHEMA, List.of(X())); 4036 } 4037 4038 public Value X() { 4039 return operands().get(0); 4040 } 4041 4042 public java.util.Optional<long[]> cats_int64s() { 4043 long[] cats_int64s = Attribute.cats_int64s.access(long[].class, onnxAttributes); 4044 return java.util.Optional.ofNullable(cats_int64s).map(long[]::clone); 4045 } 4046 4047 public java.util.Optional<String[]> cats_strings() { 4048 String[] cats_strings = Attribute.cats_strings.access(String[].class, onnxAttributes); 4049 return java.util.Optional.ofNullable(cats_strings).map(String[]::clone); 4050 } 4051 4052 public java.util.Optional<Long> default_int64() { 4053 Long default_int64 = Attribute.default_int64.access(Long.class, onnxAttributes); 4054 return java.util.Optional.ofNullable(default_int64); 4055 } 4056 4057 public java.util.Optional<String> default_string() { 4058 String default_string = Attribute.default_string.access(String.class, onnxAttributes); 4059 return java.util.Optional.ofNullable(default_string); 4060 } 4061 4062 } 4063 4064 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) { 4065 return new CategoryMapper(resultType, X, cats_int64s, cats_strings, default_int64, default_string); 4066 } 4067 4068 @OpFactory.OpDeclaration(Ceil.NAME) 4069 public static final class Ceil extends OnnxOp { 4070 public static final String NAME = "Ceil"; 4071 4072 public enum Attribute implements OnnxAttribute.None { } 4073 4074 public enum TypeConstraint implements OnnxTypeConstraint { 4075 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 4076 ; 4077 4078 final OnnxType.TypeVariable typeVariable; 4079 4080 TypeConstraint(OnnxType.TypeVariable typeVariable) { 4081 assert typeVariable.name().equals(name()); 4082 this.typeVariable = typeVariable; 4083 } 4084 4085 @Override 4086 public OnnxType.TypeVariable typeVariable() { 4087 return typeVariable; 4088 } 4089 } 4090 4091 public enum InputParameter implements OnnxParameter { 4092 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4093 ; 4094 4095 final OnnxType type; 4096 final Quantifier quantifier; 4097 4098 InputParameter(OnnxType type, Quantifier quantifier) { 4099 this.type = type; 4100 this.quantifier = quantifier; 4101 } 4102 4103 @Override 4104 public OnnxType type() { 4105 return type; 4106 } 4107 4108 @Override 4109 public Quantifier quantifier() { 4110 return quantifier; 4111 } 4112 } 4113 4114 public enum OutputParameter implements OnnxParameter { 4115 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4116 ; 4117 4118 final OnnxType type; 4119 final Quantifier quantifier; 4120 4121 OutputParameter(OnnxType type, Quantifier quantifier) { 4122 this.type = type; 4123 this.quantifier = quantifier; 4124 } 4125 4126 @Override 4127 public OnnxType type() { 4128 return type; 4129 } 4130 4131 @Override 4132 public Quantifier quantifier() { 4133 return quantifier; 4134 } 4135 } 4136 4137 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 4138 NAME, 4139 List.of(Attribute.values()), 4140 List.of(TypeConstraint.values()), 4141 List.of(InputParameter.values()), 4142 List.of(OutputParameter.values()) 4143 ); 4144 4145 public Ceil(ExternalizedOp def) { 4146 super(SCHEMA, def); 4147 } 4148 4149 Ceil(Ceil that, CopyContext cc) { 4150 super(that, cc); 4151 } 4152 4153 @Override 4154 public Ceil transform(CopyContext cc, OpTransformer ot) { 4155 return new Ceil(this, cc); 4156 } 4157 4158 Ceil(TypeElement resultType, Value X) { 4159 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 4160 } 4161 4162 @Override 4163 public SequencedSet<OnnxParameter> onnxOutputs() { 4164 return onnxOutputs(SCHEMA); 4165 } 4166 4167 @Override 4168 public SequencedMap<OnnxParameter, Object> onnxInputs() { 4169 return onnxInputs(SCHEMA, List.of(X())); 4170 } 4171 4172 public Value X() { 4173 return operands().get(0); 4174 } 4175 4176 } 4177 4178 public static Ceil Ceil(TypeElement resultType, Value X) { 4179 return new Ceil(resultType, X); 4180 } 4181 4182 @OpFactory.OpDeclaration(Celu.NAME) 4183 public static final class Celu extends OnnxOp { 4184 public static final String NAME = "Celu"; 4185 4186 public enum Attribute implements OnnxAttribute { 4187 alpha(Float.class, true, 1.0f), 4188 ; 4189 4190 final Class<?> t; 4191 final boolean optional; 4192 final Object defaultValue; 4193 4194 Attribute(Class<?> type, boolean optional, Object defaultValue) { 4195 this.t = type; 4196 this.optional = optional; 4197 this.defaultValue = defaultValue; 4198 assert optional || defaultValue == null; 4199 } 4200 4201 public Class<?> type() { 4202 return t; 4203 } 4204 4205 public boolean isOptional() { 4206 return optional; 4207 } 4208 4209 public Object defaultValue() { 4210 return defaultValue; 4211 } 4212 } 4213 4214 public enum TypeConstraint implements OnnxTypeConstraint { 4215 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32())))), 4216 ; 4217 4218 final OnnxType.TypeVariable typeVariable; 4219 4220 TypeConstraint(OnnxType.TypeVariable typeVariable) { 4221 assert typeVariable.name().equals(name()); 4222 this.typeVariable = typeVariable; 4223 } 4224 4225 @Override 4226 public OnnxType.TypeVariable typeVariable() { 4227 return typeVariable; 4228 } 4229 } 4230 4231 public enum InputParameter implements OnnxParameter { 4232 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4233 ; 4234 4235 final OnnxType type; 4236 final Quantifier quantifier; 4237 4238 InputParameter(OnnxType type, Quantifier quantifier) { 4239 this.type = type; 4240 this.quantifier = quantifier; 4241 } 4242 4243 @Override 4244 public OnnxType type() { 4245 return type; 4246 } 4247 4248 @Override 4249 public Quantifier quantifier() { 4250 return quantifier; 4251 } 4252 } 4253 4254 public enum OutputParameter implements OnnxParameter { 4255 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4256 ; 4257 4258 final OnnxType type; 4259 final Quantifier quantifier; 4260 4261 OutputParameter(OnnxType type, Quantifier quantifier) { 4262 this.type = type; 4263 this.quantifier = quantifier; 4264 } 4265 4266 @Override 4267 public OnnxType type() { 4268 return type; 4269 } 4270 4271 @Override 4272 public Quantifier quantifier() { 4273 return quantifier; 4274 } 4275 } 4276 4277 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 4278 NAME, 4279 List.of(Attribute.values()), 4280 List.of(TypeConstraint.values()), 4281 List.of(InputParameter.values()), 4282 List.of(OutputParameter.values()) 4283 ); 4284 4285 public Celu(ExternalizedOp def) { 4286 super(SCHEMA, def); 4287 } 4288 4289 Celu(Celu that, CopyContext cc) { 4290 super(that, cc); 4291 } 4292 4293 @Override 4294 public Celu transform(CopyContext cc, OpTransformer ot) { 4295 return new Celu(this, cc); 4296 } 4297 4298 Celu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) { 4299 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha)); 4300 } 4301 4302 @Override 4303 public SequencedSet<OnnxParameter> onnxOutputs() { 4304 return onnxOutputs(SCHEMA); 4305 } 4306 4307 @Override 4308 public SequencedMap<OnnxParameter, Object> onnxInputs() { 4309 return onnxInputs(SCHEMA, List.of(X())); 4310 } 4311 4312 public Value X() { 4313 return operands().get(0); 4314 } 4315 4316 public java.util.Optional<Float> alpha() { 4317 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 4318 return java.util.Optional.ofNullable(alpha); 4319 } 4320 4321 } 4322 4323 public static Celu Celu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) { 4324 return new Celu(resultType, X, alpha); 4325 } 4326 4327 @OpFactory.OpDeclaration(CenterCropPad.NAME) 4328 public static final class CenterCropPad extends OnnxOp { 4329 public static final String NAME = "CenterCropPad"; 4330 4331 public enum Attribute implements OnnxAttribute { 4332 axes(long[].class, true, null), 4333 ; 4334 4335 final Class<?> t; 4336 final boolean optional; 4337 final Object defaultValue; 4338 4339 Attribute(Class<?> type, boolean optional, Object defaultValue) { 4340 this.t = type; 4341 this.optional = optional; 4342 this.defaultValue = defaultValue; 4343 assert optional || defaultValue == null; 4344 } 4345 4346 public Class<?> type() { 4347 return t; 4348 } 4349 4350 public boolean isOptional() { 4351 return optional; 4352 } 4353 4354 public Object defaultValue() { 4355 return defaultValue; 4356 } 4357 } 4358 4359 public enum TypeConstraint implements OnnxTypeConstraint { 4360 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())))), 4361 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 4362 ; 4363 4364 final OnnxType.TypeVariable typeVariable; 4365 4366 TypeConstraint(OnnxType.TypeVariable typeVariable) { 4367 assert typeVariable.name().equals(name()); 4368 this.typeVariable = typeVariable; 4369 } 4370 4371 @Override 4372 public OnnxType.TypeVariable typeVariable() { 4373 return typeVariable; 4374 } 4375 } 4376 4377 public enum InputParameter implements OnnxParameter { 4378 input_data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4379 shape(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 4380 ; 4381 4382 final OnnxType type; 4383 final Quantifier quantifier; 4384 4385 InputParameter(OnnxType type, Quantifier quantifier) { 4386 this.type = type; 4387 this.quantifier = quantifier; 4388 } 4389 4390 @Override 4391 public OnnxType type() { 4392 return type; 4393 } 4394 4395 @Override 4396 public Quantifier quantifier() { 4397 return quantifier; 4398 } 4399 } 4400 4401 public enum OutputParameter implements OnnxParameter { 4402 output_data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4403 ; 4404 4405 final OnnxType type; 4406 final Quantifier quantifier; 4407 4408 OutputParameter(OnnxType type, Quantifier quantifier) { 4409 this.type = type; 4410 this.quantifier = quantifier; 4411 } 4412 4413 @Override 4414 public OnnxType type() { 4415 return type; 4416 } 4417 4418 @Override 4419 public Quantifier quantifier() { 4420 return quantifier; 4421 } 4422 } 4423 4424 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 4425 NAME, 4426 List.of(Attribute.values()), 4427 List.of(TypeConstraint.values()), 4428 List.of(InputParameter.values()), 4429 List.of(OutputParameter.values()) 4430 ); 4431 4432 public CenterCropPad(ExternalizedOp def) { 4433 super(SCHEMA, def); 4434 } 4435 4436 CenterCropPad(CenterCropPad that, CopyContext cc) { 4437 super(that, cc); 4438 } 4439 4440 @Override 4441 public CenterCropPad transform(CopyContext cc, OpTransformer ot) { 4442 return new CenterCropPad(this, cc); 4443 } 4444 4445 CenterCropPad(TypeElement resultType, Value input_data, Value shape, java.util.Optional<long[]> axes) { 4446 super(SCHEMA, resultType, Set.of(), List.of(input_data, shape), List.of(axes)); 4447 } 4448 4449 @Override 4450 public SequencedSet<OnnxParameter> onnxOutputs() { 4451 return onnxOutputs(SCHEMA); 4452 } 4453 4454 @Override 4455 public SequencedMap<OnnxParameter, Object> onnxInputs() { 4456 return onnxInputs(SCHEMA, List.of(input_data(), shape())); 4457 } 4458 4459 public Value input_data() { 4460 return operands().get(0); 4461 } 4462 4463 public Value shape() { 4464 return operands().get(1); 4465 } 4466 4467 public java.util.Optional<long[]> axes() { 4468 long[] axes = Attribute.axes.access(long[].class, onnxAttributes); 4469 return java.util.Optional.ofNullable(axes).map(long[]::clone); 4470 } 4471 4472 } 4473 4474 public static CenterCropPad CenterCropPad(TypeElement resultType, Value input_data, Value shape, java.util.Optional<long[]> axes) { 4475 return new CenterCropPad(resultType, input_data, shape, axes); 4476 } 4477 4478 @OpFactory.OpDeclaration(Clip.NAME) 4479 public static final class Clip extends OnnxOp { 4480 public static final String NAME = "Clip"; 4481 4482 public enum Attribute implements OnnxAttribute.None { } 4483 4484 public enum TypeConstraint implements OnnxTypeConstraint { 4485 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())))), 4486 ; 4487 4488 final OnnxType.TypeVariable typeVariable; 4489 4490 TypeConstraint(OnnxType.TypeVariable typeVariable) { 4491 assert typeVariable.name().equals(name()); 4492 this.typeVariable = typeVariable; 4493 } 4494 4495 @Override 4496 public OnnxType.TypeVariable typeVariable() { 4497 return typeVariable; 4498 } 4499 } 4500 4501 public enum InputParameter implements OnnxParameter { 4502 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4503 min(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 4504 max(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 4505 ; 4506 4507 final OnnxType type; 4508 final Quantifier quantifier; 4509 4510 InputParameter(OnnxType type, Quantifier quantifier) { 4511 this.type = type; 4512 this.quantifier = quantifier; 4513 } 4514 4515 @Override 4516 public OnnxType type() { 4517 return type; 4518 } 4519 4520 @Override 4521 public Quantifier quantifier() { 4522 return quantifier; 4523 } 4524 } 4525 4526 public enum OutputParameter implements OnnxParameter { 4527 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4528 ; 4529 4530 final OnnxType type; 4531 final Quantifier quantifier; 4532 4533 OutputParameter(OnnxType type, Quantifier quantifier) { 4534 this.type = type; 4535 this.quantifier = quantifier; 4536 } 4537 4538 @Override 4539 public OnnxType type() { 4540 return type; 4541 } 4542 4543 @Override 4544 public Quantifier quantifier() { 4545 return quantifier; 4546 } 4547 } 4548 4549 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 4550 NAME, 4551 List.of(Attribute.values()), 4552 List.of(TypeConstraint.values()), 4553 List.of(InputParameter.values()), 4554 List.of(OutputParameter.values()) 4555 ); 4556 4557 public Clip(ExternalizedOp def) { 4558 super(SCHEMA, def); 4559 } 4560 4561 Clip(Clip that, CopyContext cc) { 4562 super(that, cc); 4563 } 4564 4565 @Override 4566 public Clip transform(CopyContext cc, OpTransformer ot) { 4567 return new Clip(this, cc); 4568 } 4569 4570 Clip(TypeElement resultType, Value input, java.util.Optional<Value> min, java.util.Optional<Value> max) { 4571 super(SCHEMA, resultType, Set.of(), List.of(input, min, max), List.of()); 4572 } 4573 4574 @Override 4575 public SequencedSet<OnnxParameter> onnxOutputs() { 4576 return onnxOutputs(SCHEMA); 4577 } 4578 4579 @Override 4580 public SequencedMap<OnnxParameter, Object> onnxInputs() { 4581 return onnxInputs(SCHEMA, List.of(input(), min(), max())); 4582 } 4583 4584 public Value input() { 4585 return operands().get(0); 4586 } 4587 4588 public java.util.Optional<Value> min() { 4589 int i = optionalInputArguments.indexOf(InputParameter.min); 4590 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 4591 } 4592 4593 public java.util.Optional<Value> max() { 4594 int i = optionalInputArguments.indexOf(InputParameter.max); 4595 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 4596 } 4597 4598 } 4599 4600 public static Clip Clip(TypeElement resultType, Value input, java.util.Optional<Value> min, java.util.Optional<Value> max) { 4601 return new Clip(resultType, input, min, max); 4602 } 4603 4604 @OpFactory.OpDeclaration(Col2Im.NAME) 4605 public static final class Col2Im extends OnnxOp { 4606 public static final String NAME = "Col2Im"; 4607 4608 public enum Attribute implements OnnxAttribute { 4609 pads(long[].class, true, null), 4610 dilations(long[].class, true, null), 4611 strides(long[].class, true, null), 4612 ; 4613 4614 final Class<?> t; 4615 final boolean optional; 4616 final Object defaultValue; 4617 4618 Attribute(Class<?> type, boolean optional, Object defaultValue) { 4619 this.t = type; 4620 this.optional = optional; 4621 this.defaultValue = defaultValue; 4622 assert optional || defaultValue == null; 4623 } 4624 4625 public Class<?> type() { 4626 return t; 4627 } 4628 4629 public boolean isOptional() { 4630 return optional; 4631 } 4632 4633 public Object defaultValue() { 4634 return defaultValue; 4635 } 4636 } 4637 4638 public enum TypeConstraint implements OnnxTypeConstraint { 4639 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())))), 4640 ; 4641 4642 final OnnxType.TypeVariable typeVariable; 4643 4644 TypeConstraint(OnnxType.TypeVariable typeVariable) { 4645 assert typeVariable.name().equals(name()); 4646 this.typeVariable = typeVariable; 4647 } 4648 4649 @Override 4650 public OnnxType.TypeVariable typeVariable() { 4651 return typeVariable; 4652 } 4653 } 4654 4655 public enum InputParameter implements OnnxParameter { 4656 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4657 image_shape(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 4658 block_shape(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 4659 ; 4660 4661 final OnnxType type; 4662 final Quantifier quantifier; 4663 4664 InputParameter(OnnxType type, Quantifier quantifier) { 4665 this.type = type; 4666 this.quantifier = quantifier; 4667 } 4668 4669 @Override 4670 public OnnxType type() { 4671 return type; 4672 } 4673 4674 @Override 4675 public Quantifier quantifier() { 4676 return quantifier; 4677 } 4678 } 4679 4680 public enum OutputParameter implements OnnxParameter { 4681 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4682 ; 4683 4684 final OnnxType type; 4685 final Quantifier quantifier; 4686 4687 OutputParameter(OnnxType type, Quantifier quantifier) { 4688 this.type = type; 4689 this.quantifier = quantifier; 4690 } 4691 4692 @Override 4693 public OnnxType type() { 4694 return type; 4695 } 4696 4697 @Override 4698 public Quantifier quantifier() { 4699 return quantifier; 4700 } 4701 } 4702 4703 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 4704 NAME, 4705 List.of(Attribute.values()), 4706 List.of(TypeConstraint.values()), 4707 List.of(InputParameter.values()), 4708 List.of(OutputParameter.values()) 4709 ); 4710 4711 public Col2Im(ExternalizedOp def) { 4712 super(SCHEMA, def); 4713 } 4714 4715 Col2Im(Col2Im that, CopyContext cc) { 4716 super(that, cc); 4717 } 4718 4719 @Override 4720 public Col2Im transform(CopyContext cc, OpTransformer ot) { 4721 return new Col2Im(this, cc); 4722 } 4723 4724 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) { 4725 super(SCHEMA, resultType, Set.of(), List.of(input, image_shape, block_shape), List.of(pads, dilations, strides)); 4726 } 4727 4728 @Override 4729 public SequencedSet<OnnxParameter> onnxOutputs() { 4730 return onnxOutputs(SCHEMA); 4731 } 4732 4733 @Override 4734 public SequencedMap<OnnxParameter, Object> onnxInputs() { 4735 return onnxInputs(SCHEMA, List.of(input(), image_shape(), block_shape())); 4736 } 4737 4738 public Value input() { 4739 return operands().get(0); 4740 } 4741 4742 public Value image_shape() { 4743 return operands().get(1); 4744 } 4745 4746 public Value block_shape() { 4747 return operands().get(2); 4748 } 4749 4750 public java.util.Optional<long[]> pads() { 4751 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 4752 return java.util.Optional.ofNullable(pads).map(long[]::clone); 4753 } 4754 4755 public java.util.Optional<long[]> dilations() { 4756 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 4757 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 4758 } 4759 4760 public java.util.Optional<long[]> strides() { 4761 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 4762 return java.util.Optional.ofNullable(strides).map(long[]::clone); 4763 } 4764 4765 } 4766 4767 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) { 4768 return new Col2Im(resultType, input, image_shape, block_shape, pads, dilations, strides); 4769 } 4770 4771 @OpFactory.OpDeclaration(Compress.NAME) 4772 public static final class Compress extends OnnxOp { 4773 public static final String NAME = "Compress"; 4774 4775 public enum Attribute implements OnnxAttribute { 4776 axis(Long.class, true, null), 4777 ; 4778 4779 final Class<?> t; 4780 final boolean optional; 4781 final Object defaultValue; 4782 4783 Attribute(Class<?> type, boolean optional, Object defaultValue) { 4784 this.t = type; 4785 this.optional = optional; 4786 this.defaultValue = defaultValue; 4787 assert optional || defaultValue == null; 4788 } 4789 4790 public Class<?> type() { 4791 return t; 4792 } 4793 4794 public boolean isOptional() { 4795 return optional; 4796 } 4797 4798 public Object defaultValue() { 4799 return defaultValue; 4800 } 4801 } 4802 4803 public enum TypeConstraint implements OnnxTypeConstraint { 4804 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())))), 4805 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))), 4806 ; 4807 4808 final OnnxType.TypeVariable typeVariable; 4809 4810 TypeConstraint(OnnxType.TypeVariable typeVariable) { 4811 assert typeVariable.name().equals(name()); 4812 this.typeVariable = typeVariable; 4813 } 4814 4815 @Override 4816 public OnnxType.TypeVariable typeVariable() { 4817 return typeVariable; 4818 } 4819 } 4820 4821 public enum InputParameter implements OnnxParameter { 4822 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4823 condition(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 4824 ; 4825 4826 final OnnxType type; 4827 final Quantifier quantifier; 4828 4829 InputParameter(OnnxType type, Quantifier quantifier) { 4830 this.type = type; 4831 this.quantifier = quantifier; 4832 } 4833 4834 @Override 4835 public OnnxType type() { 4836 return type; 4837 } 4838 4839 @Override 4840 public Quantifier quantifier() { 4841 return quantifier; 4842 } 4843 } 4844 4845 public enum OutputParameter implements OnnxParameter { 4846 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4847 ; 4848 4849 final OnnxType type; 4850 final Quantifier quantifier; 4851 4852 OutputParameter(OnnxType type, Quantifier quantifier) { 4853 this.type = type; 4854 this.quantifier = quantifier; 4855 } 4856 4857 @Override 4858 public OnnxType type() { 4859 return type; 4860 } 4861 4862 @Override 4863 public Quantifier quantifier() { 4864 return quantifier; 4865 } 4866 } 4867 4868 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 4869 NAME, 4870 List.of(Attribute.values()), 4871 List.of(TypeConstraint.values()), 4872 List.of(InputParameter.values()), 4873 List.of(OutputParameter.values()) 4874 ); 4875 4876 public Compress(ExternalizedOp def) { 4877 super(SCHEMA, def); 4878 } 4879 4880 Compress(Compress that, CopyContext cc) { 4881 super(that, cc); 4882 } 4883 4884 @Override 4885 public Compress transform(CopyContext cc, OpTransformer ot) { 4886 return new Compress(this, cc); 4887 } 4888 4889 Compress(TypeElement resultType, Value input, Value condition, java.util.Optional<Long> axis) { 4890 super(SCHEMA, resultType, Set.of(), List.of(input, condition), List.of(axis)); 4891 } 4892 4893 @Override 4894 public SequencedSet<OnnxParameter> onnxOutputs() { 4895 return onnxOutputs(SCHEMA); 4896 } 4897 4898 @Override 4899 public SequencedMap<OnnxParameter, Object> onnxInputs() { 4900 return onnxInputs(SCHEMA, List.of(input(), condition())); 4901 } 4902 4903 public Value input() { 4904 return operands().get(0); 4905 } 4906 4907 public Value condition() { 4908 return operands().get(1); 4909 } 4910 4911 public java.util.Optional<Long> axis() { 4912 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 4913 return java.util.Optional.ofNullable(axis); 4914 } 4915 4916 } 4917 4918 public static Compress Compress(TypeElement resultType, Value input, Value condition, java.util.Optional<Long> axis) { 4919 return new Compress(resultType, input, condition, axis); 4920 } 4921 4922 @OpFactory.OpDeclaration(Concat.NAME) 4923 public static final class Concat extends OnnxOp { 4924 public static final String NAME = "Concat"; 4925 4926 public enum Attribute implements OnnxAttribute { 4927 axis(Long.class, false, null), 4928 ; 4929 4930 final Class<?> t; 4931 final boolean optional; 4932 final Object defaultValue; 4933 4934 Attribute(Class<?> type, boolean optional, Object defaultValue) { 4935 this.t = type; 4936 this.optional = optional; 4937 this.defaultValue = defaultValue; 4938 assert optional || defaultValue == null; 4939 } 4940 4941 public Class<?> type() { 4942 return t; 4943 } 4944 4945 public boolean isOptional() { 4946 return optional; 4947 } 4948 4949 public Object defaultValue() { 4950 return defaultValue; 4951 } 4952 } 4953 4954 public enum TypeConstraint implements OnnxTypeConstraint { 4955 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())))), 4956 ; 4957 4958 final OnnxType.TypeVariable typeVariable; 4959 4960 TypeConstraint(OnnxType.TypeVariable typeVariable) { 4961 assert typeVariable.name().equals(name()); 4962 this.typeVariable = typeVariable; 4963 } 4964 4965 @Override 4966 public OnnxType.TypeVariable typeVariable() { 4967 return typeVariable; 4968 } 4969 } 4970 4971 public enum InputParameter implements OnnxParameter { 4972 inputs(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC), 4973 ; 4974 4975 final OnnxType type; 4976 final Quantifier quantifier; 4977 4978 InputParameter(OnnxType type, Quantifier quantifier) { 4979 this.type = type; 4980 this.quantifier = quantifier; 4981 } 4982 4983 @Override 4984 public OnnxType type() { 4985 return type; 4986 } 4987 4988 @Override 4989 public Quantifier quantifier() { 4990 return quantifier; 4991 } 4992 } 4993 4994 public enum OutputParameter implements OnnxParameter { 4995 concat_result(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 4996 ; 4997 4998 final OnnxType type; 4999 final Quantifier quantifier; 5000 5001 OutputParameter(OnnxType type, Quantifier quantifier) { 5002 this.type = type; 5003 this.quantifier = quantifier; 5004 } 5005 5006 @Override 5007 public OnnxType type() { 5008 return type; 5009 } 5010 5011 @Override 5012 public Quantifier quantifier() { 5013 return quantifier; 5014 } 5015 } 5016 5017 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 5018 NAME, 5019 List.of(Attribute.values()), 5020 List.of(TypeConstraint.values()), 5021 List.of(InputParameter.values()), 5022 List.of(OutputParameter.values()) 5023 ); 5024 5025 public Concat(ExternalizedOp def) { 5026 super(SCHEMA, def); 5027 } 5028 5029 Concat(Concat that, CopyContext cc) { 5030 super(that, cc); 5031 } 5032 5033 @Override 5034 public Concat transform(CopyContext cc, OpTransformer ot) { 5035 return new Concat(this, cc); 5036 } 5037 5038 Concat(TypeElement resultType, List<Value> inputs, long axis) { 5039 super(SCHEMA, resultType, Set.of(), List.of(inputs), List.of(axis)); 5040 } 5041 5042 @Override 5043 public SequencedSet<OnnxParameter> onnxOutputs() { 5044 return onnxOutputs(SCHEMA); 5045 } 5046 5047 @Override 5048 public SequencedMap<OnnxParameter, Object> onnxInputs() { 5049 return onnxInputs(SCHEMA, List.of(inputs())); 5050 } 5051 5052 public List<Value> inputs() { 5053 return operands(); 5054 } 5055 5056 public long axis() { 5057 long axis = Attribute.axis.access(Long.class, onnxAttributes); 5058 return axis; 5059 } 5060 5061 } 5062 5063 public static Concat Concat(TypeElement resultType, List<Value> inputs, long axis) { 5064 return new Concat(resultType, inputs, axis); 5065 } 5066 5067 @OpFactory.OpDeclaration(ConcatFromSequence.NAME) 5068 public static final class ConcatFromSequence extends OnnxOp { 5069 public static final String NAME = "ConcatFromSequence"; 5070 5071 public enum Attribute implements OnnxAttribute { 5072 axis(Long.class, false, null), 5073 new_axis(Long.class, true, 0), 5074 ; 5075 5076 final Class<?> t; 5077 final boolean optional; 5078 final Object defaultValue; 5079 5080 Attribute(Class<?> type, boolean optional, Object defaultValue) { 5081 this.t = type; 5082 this.optional = optional; 5083 this.defaultValue = defaultValue; 5084 assert optional || defaultValue == null; 5085 } 5086 5087 public Class<?> type() { 5088 return t; 5089 } 5090 5091 public boolean isOptional() { 5092 return optional; 5093 } 5094 5095 public Object defaultValue() { 5096 return defaultValue; 5097 } 5098 } 5099 5100 public enum TypeConstraint implements OnnxTypeConstraint { 5101 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()))))), 5102 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())))), 5103 ; 5104 5105 final OnnxType.TypeVariable typeVariable; 5106 5107 TypeConstraint(OnnxType.TypeVariable typeVariable) { 5108 assert typeVariable.name().equals(name()); 5109 this.typeVariable = typeVariable; 5110 } 5111 5112 @Override 5113 public OnnxType.TypeVariable typeVariable() { 5114 return typeVariable; 5115 } 5116 } 5117 5118 public enum InputParameter implements OnnxParameter { 5119 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 5120 ; 5121 5122 final OnnxType type; 5123 final Quantifier quantifier; 5124 5125 InputParameter(OnnxType type, Quantifier quantifier) { 5126 this.type = type; 5127 this.quantifier = quantifier; 5128 } 5129 5130 @Override 5131 public OnnxType type() { 5132 return type; 5133 } 5134 5135 @Override 5136 public Quantifier quantifier() { 5137 return quantifier; 5138 } 5139 } 5140 5141 public enum OutputParameter implements OnnxParameter { 5142 concat_result(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 5143 ; 5144 5145 final OnnxType type; 5146 final Quantifier quantifier; 5147 5148 OutputParameter(OnnxType type, Quantifier quantifier) { 5149 this.type = type; 5150 this.quantifier = quantifier; 5151 } 5152 5153 @Override 5154 public OnnxType type() { 5155 return type; 5156 } 5157 5158 @Override 5159 public Quantifier quantifier() { 5160 return quantifier; 5161 } 5162 } 5163 5164 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 5165 NAME, 5166 List.of(Attribute.values()), 5167 List.of(TypeConstraint.values()), 5168 List.of(InputParameter.values()), 5169 List.of(OutputParameter.values()) 5170 ); 5171 5172 public ConcatFromSequence(ExternalizedOp def) { 5173 super(SCHEMA, def); 5174 } 5175 5176 ConcatFromSequence(ConcatFromSequence that, CopyContext cc) { 5177 super(that, cc); 5178 } 5179 5180 @Override 5181 public ConcatFromSequence transform(CopyContext cc, OpTransformer ot) { 5182 return new ConcatFromSequence(this, cc); 5183 } 5184 5185 ConcatFromSequence(TypeElement resultType, Value input_sequence, long axis, java.util.Optional<Long> new_axis) { 5186 super(SCHEMA, resultType, Set.of(), List.of(input_sequence), List.of(axis, new_axis)); 5187 } 5188 5189 @Override 5190 public SequencedSet<OnnxParameter> onnxOutputs() { 5191 return onnxOutputs(SCHEMA); 5192 } 5193 5194 @Override 5195 public SequencedMap<OnnxParameter, Object> onnxInputs() { 5196 return onnxInputs(SCHEMA, List.of(input_sequence())); 5197 } 5198 5199 public Value input_sequence() { 5200 return operands().get(0); 5201 } 5202 5203 public long axis() { 5204 long axis = Attribute.axis.access(Long.class, onnxAttributes); 5205 return axis; 5206 } 5207 5208 public java.util.Optional<Long> new_axis() { 5209 Long new_axis = Attribute.new_axis.access(Long.class, onnxAttributes); 5210 return java.util.Optional.ofNullable(new_axis); 5211 } 5212 5213 } 5214 5215 public static ConcatFromSequence ConcatFromSequence(TypeElement resultType, Value input_sequence, long axis, java.util.Optional<Long> new_axis) { 5216 return new ConcatFromSequence(resultType, input_sequence, axis, new_axis); 5217 } 5218 5219 @OpFactory.OpDeclaration(Constant.NAME) 5220 public static final class Constant extends OnnxOp { 5221 public static final String NAME = "Constant"; 5222 5223 public enum Attribute implements OnnxAttribute { 5224 value_int(Long.class, true, null), 5225 value_floats(float[].class, true, null), 5226 value_strings(String[].class, true, null), 5227 value_float(Float.class, true, null), 5228 value_string(String.class, true, null), 5229 value_ints(long[].class, true, null), 5230 sparse_value(byte[].class, true, null), 5231 value(Tensor.class, true, null), 5232 ; 5233 5234 final Class<?> t; 5235 final boolean optional; 5236 final Object defaultValue; 5237 5238 Attribute(Class<?> type, boolean optional, Object defaultValue) { 5239 this.t = type; 5240 this.optional = optional; 5241 this.defaultValue = defaultValue; 5242 assert optional || defaultValue == null; 5243 } 5244 5245 public Class<?> type() { 5246 return t; 5247 } 5248 5249 public boolean isOptional() { 5250 return optional; 5251 } 5252 5253 public Object defaultValue() { 5254 return defaultValue; 5255 } 5256 } 5257 5258 public enum TypeConstraint implements OnnxTypeConstraint { 5259 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())))), 5260 ; 5261 5262 final OnnxType.TypeVariable typeVariable; 5263 5264 TypeConstraint(OnnxType.TypeVariable typeVariable) { 5265 assert typeVariable.name().equals(name()); 5266 this.typeVariable = typeVariable; 5267 } 5268 5269 @Override 5270 public OnnxType.TypeVariable typeVariable() { 5271 return typeVariable; 5272 } 5273 } 5274 5275 public enum InputParameter implements OnnxParameter.None { } 5276 5277 public enum OutputParameter implements OnnxParameter { 5278 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 5279 ; 5280 5281 final OnnxType type; 5282 final Quantifier quantifier; 5283 5284 OutputParameter(OnnxType type, Quantifier quantifier) { 5285 this.type = type; 5286 this.quantifier = quantifier; 5287 } 5288 5289 @Override 5290 public OnnxType type() { 5291 return type; 5292 } 5293 5294 @Override 5295 public Quantifier quantifier() { 5296 return quantifier; 5297 } 5298 } 5299 5300 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 5301 NAME, 5302 List.of(Attribute.values()), 5303 List.of(TypeConstraint.values()), 5304 List.of(InputParameter.values()), 5305 List.of(OutputParameter.values()) 5306 ); 5307 5308 public Constant(ExternalizedOp def) { 5309 super(SCHEMA, def); 5310 } 5311 5312 Constant(Constant that, CopyContext cc) { 5313 super(that, cc); 5314 } 5315 5316 @Override 5317 public Constant transform(CopyContext cc, OpTransformer ot) { 5318 return new Constant(this, cc); 5319 } 5320 5321 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) { 5322 super(SCHEMA, resultType, Set.of(), List.of(), List.of(value_int, value_floats, value_strings, value_float, value_string, value_ints, sparse_value, value)); 5323 } 5324 5325 @Override 5326 public SequencedSet<OnnxParameter> onnxOutputs() { 5327 return onnxOutputs(SCHEMA); 5328 } 5329 5330 @Override 5331 public SequencedMap<OnnxParameter, Object> onnxInputs() { 5332 return onnxInputs(SCHEMA, List.of()); 5333 } 5334 5335 public java.util.Optional<Long> value_int() { 5336 Long value_int = Attribute.value_int.access(Long.class, onnxAttributes); 5337 return java.util.Optional.ofNullable(value_int); 5338 } 5339 5340 public java.util.Optional<float[]> value_floats() { 5341 float[] value_floats = Attribute.value_floats.access(float[].class, onnxAttributes); 5342 return java.util.Optional.ofNullable(value_floats).map(float[]::clone); 5343 } 5344 5345 public java.util.Optional<String[]> value_strings() { 5346 String[] value_strings = Attribute.value_strings.access(String[].class, onnxAttributes); 5347 return java.util.Optional.ofNullable(value_strings).map(String[]::clone); 5348 } 5349 5350 public java.util.Optional<Float> value_float() { 5351 Float value_float = Attribute.value_float.access(Float.class, onnxAttributes); 5352 return java.util.Optional.ofNullable(value_float); 5353 } 5354 5355 public java.util.Optional<String> value_string() { 5356 String value_string = Attribute.value_string.access(String.class, onnxAttributes); 5357 return java.util.Optional.ofNullable(value_string); 5358 } 5359 5360 public java.util.Optional<long[]> value_ints() { 5361 long[] value_ints = Attribute.value_ints.access(long[].class, onnxAttributes); 5362 return java.util.Optional.ofNullable(value_ints).map(long[]::clone); 5363 } 5364 5365 public java.util.Optional<byte[]> sparse_value() { 5366 byte[] sparse_value = Attribute.sparse_value.access(byte[].class, onnxAttributes); 5367 return java.util.Optional.ofNullable(sparse_value).map(byte[]::clone); 5368 } 5369 5370 public java.util.Optional<Tensor> value() { 5371 Tensor value = Attribute.value.access(Tensor.class, onnxAttributes); 5372 return java.util.Optional.ofNullable(value); 5373 } 5374 5375 } 5376 5377 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) { 5378 return new Constant(resultType, value_int, value_floats, value_strings, value_float, value_string, value_ints, sparse_value, value); 5379 } 5380 5381 @OpFactory.OpDeclaration(ConstantOfShape.NAME) 5382 public static final class ConstantOfShape extends OnnxOp { 5383 public static final String NAME = "ConstantOfShape"; 5384 5385 public enum Attribute implements OnnxAttribute { 5386 value(Tensor.class, true, null), 5387 ; 5388 5389 final Class<?> t; 5390 final boolean optional; 5391 final Object defaultValue; 5392 5393 Attribute(Class<?> type, boolean optional, Object defaultValue) { 5394 this.t = type; 5395 this.optional = optional; 5396 this.defaultValue = defaultValue; 5397 assert optional || defaultValue == null; 5398 } 5399 5400 public Class<?> type() { 5401 return t; 5402 } 5403 5404 public boolean isOptional() { 5405 return optional; 5406 } 5407 5408 public Object defaultValue() { 5409 return defaultValue; 5410 } 5411 } 5412 5413 public enum TypeConstraint implements OnnxTypeConstraint { 5414 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int64())))), 5415 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())))), 5416 ; 5417 5418 final OnnxType.TypeVariable typeVariable; 5419 5420 TypeConstraint(OnnxType.TypeVariable typeVariable) { 5421 assert typeVariable.name().equals(name()); 5422 this.typeVariable = typeVariable; 5423 } 5424 5425 @Override 5426 public OnnxType.TypeVariable typeVariable() { 5427 return typeVariable; 5428 } 5429 } 5430 5431 public enum InputParameter implements OnnxParameter { 5432 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 5433 ; 5434 5435 final OnnxType type; 5436 final Quantifier quantifier; 5437 5438 InputParameter(OnnxType type, Quantifier quantifier) { 5439 this.type = type; 5440 this.quantifier = quantifier; 5441 } 5442 5443 @Override 5444 public OnnxType type() { 5445 return type; 5446 } 5447 5448 @Override 5449 public Quantifier quantifier() { 5450 return quantifier; 5451 } 5452 } 5453 5454 public enum OutputParameter implements OnnxParameter { 5455 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 5456 ; 5457 5458 final OnnxType type; 5459 final Quantifier quantifier; 5460 5461 OutputParameter(OnnxType type, Quantifier quantifier) { 5462 this.type = type; 5463 this.quantifier = quantifier; 5464 } 5465 5466 @Override 5467 public OnnxType type() { 5468 return type; 5469 } 5470 5471 @Override 5472 public Quantifier quantifier() { 5473 return quantifier; 5474 } 5475 } 5476 5477 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 5478 NAME, 5479 List.of(Attribute.values()), 5480 List.of(TypeConstraint.values()), 5481 List.of(InputParameter.values()), 5482 List.of(OutputParameter.values()) 5483 ); 5484 5485 public ConstantOfShape(ExternalizedOp def) { 5486 super(SCHEMA, def); 5487 } 5488 5489 ConstantOfShape(ConstantOfShape that, CopyContext cc) { 5490 super(that, cc); 5491 } 5492 5493 @Override 5494 public ConstantOfShape transform(CopyContext cc, OpTransformer ot) { 5495 return new ConstantOfShape(this, cc); 5496 } 5497 5498 ConstantOfShape(TypeElement resultType, Value input, java.util.Optional<Tensor> value) { 5499 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(value)); 5500 } 5501 5502 @Override 5503 public SequencedSet<OnnxParameter> onnxOutputs() { 5504 return onnxOutputs(SCHEMA); 5505 } 5506 5507 @Override 5508 public SequencedMap<OnnxParameter, Object> onnxInputs() { 5509 return onnxInputs(SCHEMA, List.of(input())); 5510 } 5511 5512 public Value input() { 5513 return operands().get(0); 5514 } 5515 5516 public java.util.Optional<Tensor> value() { 5517 Tensor value = Attribute.value.access(Tensor.class, onnxAttributes); 5518 return java.util.Optional.ofNullable(value); 5519 } 5520 5521 } 5522 5523 public static ConstantOfShape ConstantOfShape(TypeElement resultType, Value input, java.util.Optional<Tensor> value) { 5524 return new ConstantOfShape(resultType, input, value); 5525 } 5526 5527 @OpFactory.OpDeclaration(Conv.NAME) 5528 public static final class Conv extends OnnxOp { 5529 public static final String NAME = "Conv"; 5530 5531 public enum Attribute implements OnnxAttribute { 5532 pads(long[].class, true, null), 5533 dilations(long[].class, true, null), 5534 auto_pad(String.class, true, "NOTSET"), 5535 strides(long[].class, true, null), 5536 group(Long.class, true, 1), 5537 kernel_shape(long[].class, true, null), 5538 ; 5539 5540 final Class<?> t; 5541 final boolean optional; 5542 final Object defaultValue; 5543 5544 Attribute(Class<?> type, boolean optional, Object defaultValue) { 5545 this.t = type; 5546 this.optional = optional; 5547 this.defaultValue = defaultValue; 5548 assert optional || defaultValue == null; 5549 } 5550 5551 public Class<?> type() { 5552 return t; 5553 } 5554 5555 public boolean isOptional() { 5556 return optional; 5557 } 5558 5559 public Object defaultValue() { 5560 return defaultValue; 5561 } 5562 } 5563 5564 public enum TypeConstraint implements OnnxTypeConstraint { 5565 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 5566 ; 5567 5568 final OnnxType.TypeVariable typeVariable; 5569 5570 TypeConstraint(OnnxType.TypeVariable typeVariable) { 5571 assert typeVariable.name().equals(name()); 5572 this.typeVariable = typeVariable; 5573 } 5574 5575 @Override 5576 public OnnxType.TypeVariable typeVariable() { 5577 return typeVariable; 5578 } 5579 } 5580 5581 public enum InputParameter implements OnnxParameter { 5582 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 5583 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 5584 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 5585 ; 5586 5587 final OnnxType type; 5588 final Quantifier quantifier; 5589 5590 InputParameter(OnnxType type, Quantifier quantifier) { 5591 this.type = type; 5592 this.quantifier = quantifier; 5593 } 5594 5595 @Override 5596 public OnnxType type() { 5597 return type; 5598 } 5599 5600 @Override 5601 public Quantifier quantifier() { 5602 return quantifier; 5603 } 5604 } 5605 5606 public enum OutputParameter implements OnnxParameter { 5607 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 5608 ; 5609 5610 final OnnxType type; 5611 final Quantifier quantifier; 5612 5613 OutputParameter(OnnxType type, Quantifier quantifier) { 5614 this.type = type; 5615 this.quantifier = quantifier; 5616 } 5617 5618 @Override 5619 public OnnxType type() { 5620 return type; 5621 } 5622 5623 @Override 5624 public Quantifier quantifier() { 5625 return quantifier; 5626 } 5627 } 5628 5629 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 5630 NAME, 5631 List.of(Attribute.values()), 5632 List.of(TypeConstraint.values()), 5633 List.of(InputParameter.values()), 5634 List.of(OutputParameter.values()) 5635 ); 5636 5637 public Conv(ExternalizedOp def) { 5638 super(SCHEMA, def); 5639 } 5640 5641 Conv(Conv that, CopyContext cc) { 5642 super(that, cc); 5643 } 5644 5645 @Override 5646 public Conv transform(CopyContext cc, OpTransformer ot) { 5647 return new Conv(this, cc); 5648 } 5649 5650 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) { 5651 super(SCHEMA, resultType, Set.of(), List.of(X, W, B), List.of(pads, dilations, auto_pad, strides, group, kernel_shape)); 5652 } 5653 5654 @Override 5655 public SequencedSet<OnnxParameter> onnxOutputs() { 5656 return onnxOutputs(SCHEMA); 5657 } 5658 5659 @Override 5660 public SequencedMap<OnnxParameter, Object> onnxInputs() { 5661 return onnxInputs(SCHEMA, List.of(X(), W(), B())); 5662 } 5663 5664 public Value X() { 5665 return operands().get(0); 5666 } 5667 5668 public Value W() { 5669 return operands().get(1); 5670 } 5671 5672 public java.util.Optional<Value> B() { 5673 int i = optionalInputArguments.indexOf(InputParameter.B); 5674 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 5675 } 5676 5677 public java.util.Optional<long[]> pads() { 5678 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 5679 return java.util.Optional.ofNullable(pads).map(long[]::clone); 5680 } 5681 5682 public java.util.Optional<long[]> dilations() { 5683 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 5684 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 5685 } 5686 5687 public java.util.Optional<String> auto_pad() { 5688 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes); 5689 return java.util.Optional.ofNullable(auto_pad); 5690 } 5691 5692 public java.util.Optional<long[]> strides() { 5693 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 5694 return java.util.Optional.ofNullable(strides).map(long[]::clone); 5695 } 5696 5697 public java.util.Optional<Long> group() { 5698 Long group = Attribute.group.access(Long.class, onnxAttributes); 5699 return java.util.Optional.ofNullable(group); 5700 } 5701 5702 public java.util.Optional<long[]> kernel_shape() { 5703 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 5704 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone); 5705 } 5706 5707 } 5708 5709 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) { 5710 return new Conv(resultType, X, W, B, pads, dilations, auto_pad, strides, group, kernel_shape); 5711 } 5712 5713 @OpFactory.OpDeclaration(ConvInteger.NAME) 5714 public static final class ConvInteger extends OnnxOp { 5715 public static final String NAME = "ConvInteger"; 5716 5717 public enum Attribute implements OnnxAttribute { 5718 pads(long[].class, true, null), 5719 dilations(long[].class, true, null), 5720 auto_pad(String.class, true, "NOTSET"), 5721 strides(long[].class, true, null), 5722 group(Long.class, true, 1), 5723 kernel_shape(long[].class, true, null), 5724 ; 5725 5726 final Class<?> t; 5727 final boolean optional; 5728 final Object defaultValue; 5729 5730 Attribute(Class<?> type, boolean optional, Object defaultValue) { 5731 this.t = type; 5732 this.optional = optional; 5733 this.defaultValue = defaultValue; 5734 assert optional || defaultValue == null; 5735 } 5736 5737 public Class<?> type() { 5738 return t; 5739 } 5740 5741 public boolean isOptional() { 5742 return optional; 5743 } 5744 5745 public Object defaultValue() { 5746 return defaultValue; 5747 } 5748 } 5749 5750 public enum TypeConstraint implements OnnxTypeConstraint { 5751 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))), 5752 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))), 5753 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int32())))), 5754 ; 5755 5756 final OnnxType.TypeVariable typeVariable; 5757 5758 TypeConstraint(OnnxType.TypeVariable typeVariable) { 5759 assert typeVariable.name().equals(name()); 5760 this.typeVariable = typeVariable; 5761 } 5762 5763 @Override 5764 public OnnxType.TypeVariable typeVariable() { 5765 return typeVariable; 5766 } 5767 } 5768 5769 public enum InputParameter implements OnnxParameter { 5770 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 5771 w(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 5772 x_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL), 5773 w_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 5774 ; 5775 5776 final OnnxType type; 5777 final Quantifier quantifier; 5778 5779 InputParameter(OnnxType type, Quantifier quantifier) { 5780 this.type = type; 5781 this.quantifier = quantifier; 5782 } 5783 5784 @Override 5785 public OnnxType type() { 5786 return type; 5787 } 5788 5789 @Override 5790 public Quantifier quantifier() { 5791 return quantifier; 5792 } 5793 } 5794 5795 public enum OutputParameter implements OnnxParameter { 5796 y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 5797 ; 5798 5799 final OnnxType type; 5800 final Quantifier quantifier; 5801 5802 OutputParameter(OnnxType type, Quantifier quantifier) { 5803 this.type = type; 5804 this.quantifier = quantifier; 5805 } 5806 5807 @Override 5808 public OnnxType type() { 5809 return type; 5810 } 5811 5812 @Override 5813 public Quantifier quantifier() { 5814 return quantifier; 5815 } 5816 } 5817 5818 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 5819 NAME, 5820 List.of(Attribute.values()), 5821 List.of(TypeConstraint.values()), 5822 List.of(InputParameter.values()), 5823 List.of(OutputParameter.values()) 5824 ); 5825 5826 public ConvInteger(ExternalizedOp def) { 5827 super(SCHEMA, def); 5828 } 5829 5830 ConvInteger(ConvInteger that, CopyContext cc) { 5831 super(that, cc); 5832 } 5833 5834 @Override 5835 public ConvInteger transform(CopyContext cc, OpTransformer ot) { 5836 return new ConvInteger(this, cc); 5837 } 5838 5839 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) { 5840 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)); 5841 } 5842 5843 @Override 5844 public SequencedSet<OnnxParameter> onnxOutputs() { 5845 return onnxOutputs(SCHEMA); 5846 } 5847 5848 @Override 5849 public SequencedMap<OnnxParameter, Object> onnxInputs() { 5850 return onnxInputs(SCHEMA, List.of(x(), w(), x_zero_point(), w_zero_point())); 5851 } 5852 5853 public Value x() { 5854 return operands().get(0); 5855 } 5856 5857 public Value w() { 5858 return operands().get(1); 5859 } 5860 5861 public java.util.Optional<Value> x_zero_point() { 5862 int i = optionalInputArguments.indexOf(InputParameter.x_zero_point); 5863 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 5864 } 5865 5866 public java.util.Optional<Value> w_zero_point() { 5867 int i = optionalInputArguments.indexOf(InputParameter.w_zero_point); 5868 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 5869 } 5870 5871 public java.util.Optional<long[]> pads() { 5872 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 5873 return java.util.Optional.ofNullable(pads).map(long[]::clone); 5874 } 5875 5876 public java.util.Optional<long[]> dilations() { 5877 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 5878 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 5879 } 5880 5881 public java.util.Optional<String> auto_pad() { 5882 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes); 5883 return java.util.Optional.ofNullable(auto_pad); 5884 } 5885 5886 public java.util.Optional<long[]> strides() { 5887 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 5888 return java.util.Optional.ofNullable(strides).map(long[]::clone); 5889 } 5890 5891 public java.util.Optional<Long> group() { 5892 Long group = Attribute.group.access(Long.class, onnxAttributes); 5893 return java.util.Optional.ofNullable(group); 5894 } 5895 5896 public java.util.Optional<long[]> kernel_shape() { 5897 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 5898 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone); 5899 } 5900 5901 } 5902 5903 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) { 5904 return new ConvInteger(resultType, x, w, x_zero_point, w_zero_point, pads, dilations, auto_pad, strides, group, kernel_shape); 5905 } 5906 5907 @OpFactory.OpDeclaration(ConvTranspose.NAME) 5908 public static final class ConvTranspose extends OnnxOp { 5909 public static final String NAME = "ConvTranspose"; 5910 5911 public enum Attribute implements OnnxAttribute { 5912 output_shape(long[].class, true, null), 5913 pads(long[].class, true, null), 5914 dilations(long[].class, true, null), 5915 auto_pad(String.class, true, "NOTSET"), 5916 strides(long[].class, true, null), 5917 group(Long.class, true, 1), 5918 kernel_shape(long[].class, true, null), 5919 output_padding(long[].class, true, null), 5920 ; 5921 5922 final Class<?> t; 5923 final boolean optional; 5924 final Object defaultValue; 5925 5926 Attribute(Class<?> type, boolean optional, Object defaultValue) { 5927 this.t = type; 5928 this.optional = optional; 5929 this.defaultValue = defaultValue; 5930 assert optional || defaultValue == null; 5931 } 5932 5933 public Class<?> type() { 5934 return t; 5935 } 5936 5937 public boolean isOptional() { 5938 return optional; 5939 } 5940 5941 public Object defaultValue() { 5942 return defaultValue; 5943 } 5944 } 5945 5946 public enum TypeConstraint implements OnnxTypeConstraint { 5947 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 5948 ; 5949 5950 final OnnxType.TypeVariable typeVariable; 5951 5952 TypeConstraint(OnnxType.TypeVariable typeVariable) { 5953 assert typeVariable.name().equals(name()); 5954 this.typeVariable = typeVariable; 5955 } 5956 5957 @Override 5958 public OnnxType.TypeVariable typeVariable() { 5959 return typeVariable; 5960 } 5961 } 5962 5963 public enum InputParameter implements OnnxParameter { 5964 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 5965 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 5966 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 5967 ; 5968 5969 final OnnxType type; 5970 final Quantifier quantifier; 5971 5972 InputParameter(OnnxType type, Quantifier quantifier) { 5973 this.type = type; 5974 this.quantifier = quantifier; 5975 } 5976 5977 @Override 5978 public OnnxType type() { 5979 return type; 5980 } 5981 5982 @Override 5983 public Quantifier quantifier() { 5984 return quantifier; 5985 } 5986 } 5987 5988 public enum OutputParameter implements OnnxParameter { 5989 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 5990 ; 5991 5992 final OnnxType type; 5993 final Quantifier quantifier; 5994 5995 OutputParameter(OnnxType type, Quantifier quantifier) { 5996 this.type = type; 5997 this.quantifier = quantifier; 5998 } 5999 6000 @Override 6001 public OnnxType type() { 6002 return type; 6003 } 6004 6005 @Override 6006 public Quantifier quantifier() { 6007 return quantifier; 6008 } 6009 } 6010 6011 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 6012 NAME, 6013 List.of(Attribute.values()), 6014 List.of(TypeConstraint.values()), 6015 List.of(InputParameter.values()), 6016 List.of(OutputParameter.values()) 6017 ); 6018 6019 public ConvTranspose(ExternalizedOp def) { 6020 super(SCHEMA, def); 6021 } 6022 6023 ConvTranspose(ConvTranspose that, CopyContext cc) { 6024 super(that, cc); 6025 } 6026 6027 @Override 6028 public ConvTranspose transform(CopyContext cc, OpTransformer ot) { 6029 return new ConvTranspose(this, cc); 6030 } 6031 6032 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) { 6033 super(SCHEMA, resultType, Set.of(), List.of(X, W, B), List.of(output_shape, pads, dilations, auto_pad, strides, group, kernel_shape, output_padding)); 6034 } 6035 6036 @Override 6037 public SequencedSet<OnnxParameter> onnxOutputs() { 6038 return onnxOutputs(SCHEMA); 6039 } 6040 6041 @Override 6042 public SequencedMap<OnnxParameter, Object> onnxInputs() { 6043 return onnxInputs(SCHEMA, List.of(X(), W(), B())); 6044 } 6045 6046 public Value X() { 6047 return operands().get(0); 6048 } 6049 6050 public Value W() { 6051 return operands().get(1); 6052 } 6053 6054 public java.util.Optional<Value> B() { 6055 int i = optionalInputArguments.indexOf(InputParameter.B); 6056 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 6057 } 6058 6059 public java.util.Optional<long[]> output_shape() { 6060 long[] output_shape = Attribute.output_shape.access(long[].class, onnxAttributes); 6061 return java.util.Optional.ofNullable(output_shape).map(long[]::clone); 6062 } 6063 6064 public java.util.Optional<long[]> pads() { 6065 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 6066 return java.util.Optional.ofNullable(pads).map(long[]::clone); 6067 } 6068 6069 public java.util.Optional<long[]> dilations() { 6070 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 6071 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 6072 } 6073 6074 public java.util.Optional<String> auto_pad() { 6075 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes); 6076 return java.util.Optional.ofNullable(auto_pad); 6077 } 6078 6079 public java.util.Optional<long[]> strides() { 6080 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 6081 return java.util.Optional.ofNullable(strides).map(long[]::clone); 6082 } 6083 6084 public java.util.Optional<Long> group() { 6085 Long group = Attribute.group.access(Long.class, onnxAttributes); 6086 return java.util.Optional.ofNullable(group); 6087 } 6088 6089 public java.util.Optional<long[]> kernel_shape() { 6090 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 6091 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone); 6092 } 6093 6094 public java.util.Optional<long[]> output_padding() { 6095 long[] output_padding = Attribute.output_padding.access(long[].class, onnxAttributes); 6096 return java.util.Optional.ofNullable(output_padding).map(long[]::clone); 6097 } 6098 6099 } 6100 6101 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) { 6102 return new ConvTranspose(resultType, X, W, B, output_shape, pads, dilations, auto_pad, strides, group, kernel_shape, output_padding); 6103 } 6104 6105 @OpFactory.OpDeclaration(Cos.NAME) 6106 public static final class Cos extends OnnxOp { 6107 public static final String NAME = "Cos"; 6108 6109 public enum Attribute implements OnnxAttribute.None { } 6110 6111 public enum TypeConstraint implements OnnxTypeConstraint { 6112 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 6113 ; 6114 6115 final OnnxType.TypeVariable typeVariable; 6116 6117 TypeConstraint(OnnxType.TypeVariable typeVariable) { 6118 assert typeVariable.name().equals(name()); 6119 this.typeVariable = typeVariable; 6120 } 6121 6122 @Override 6123 public OnnxType.TypeVariable typeVariable() { 6124 return typeVariable; 6125 } 6126 } 6127 6128 public enum InputParameter implements OnnxParameter { 6129 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6130 ; 6131 6132 final OnnxType type; 6133 final Quantifier quantifier; 6134 6135 InputParameter(OnnxType type, Quantifier quantifier) { 6136 this.type = type; 6137 this.quantifier = quantifier; 6138 } 6139 6140 @Override 6141 public OnnxType type() { 6142 return type; 6143 } 6144 6145 @Override 6146 public Quantifier quantifier() { 6147 return quantifier; 6148 } 6149 } 6150 6151 public enum OutputParameter implements OnnxParameter { 6152 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6153 ; 6154 6155 final OnnxType type; 6156 final Quantifier quantifier; 6157 6158 OutputParameter(OnnxType type, Quantifier quantifier) { 6159 this.type = type; 6160 this.quantifier = quantifier; 6161 } 6162 6163 @Override 6164 public OnnxType type() { 6165 return type; 6166 } 6167 6168 @Override 6169 public Quantifier quantifier() { 6170 return quantifier; 6171 } 6172 } 6173 6174 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 6175 NAME, 6176 List.of(Attribute.values()), 6177 List.of(TypeConstraint.values()), 6178 List.of(InputParameter.values()), 6179 List.of(OutputParameter.values()) 6180 ); 6181 6182 public Cos(ExternalizedOp def) { 6183 super(SCHEMA, def); 6184 } 6185 6186 Cos(Cos that, CopyContext cc) { 6187 super(that, cc); 6188 } 6189 6190 @Override 6191 public Cos transform(CopyContext cc, OpTransformer ot) { 6192 return new Cos(this, cc); 6193 } 6194 6195 Cos(TypeElement resultType, Value input) { 6196 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 6197 } 6198 6199 @Override 6200 public SequencedSet<OnnxParameter> onnxOutputs() { 6201 return onnxOutputs(SCHEMA); 6202 } 6203 6204 @Override 6205 public SequencedMap<OnnxParameter, Object> onnxInputs() { 6206 return onnxInputs(SCHEMA, List.of(input())); 6207 } 6208 6209 public Value input() { 6210 return operands().get(0); 6211 } 6212 6213 } 6214 6215 public static Cos Cos(TypeElement resultType, Value input) { 6216 return new Cos(resultType, input); 6217 } 6218 6219 @OpFactory.OpDeclaration(Cosh.NAME) 6220 public static final class Cosh extends OnnxOp { 6221 public static final String NAME = "Cosh"; 6222 6223 public enum Attribute implements OnnxAttribute.None { } 6224 6225 public enum TypeConstraint implements OnnxTypeConstraint { 6226 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 6227 ; 6228 6229 final OnnxType.TypeVariable typeVariable; 6230 6231 TypeConstraint(OnnxType.TypeVariable typeVariable) { 6232 assert typeVariable.name().equals(name()); 6233 this.typeVariable = typeVariable; 6234 } 6235 6236 @Override 6237 public OnnxType.TypeVariable typeVariable() { 6238 return typeVariable; 6239 } 6240 } 6241 6242 public enum InputParameter implements OnnxParameter { 6243 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6244 ; 6245 6246 final OnnxType type; 6247 final Quantifier quantifier; 6248 6249 InputParameter(OnnxType type, Quantifier quantifier) { 6250 this.type = type; 6251 this.quantifier = quantifier; 6252 } 6253 6254 @Override 6255 public OnnxType type() { 6256 return type; 6257 } 6258 6259 @Override 6260 public Quantifier quantifier() { 6261 return quantifier; 6262 } 6263 } 6264 6265 public enum OutputParameter implements OnnxParameter { 6266 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6267 ; 6268 6269 final OnnxType type; 6270 final Quantifier quantifier; 6271 6272 OutputParameter(OnnxType type, Quantifier quantifier) { 6273 this.type = type; 6274 this.quantifier = quantifier; 6275 } 6276 6277 @Override 6278 public OnnxType type() { 6279 return type; 6280 } 6281 6282 @Override 6283 public Quantifier quantifier() { 6284 return quantifier; 6285 } 6286 } 6287 6288 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 6289 NAME, 6290 List.of(Attribute.values()), 6291 List.of(TypeConstraint.values()), 6292 List.of(InputParameter.values()), 6293 List.of(OutputParameter.values()) 6294 ); 6295 6296 public Cosh(ExternalizedOp def) { 6297 super(SCHEMA, def); 6298 } 6299 6300 Cosh(Cosh that, CopyContext cc) { 6301 super(that, cc); 6302 } 6303 6304 @Override 6305 public Cosh transform(CopyContext cc, OpTransformer ot) { 6306 return new Cosh(this, cc); 6307 } 6308 6309 Cosh(TypeElement resultType, Value input) { 6310 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 6311 } 6312 6313 @Override 6314 public SequencedSet<OnnxParameter> onnxOutputs() { 6315 return onnxOutputs(SCHEMA); 6316 } 6317 6318 @Override 6319 public SequencedMap<OnnxParameter, Object> onnxInputs() { 6320 return onnxInputs(SCHEMA, List.of(input())); 6321 } 6322 6323 public Value input() { 6324 return operands().get(0); 6325 } 6326 6327 } 6328 6329 public static Cosh Cosh(TypeElement resultType, Value input) { 6330 return new Cosh(resultType, input); 6331 } 6332 6333 @OpFactory.OpDeclaration(CumSum.NAME) 6334 public static final class CumSum extends OnnxOp { 6335 public static final String NAME = "CumSum"; 6336 6337 public enum Attribute implements OnnxAttribute { 6338 exclusive(Long.class, true, 0), 6339 reverse(Long.class, true, 0), 6340 ; 6341 6342 final Class<?> t; 6343 final boolean optional; 6344 final Object defaultValue; 6345 6346 Attribute(Class<?> type, boolean optional, Object defaultValue) { 6347 this.t = type; 6348 this.optional = optional; 6349 this.defaultValue = defaultValue; 6350 assert optional || defaultValue == null; 6351 } 6352 6353 public Class<?> type() { 6354 return t; 6355 } 6356 6357 public boolean isOptional() { 6358 return optional; 6359 } 6360 6361 public Object defaultValue() { 6362 return defaultValue; 6363 } 6364 } 6365 6366 public enum TypeConstraint implements OnnxTypeConstraint { 6367 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())))), 6368 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 6369 ; 6370 6371 final OnnxType.TypeVariable typeVariable; 6372 6373 TypeConstraint(OnnxType.TypeVariable typeVariable) { 6374 assert typeVariable.name().equals(name()); 6375 this.typeVariable = typeVariable; 6376 } 6377 6378 @Override 6379 public OnnxType.TypeVariable typeVariable() { 6380 return typeVariable; 6381 } 6382 } 6383 6384 public enum InputParameter implements OnnxParameter { 6385 x(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6386 axis(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 6387 ; 6388 6389 final OnnxType type; 6390 final Quantifier quantifier; 6391 6392 InputParameter(OnnxType type, Quantifier quantifier) { 6393 this.type = type; 6394 this.quantifier = quantifier; 6395 } 6396 6397 @Override 6398 public OnnxType type() { 6399 return type; 6400 } 6401 6402 @Override 6403 public Quantifier quantifier() { 6404 return quantifier; 6405 } 6406 } 6407 6408 public enum OutputParameter implements OnnxParameter { 6409 y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6410 ; 6411 6412 final OnnxType type; 6413 final Quantifier quantifier; 6414 6415 OutputParameter(OnnxType type, Quantifier quantifier) { 6416 this.type = type; 6417 this.quantifier = quantifier; 6418 } 6419 6420 @Override 6421 public OnnxType type() { 6422 return type; 6423 } 6424 6425 @Override 6426 public Quantifier quantifier() { 6427 return quantifier; 6428 } 6429 } 6430 6431 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 6432 NAME, 6433 List.of(Attribute.values()), 6434 List.of(TypeConstraint.values()), 6435 List.of(InputParameter.values()), 6436 List.of(OutputParameter.values()) 6437 ); 6438 6439 public CumSum(ExternalizedOp def) { 6440 super(SCHEMA, def); 6441 } 6442 6443 CumSum(CumSum that, CopyContext cc) { 6444 super(that, cc); 6445 } 6446 6447 @Override 6448 public CumSum transform(CopyContext cc, OpTransformer ot) { 6449 return new CumSum(this, cc); 6450 } 6451 6452 CumSum(TypeElement resultType, Value x, Value axis, java.util.Optional<Long> exclusive, java.util.Optional<Long> reverse) { 6453 super(SCHEMA, resultType, Set.of(), List.of(x, axis), List.of(exclusive, reverse)); 6454 } 6455 6456 @Override 6457 public SequencedSet<OnnxParameter> onnxOutputs() { 6458 return onnxOutputs(SCHEMA); 6459 } 6460 6461 @Override 6462 public SequencedMap<OnnxParameter, Object> onnxInputs() { 6463 return onnxInputs(SCHEMA, List.of(x(), axis())); 6464 } 6465 6466 public Value x() { 6467 return operands().get(0); 6468 } 6469 6470 public Value axis() { 6471 return operands().get(1); 6472 } 6473 6474 public java.util.Optional<Long> exclusive() { 6475 Long exclusive = Attribute.exclusive.access(Long.class, onnxAttributes); 6476 return java.util.Optional.ofNullable(exclusive); 6477 } 6478 6479 public java.util.Optional<Long> reverse() { 6480 Long reverse = Attribute.reverse.access(Long.class, onnxAttributes); 6481 return java.util.Optional.ofNullable(reverse); 6482 } 6483 6484 } 6485 6486 public static CumSum CumSum(TypeElement resultType, Value x, Value axis, java.util.Optional<Long> exclusive, java.util.Optional<Long> reverse) { 6487 return new CumSum(resultType, x, axis, exclusive, reverse); 6488 } 6489 6490 @OpFactory.OpDeclaration(DFT.NAME) 6491 public static final class DFT extends OnnxOp { 6492 public static final String NAME = "DFT"; 6493 6494 public enum Attribute implements OnnxAttribute { 6495 inverse(Long.class, true, 0), 6496 onesided(Long.class, true, 0), 6497 ; 6498 6499 final Class<?> t; 6500 final boolean optional; 6501 final Object defaultValue; 6502 6503 Attribute(Class<?> type, boolean optional, Object defaultValue) { 6504 this.t = type; 6505 this.optional = optional; 6506 this.defaultValue = defaultValue; 6507 assert optional || defaultValue == null; 6508 } 6509 6510 public Class<?> type() { 6511 return t; 6512 } 6513 6514 public boolean isOptional() { 6515 return optional; 6516 } 6517 6518 public Object defaultValue() { 6519 return defaultValue; 6520 } 6521 } 6522 6523 public enum TypeConstraint implements OnnxTypeConstraint { 6524 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 6525 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 6526 ; 6527 6528 final OnnxType.TypeVariable typeVariable; 6529 6530 TypeConstraint(OnnxType.TypeVariable typeVariable) { 6531 assert typeVariable.name().equals(name()); 6532 this.typeVariable = typeVariable; 6533 } 6534 6535 @Override 6536 public OnnxType.TypeVariable typeVariable() { 6537 return typeVariable; 6538 } 6539 } 6540 6541 public enum InputParameter implements OnnxParameter { 6542 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 6543 dft_length(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 6544 axis(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 6545 ; 6546 6547 final OnnxType type; 6548 final Quantifier quantifier; 6549 6550 InputParameter(OnnxType type, Quantifier quantifier) { 6551 this.type = type; 6552 this.quantifier = quantifier; 6553 } 6554 6555 @Override 6556 public OnnxType type() { 6557 return type; 6558 } 6559 6560 @Override 6561 public Quantifier quantifier() { 6562 return quantifier; 6563 } 6564 } 6565 6566 public enum OutputParameter implements OnnxParameter { 6567 output(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 6568 ; 6569 6570 final OnnxType type; 6571 final Quantifier quantifier; 6572 6573 OutputParameter(OnnxType type, Quantifier quantifier) { 6574 this.type = type; 6575 this.quantifier = quantifier; 6576 } 6577 6578 @Override 6579 public OnnxType type() { 6580 return type; 6581 } 6582 6583 @Override 6584 public Quantifier quantifier() { 6585 return quantifier; 6586 } 6587 } 6588 6589 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 6590 NAME, 6591 List.of(Attribute.values()), 6592 List.of(TypeConstraint.values()), 6593 List.of(InputParameter.values()), 6594 List.of(OutputParameter.values()) 6595 ); 6596 6597 public DFT(ExternalizedOp def) { 6598 super(SCHEMA, def); 6599 } 6600 6601 DFT(DFT that, CopyContext cc) { 6602 super(that, cc); 6603 } 6604 6605 @Override 6606 public DFT transform(CopyContext cc, OpTransformer ot) { 6607 return new DFT(this, cc); 6608 } 6609 6610 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) { 6611 super(SCHEMA, resultType, Set.of(), List.of(input, dft_length, axis), List.of(inverse, onesided)); 6612 } 6613 6614 @Override 6615 public SequencedSet<OnnxParameter> onnxOutputs() { 6616 return onnxOutputs(SCHEMA); 6617 } 6618 6619 @Override 6620 public SequencedMap<OnnxParameter, Object> onnxInputs() { 6621 return onnxInputs(SCHEMA, List.of(input(), dft_length(), axis())); 6622 } 6623 6624 public Value input() { 6625 return operands().get(0); 6626 } 6627 6628 public java.util.Optional<Value> dft_length() { 6629 int i = optionalInputArguments.indexOf(InputParameter.dft_length); 6630 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 6631 } 6632 6633 public java.util.Optional<Value> axis() { 6634 int i = optionalInputArguments.indexOf(InputParameter.axis); 6635 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 6636 } 6637 6638 public java.util.Optional<Long> inverse() { 6639 Long inverse = Attribute.inverse.access(Long.class, onnxAttributes); 6640 return java.util.Optional.ofNullable(inverse); 6641 } 6642 6643 public java.util.Optional<Long> onesided() { 6644 Long onesided = Attribute.onesided.access(Long.class, onnxAttributes); 6645 return java.util.Optional.ofNullable(onesided); 6646 } 6647 6648 } 6649 6650 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) { 6651 return new DFT(resultType, input, dft_length, axis, inverse, onesided); 6652 } 6653 6654 @OpFactory.OpDeclaration(DeformConv.NAME) 6655 public static final class DeformConv extends OnnxOp { 6656 public static final String NAME = "DeformConv"; 6657 6658 public enum Attribute implements OnnxAttribute { 6659 pads(long[].class, true, null), 6660 dilations(long[].class, true, null), 6661 strides(long[].class, true, null), 6662 offset_group(Long.class, true, 1), 6663 group(Long.class, true, 1), 6664 kernel_shape(long[].class, true, null), 6665 ; 6666 6667 final Class<?> t; 6668 final boolean optional; 6669 final Object defaultValue; 6670 6671 Attribute(Class<?> type, boolean optional, Object defaultValue) { 6672 this.t = type; 6673 this.optional = optional; 6674 this.defaultValue = defaultValue; 6675 assert optional || defaultValue == null; 6676 } 6677 6678 public Class<?> type() { 6679 return t; 6680 } 6681 6682 public boolean isOptional() { 6683 return optional; 6684 } 6685 6686 public Object defaultValue() { 6687 return defaultValue; 6688 } 6689 } 6690 6691 public enum TypeConstraint implements OnnxTypeConstraint { 6692 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 6693 ; 6694 6695 final OnnxType.TypeVariable typeVariable; 6696 6697 TypeConstraint(OnnxType.TypeVariable typeVariable) { 6698 assert typeVariable.name().equals(name()); 6699 this.typeVariable = typeVariable; 6700 } 6701 6702 @Override 6703 public OnnxType.TypeVariable typeVariable() { 6704 return typeVariable; 6705 } 6706 } 6707 6708 public enum InputParameter implements OnnxParameter { 6709 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6710 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6711 offset(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6712 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 6713 mask(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 6714 ; 6715 6716 final OnnxType type; 6717 final Quantifier quantifier; 6718 6719 InputParameter(OnnxType type, Quantifier quantifier) { 6720 this.type = type; 6721 this.quantifier = quantifier; 6722 } 6723 6724 @Override 6725 public OnnxType type() { 6726 return type; 6727 } 6728 6729 @Override 6730 public Quantifier quantifier() { 6731 return quantifier; 6732 } 6733 } 6734 6735 public enum OutputParameter implements OnnxParameter { 6736 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6737 ; 6738 6739 final OnnxType type; 6740 final Quantifier quantifier; 6741 6742 OutputParameter(OnnxType type, Quantifier quantifier) { 6743 this.type = type; 6744 this.quantifier = quantifier; 6745 } 6746 6747 @Override 6748 public OnnxType type() { 6749 return type; 6750 } 6751 6752 @Override 6753 public Quantifier quantifier() { 6754 return quantifier; 6755 } 6756 } 6757 6758 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 6759 NAME, 6760 List.of(Attribute.values()), 6761 List.of(TypeConstraint.values()), 6762 List.of(InputParameter.values()), 6763 List.of(OutputParameter.values()) 6764 ); 6765 6766 public DeformConv(ExternalizedOp def) { 6767 super(SCHEMA, def); 6768 } 6769 6770 DeformConv(DeformConv that, CopyContext cc) { 6771 super(that, cc); 6772 } 6773 6774 @Override 6775 public DeformConv transform(CopyContext cc, OpTransformer ot) { 6776 return new DeformConv(this, cc); 6777 } 6778 6779 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) { 6780 super(SCHEMA, resultType, Set.of(), List.of(X, W, offset, B, mask), List.of(pads, dilations, strides, offset_group, group, kernel_shape)); 6781 } 6782 6783 @Override 6784 public SequencedSet<OnnxParameter> onnxOutputs() { 6785 return onnxOutputs(SCHEMA); 6786 } 6787 6788 @Override 6789 public SequencedMap<OnnxParameter, Object> onnxInputs() { 6790 return onnxInputs(SCHEMA, List.of(X(), W(), offset(), B(), mask())); 6791 } 6792 6793 public Value X() { 6794 return operands().get(0); 6795 } 6796 6797 public Value W() { 6798 return operands().get(1); 6799 } 6800 6801 public Value offset() { 6802 return operands().get(2); 6803 } 6804 6805 public java.util.Optional<Value> B() { 6806 int i = optionalInputArguments.indexOf(InputParameter.B); 6807 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 6808 } 6809 6810 public java.util.Optional<Value> mask() { 6811 int i = optionalInputArguments.indexOf(InputParameter.mask); 6812 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 6813 } 6814 6815 public java.util.Optional<long[]> pads() { 6816 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 6817 return java.util.Optional.ofNullable(pads).map(long[]::clone); 6818 } 6819 6820 public java.util.Optional<long[]> dilations() { 6821 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 6822 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 6823 } 6824 6825 public java.util.Optional<long[]> strides() { 6826 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 6827 return java.util.Optional.ofNullable(strides).map(long[]::clone); 6828 } 6829 6830 public java.util.Optional<Long> offset_group() { 6831 Long offset_group = Attribute.offset_group.access(Long.class, onnxAttributes); 6832 return java.util.Optional.ofNullable(offset_group); 6833 } 6834 6835 public java.util.Optional<Long> group() { 6836 Long group = Attribute.group.access(Long.class, onnxAttributes); 6837 return java.util.Optional.ofNullable(group); 6838 } 6839 6840 public java.util.Optional<long[]> kernel_shape() { 6841 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 6842 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone); 6843 } 6844 6845 } 6846 6847 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) { 6848 return new DeformConv(resultType, X, W, offset, B, mask, pads, dilations, strides, offset_group, group, kernel_shape); 6849 } 6850 6851 @OpFactory.OpDeclaration(DepthToSpace.NAME) 6852 public static final class DepthToSpace extends OnnxOp { 6853 public static final String NAME = "DepthToSpace"; 6854 6855 public enum Attribute implements OnnxAttribute { 6856 mode(String.class, true, "DCR"), 6857 blocksize(Long.class, false, null), 6858 ; 6859 6860 final Class<?> t; 6861 final boolean optional; 6862 final Object defaultValue; 6863 6864 Attribute(Class<?> type, boolean optional, Object defaultValue) { 6865 this.t = type; 6866 this.optional = optional; 6867 this.defaultValue = defaultValue; 6868 assert optional || defaultValue == null; 6869 } 6870 6871 public Class<?> type() { 6872 return t; 6873 } 6874 6875 public boolean isOptional() { 6876 return optional; 6877 } 6878 6879 public Object defaultValue() { 6880 return defaultValue; 6881 } 6882 } 6883 6884 public enum TypeConstraint implements OnnxTypeConstraint { 6885 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())))), 6886 ; 6887 6888 final OnnxType.TypeVariable typeVariable; 6889 6890 TypeConstraint(OnnxType.TypeVariable typeVariable) { 6891 assert typeVariable.name().equals(name()); 6892 this.typeVariable = typeVariable; 6893 } 6894 6895 @Override 6896 public OnnxType.TypeVariable typeVariable() { 6897 return typeVariable; 6898 } 6899 } 6900 6901 public enum InputParameter implements OnnxParameter { 6902 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6903 ; 6904 6905 final OnnxType type; 6906 final Quantifier quantifier; 6907 6908 InputParameter(OnnxType type, Quantifier quantifier) { 6909 this.type = type; 6910 this.quantifier = quantifier; 6911 } 6912 6913 @Override 6914 public OnnxType type() { 6915 return type; 6916 } 6917 6918 @Override 6919 public Quantifier quantifier() { 6920 return quantifier; 6921 } 6922 } 6923 6924 public enum OutputParameter implements OnnxParameter { 6925 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 6926 ; 6927 6928 final OnnxType type; 6929 final Quantifier quantifier; 6930 6931 OutputParameter(OnnxType type, Quantifier quantifier) { 6932 this.type = type; 6933 this.quantifier = quantifier; 6934 } 6935 6936 @Override 6937 public OnnxType type() { 6938 return type; 6939 } 6940 6941 @Override 6942 public Quantifier quantifier() { 6943 return quantifier; 6944 } 6945 } 6946 6947 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 6948 NAME, 6949 List.of(Attribute.values()), 6950 List.of(TypeConstraint.values()), 6951 List.of(InputParameter.values()), 6952 List.of(OutputParameter.values()) 6953 ); 6954 6955 public DepthToSpace(ExternalizedOp def) { 6956 super(SCHEMA, def); 6957 } 6958 6959 DepthToSpace(DepthToSpace that, CopyContext cc) { 6960 super(that, cc); 6961 } 6962 6963 @Override 6964 public DepthToSpace transform(CopyContext cc, OpTransformer ot) { 6965 return new DepthToSpace(this, cc); 6966 } 6967 6968 DepthToSpace(TypeElement resultType, Value input, java.util.Optional<String> mode, long blocksize) { 6969 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(mode, blocksize)); 6970 } 6971 6972 @Override 6973 public SequencedSet<OnnxParameter> onnxOutputs() { 6974 return onnxOutputs(SCHEMA); 6975 } 6976 6977 @Override 6978 public SequencedMap<OnnxParameter, Object> onnxInputs() { 6979 return onnxInputs(SCHEMA, List.of(input())); 6980 } 6981 6982 public Value input() { 6983 return operands().get(0); 6984 } 6985 6986 public java.util.Optional<String> mode() { 6987 String mode = Attribute.mode.access(String.class, onnxAttributes); 6988 return java.util.Optional.ofNullable(mode); 6989 } 6990 6991 public long blocksize() { 6992 long blocksize = Attribute.blocksize.access(Long.class, onnxAttributes); 6993 return blocksize; 6994 } 6995 6996 } 6997 6998 public static DepthToSpace DepthToSpace(TypeElement resultType, Value input, java.util.Optional<String> mode, long blocksize) { 6999 return new DepthToSpace(resultType, input, mode, blocksize); 7000 } 7001 7002 @OpFactory.OpDeclaration(DequantizeLinear.NAME) 7003 public static final class DequantizeLinear extends OnnxOp { 7004 public static final String NAME = "DequantizeLinear"; 7005 7006 public enum Attribute implements OnnxAttribute { 7007 axis(Long.class, true, 1), 7008 block_size(Long.class, true, 0), 7009 ; 7010 7011 final Class<?> t; 7012 final boolean optional; 7013 final Object defaultValue; 7014 7015 Attribute(Class<?> type, boolean optional, Object defaultValue) { 7016 this.t = type; 7017 this.optional = optional; 7018 this.defaultValue = defaultValue; 7019 assert optional || defaultValue == null; 7020 } 7021 7022 public Class<?> type() { 7023 return t; 7024 } 7025 7026 public boolean isOptional() { 7027 return optional; 7028 } 7029 7030 public Object defaultValue() { 7031 return defaultValue; 7032 } 7033 } 7034 7035 public enum TypeConstraint implements OnnxTypeConstraint { 7036 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())))), 7037 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16())))), 7038 ; 7039 7040 final OnnxType.TypeVariable typeVariable; 7041 7042 TypeConstraint(OnnxType.TypeVariable typeVariable) { 7043 assert typeVariable.name().equals(name()); 7044 this.typeVariable = typeVariable; 7045 } 7046 7047 @Override 7048 public OnnxType.TypeVariable typeVariable() { 7049 return typeVariable; 7050 } 7051 } 7052 7053 public enum InputParameter implements OnnxParameter { 7054 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 7055 x_scale(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 7056 x_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL), 7057 ; 7058 7059 final OnnxType type; 7060 final Quantifier quantifier; 7061 7062 InputParameter(OnnxType type, Quantifier quantifier) { 7063 this.type = type; 7064 this.quantifier = quantifier; 7065 } 7066 7067 @Override 7068 public OnnxType type() { 7069 return type; 7070 } 7071 7072 @Override 7073 public Quantifier quantifier() { 7074 return quantifier; 7075 } 7076 } 7077 7078 public enum OutputParameter implements OnnxParameter { 7079 y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 7080 ; 7081 7082 final OnnxType type; 7083 final Quantifier quantifier; 7084 7085 OutputParameter(OnnxType type, Quantifier quantifier) { 7086 this.type = type; 7087 this.quantifier = quantifier; 7088 } 7089 7090 @Override 7091 public OnnxType type() { 7092 return type; 7093 } 7094 7095 @Override 7096 public Quantifier quantifier() { 7097 return quantifier; 7098 } 7099 } 7100 7101 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 7102 NAME, 7103 List.of(Attribute.values()), 7104 List.of(TypeConstraint.values()), 7105 List.of(InputParameter.values()), 7106 List.of(OutputParameter.values()) 7107 ); 7108 7109 public DequantizeLinear(ExternalizedOp def) { 7110 super(SCHEMA, def); 7111 } 7112 7113 DequantizeLinear(DequantizeLinear that, CopyContext cc) { 7114 super(that, cc); 7115 } 7116 7117 @Override 7118 public DequantizeLinear transform(CopyContext cc, OpTransformer ot) { 7119 return new DequantizeLinear(this, cc); 7120 } 7121 7122 DequantizeLinear(TypeElement resultType, Value x, Value x_scale, java.util.Optional<Value> x_zero_point, java.util.Optional<Long> axis, java.util.Optional<Long> block_size) { 7123 super(SCHEMA, resultType, Set.of(), List.of(x, x_scale, x_zero_point), List.of(axis, block_size)); 7124 } 7125 7126 @Override 7127 public SequencedSet<OnnxParameter> onnxOutputs() { 7128 return onnxOutputs(SCHEMA); 7129 } 7130 7131 @Override 7132 public SequencedMap<OnnxParameter, Object> onnxInputs() { 7133 return onnxInputs(SCHEMA, List.of(x(), x_scale(), x_zero_point())); 7134 } 7135 7136 public Value x() { 7137 return operands().get(0); 7138 } 7139 7140 public Value x_scale() { 7141 return operands().get(1); 7142 } 7143 7144 public java.util.Optional<Value> x_zero_point() { 7145 int i = optionalInputArguments.indexOf(InputParameter.x_zero_point); 7146 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 7147 } 7148 7149 public java.util.Optional<Long> axis() { 7150 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 7151 return java.util.Optional.ofNullable(axis); 7152 } 7153 7154 public java.util.Optional<Long> block_size() { 7155 Long block_size = Attribute.block_size.access(Long.class, onnxAttributes); 7156 return java.util.Optional.ofNullable(block_size); 7157 } 7158 7159 } 7160 7161 public static DequantizeLinear DequantizeLinear(TypeElement resultType, Value x, Value x_scale, java.util.Optional<Value> x_zero_point, java.util.Optional<Long> axis, java.util.Optional<Long> block_size) { 7162 return new DequantizeLinear(resultType, x, x_scale, x_zero_point, axis, block_size); 7163 } 7164 7165 @OpFactory.OpDeclaration(Det.NAME) 7166 public static final class Det extends OnnxOp { 7167 public static final String NAME = "Det"; 7168 7169 public enum Attribute implements OnnxAttribute.None { } 7170 7171 public enum TypeConstraint implements OnnxTypeConstraint { 7172 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 7173 ; 7174 7175 final OnnxType.TypeVariable typeVariable; 7176 7177 TypeConstraint(OnnxType.TypeVariable typeVariable) { 7178 assert typeVariable.name().equals(name()); 7179 this.typeVariable = typeVariable; 7180 } 7181 7182 @Override 7183 public OnnxType.TypeVariable typeVariable() { 7184 return typeVariable; 7185 } 7186 } 7187 7188 public enum InputParameter implements OnnxParameter { 7189 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 7190 ; 7191 7192 final OnnxType type; 7193 final Quantifier quantifier; 7194 7195 InputParameter(OnnxType type, Quantifier quantifier) { 7196 this.type = type; 7197 this.quantifier = quantifier; 7198 } 7199 7200 @Override 7201 public OnnxType type() { 7202 return type; 7203 } 7204 7205 @Override 7206 public Quantifier quantifier() { 7207 return quantifier; 7208 } 7209 } 7210 7211 public enum OutputParameter implements OnnxParameter { 7212 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 7213 ; 7214 7215 final OnnxType type; 7216 final Quantifier quantifier; 7217 7218 OutputParameter(OnnxType type, Quantifier quantifier) { 7219 this.type = type; 7220 this.quantifier = quantifier; 7221 } 7222 7223 @Override 7224 public OnnxType type() { 7225 return type; 7226 } 7227 7228 @Override 7229 public Quantifier quantifier() { 7230 return quantifier; 7231 } 7232 } 7233 7234 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 7235 NAME, 7236 List.of(Attribute.values()), 7237 List.of(TypeConstraint.values()), 7238 List.of(InputParameter.values()), 7239 List.of(OutputParameter.values()) 7240 ); 7241 7242 public Det(ExternalizedOp def) { 7243 super(SCHEMA, def); 7244 } 7245 7246 Det(Det that, CopyContext cc) { 7247 super(that, cc); 7248 } 7249 7250 @Override 7251 public Det transform(CopyContext cc, OpTransformer ot) { 7252 return new Det(this, cc); 7253 } 7254 7255 Det(TypeElement resultType, Value X) { 7256 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 7257 } 7258 7259 @Override 7260 public SequencedSet<OnnxParameter> onnxOutputs() { 7261 return onnxOutputs(SCHEMA); 7262 } 7263 7264 @Override 7265 public SequencedMap<OnnxParameter, Object> onnxInputs() { 7266 return onnxInputs(SCHEMA, List.of(X())); 7267 } 7268 7269 public Value X() { 7270 return operands().get(0); 7271 } 7272 7273 } 7274 7275 public static Det Det(TypeElement resultType, Value X) { 7276 return new Det(resultType, X); 7277 } 7278 7279 @OpFactory.OpDeclaration(DictVectorizer.NAME) 7280 public static final class DictVectorizer extends OnnxOp { 7281 public static final String NAME = "DictVectorizer"; 7282 7283 public enum Attribute implements OnnxAttribute { 7284 string_vocabulary(String[].class, true, null), 7285 int64_vocabulary(long[].class, true, null), 7286 ; 7287 7288 final Class<?> t; 7289 final boolean optional; 7290 final Object defaultValue; 7291 7292 Attribute(Class<?> type, boolean optional, Object defaultValue) { 7293 this.t = type; 7294 this.optional = optional; 7295 this.defaultValue = defaultValue; 7296 assert optional || defaultValue == null; 7297 } 7298 7299 public Class<?> type() { 7300 return t; 7301 } 7302 7303 public boolean isOptional() { 7304 return optional; 7305 } 7306 7307 public Object defaultValue() { 7308 return defaultValue; 7309 } 7310 } 7311 7312 public enum TypeConstraint implements OnnxTypeConstraint { 7313 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())))), 7314 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.string())))), 7315 ; 7316 7317 final OnnxType.TypeVariable typeVariable; 7318 7319 TypeConstraint(OnnxType.TypeVariable typeVariable) { 7320 assert typeVariable.name().equals(name()); 7321 this.typeVariable = typeVariable; 7322 } 7323 7324 @Override 7325 public OnnxType.TypeVariable typeVariable() { 7326 return typeVariable; 7327 } 7328 } 7329 7330 public enum InputParameter implements OnnxParameter { 7331 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 7332 ; 7333 7334 final OnnxType type; 7335 final Quantifier quantifier; 7336 7337 InputParameter(OnnxType type, Quantifier quantifier) { 7338 this.type = type; 7339 this.quantifier = quantifier; 7340 } 7341 7342 @Override 7343 public OnnxType type() { 7344 return type; 7345 } 7346 7347 @Override 7348 public Quantifier quantifier() { 7349 return quantifier; 7350 } 7351 } 7352 7353 public enum OutputParameter implements OnnxParameter { 7354 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 7355 ; 7356 7357 final OnnxType type; 7358 final Quantifier quantifier; 7359 7360 OutputParameter(OnnxType type, Quantifier quantifier) { 7361 this.type = type; 7362 this.quantifier = quantifier; 7363 } 7364 7365 @Override 7366 public OnnxType type() { 7367 return type; 7368 } 7369 7370 @Override 7371 public Quantifier quantifier() { 7372 return quantifier; 7373 } 7374 } 7375 7376 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 7377 NAME, 7378 List.of(Attribute.values()), 7379 List.of(TypeConstraint.values()), 7380 List.of(InputParameter.values()), 7381 List.of(OutputParameter.values()) 7382 ); 7383 7384 public DictVectorizer(ExternalizedOp def) { 7385 super(SCHEMA, def); 7386 } 7387 7388 DictVectorizer(DictVectorizer that, CopyContext cc) { 7389 super(that, cc); 7390 } 7391 7392 @Override 7393 public DictVectorizer transform(CopyContext cc, OpTransformer ot) { 7394 return new DictVectorizer(this, cc); 7395 } 7396 7397 DictVectorizer(TypeElement resultType, Value X, java.util.Optional<String[]> string_vocabulary, java.util.Optional<long[]> int64_vocabulary) { 7398 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(string_vocabulary, int64_vocabulary)); 7399 } 7400 7401 @Override 7402 public SequencedSet<OnnxParameter> onnxOutputs() { 7403 return onnxOutputs(SCHEMA); 7404 } 7405 7406 @Override 7407 public SequencedMap<OnnxParameter, Object> onnxInputs() { 7408 return onnxInputs(SCHEMA, List.of(X())); 7409 } 7410 7411 public Value X() { 7412 return operands().get(0); 7413 } 7414 7415 public java.util.Optional<String[]> string_vocabulary() { 7416 String[] string_vocabulary = Attribute.string_vocabulary.access(String[].class, onnxAttributes); 7417 return java.util.Optional.ofNullable(string_vocabulary).map(String[]::clone); 7418 } 7419 7420 public java.util.Optional<long[]> int64_vocabulary() { 7421 long[] int64_vocabulary = Attribute.int64_vocabulary.access(long[].class, onnxAttributes); 7422 return java.util.Optional.ofNullable(int64_vocabulary).map(long[]::clone); 7423 } 7424 7425 } 7426 7427 public static DictVectorizer DictVectorizer(TypeElement resultType, Value X, java.util.Optional<String[]> string_vocabulary, java.util.Optional<long[]> int64_vocabulary) { 7428 return new DictVectorizer(resultType, X, string_vocabulary, int64_vocabulary); 7429 } 7430 7431 @OpFactory.OpDeclaration(Div.NAME) 7432 public static final class Div extends OnnxOp { 7433 public static final String NAME = "Div"; 7434 7435 public enum Attribute implements OnnxAttribute.None { } 7436 7437 public enum TypeConstraint implements OnnxTypeConstraint { 7438 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())))), 7439 ; 7440 7441 final OnnxType.TypeVariable typeVariable; 7442 7443 TypeConstraint(OnnxType.TypeVariable typeVariable) { 7444 assert typeVariable.name().equals(name()); 7445 this.typeVariable = typeVariable; 7446 } 7447 7448 @Override 7449 public OnnxType.TypeVariable typeVariable() { 7450 return typeVariable; 7451 } 7452 } 7453 7454 public enum InputParameter implements OnnxParameter { 7455 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 7456 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 7457 ; 7458 7459 final OnnxType type; 7460 final Quantifier quantifier; 7461 7462 InputParameter(OnnxType type, Quantifier quantifier) { 7463 this.type = type; 7464 this.quantifier = quantifier; 7465 } 7466 7467 @Override 7468 public OnnxType type() { 7469 return type; 7470 } 7471 7472 @Override 7473 public Quantifier quantifier() { 7474 return quantifier; 7475 } 7476 } 7477 7478 public enum OutputParameter implements OnnxParameter { 7479 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 7480 ; 7481 7482 final OnnxType type; 7483 final Quantifier quantifier; 7484 7485 OutputParameter(OnnxType type, Quantifier quantifier) { 7486 this.type = type; 7487 this.quantifier = quantifier; 7488 } 7489 7490 @Override 7491 public OnnxType type() { 7492 return type; 7493 } 7494 7495 @Override 7496 public Quantifier quantifier() { 7497 return quantifier; 7498 } 7499 } 7500 7501 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 7502 NAME, 7503 List.of(Attribute.values()), 7504 List.of(TypeConstraint.values()), 7505 List.of(InputParameter.values()), 7506 List.of(OutputParameter.values()) 7507 ); 7508 7509 public Div(ExternalizedOp def) { 7510 super(SCHEMA, def); 7511 } 7512 7513 Div(Div that, CopyContext cc) { 7514 super(that, cc); 7515 } 7516 7517 @Override 7518 public Div transform(CopyContext cc, OpTransformer ot) { 7519 return new Div(this, cc); 7520 } 7521 7522 Div(TypeElement resultType, Value A, Value B) { 7523 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 7524 } 7525 7526 @Override 7527 public SequencedSet<OnnxParameter> onnxOutputs() { 7528 return onnxOutputs(SCHEMA); 7529 } 7530 7531 @Override 7532 public SequencedMap<OnnxParameter, Object> onnxInputs() { 7533 return onnxInputs(SCHEMA, List.of(A(), B())); 7534 } 7535 7536 public Value A() { 7537 return operands().get(0); 7538 } 7539 7540 public Value B() { 7541 return operands().get(1); 7542 } 7543 7544 } 7545 7546 public static Div Div(TypeElement resultType, Value A, Value B) { 7547 return new Div(resultType, A, B); 7548 } 7549 7550 @OpFactory.OpDeclaration(Dropout.NAME) 7551 public static final class Dropout extends OnnxOp { 7552 public static final String NAME = "Dropout"; 7553 7554 public enum Attribute implements OnnxAttribute { 7555 seed(Long.class, true, null), 7556 ; 7557 7558 final Class<?> t; 7559 final boolean optional; 7560 final Object defaultValue; 7561 7562 Attribute(Class<?> type, boolean optional, Object defaultValue) { 7563 this.t = type; 7564 this.optional = optional; 7565 this.defaultValue = defaultValue; 7566 assert optional || defaultValue == null; 7567 } 7568 7569 public Class<?> type() { 7570 return t; 7571 } 7572 7573 public boolean isOptional() { 7574 return optional; 7575 } 7576 7577 public Object defaultValue() { 7578 return defaultValue; 7579 } 7580 } 7581 7582 public enum TypeConstraint implements OnnxTypeConstraint { 7583 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())))), 7584 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())))), 7585 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bool())))), 7586 ; 7587 7588 final OnnxType.TypeVariable typeVariable; 7589 7590 TypeConstraint(OnnxType.TypeVariable typeVariable) { 7591 assert typeVariable.name().equals(name()); 7592 this.typeVariable = typeVariable; 7593 } 7594 7595 @Override 7596 public OnnxType.TypeVariable typeVariable() { 7597 return typeVariable; 7598 } 7599 } 7600 7601 public enum InputParameter implements OnnxParameter { 7602 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 7603 ratio(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL), 7604 training_mode(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 7605 ; 7606 7607 final OnnxType type; 7608 final Quantifier quantifier; 7609 7610 InputParameter(OnnxType type, Quantifier quantifier) { 7611 this.type = type; 7612 this.quantifier = quantifier; 7613 } 7614 7615 @Override 7616 public OnnxType type() { 7617 return type; 7618 } 7619 7620 @Override 7621 public Quantifier quantifier() { 7622 return quantifier; 7623 } 7624 } 7625 7626 public enum OutputParameter implements OnnxParameter { 7627 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 7628 mask(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 7629 ; 7630 7631 final OnnxType type; 7632 final Quantifier quantifier; 7633 7634 OutputParameter(OnnxType type, Quantifier quantifier) { 7635 this.type = type; 7636 this.quantifier = quantifier; 7637 } 7638 7639 @Override 7640 public OnnxType type() { 7641 return type; 7642 } 7643 7644 @Override 7645 public Quantifier quantifier() { 7646 return quantifier; 7647 } 7648 } 7649 7650 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 7651 NAME, 7652 List.of(Attribute.values()), 7653 List.of(TypeConstraint.values()), 7654 List.of(InputParameter.values()), 7655 List.of(OutputParameter.values()) 7656 ); 7657 7658 public Dropout(ExternalizedOp def) { 7659 super(SCHEMA, def); 7660 } 7661 7662 Dropout(Dropout that, CopyContext cc) { 7663 super(that, cc); 7664 } 7665 7666 @Override 7667 public Dropout transform(CopyContext cc, OpTransformer ot) { 7668 return new Dropout(this, cc); 7669 } 7670 7671 Dropout(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value data, java.util.Optional<Value> ratio, java.util.Optional<Value> training_mode, java.util.Optional<Long> seed) { 7672 super(SCHEMA, resultType, optionalOutputs, List.of(data, ratio, training_mode), List.of(seed)); 7673 } 7674 7675 @Override 7676 public SequencedSet<OnnxParameter> onnxOutputs() { 7677 return onnxOutputs(SCHEMA); 7678 } 7679 7680 @Override 7681 public SequencedMap<OnnxParameter, Object> onnxInputs() { 7682 return onnxInputs(SCHEMA, List.of(data(), ratio(), training_mode())); 7683 } 7684 7685 public Value data() { 7686 return operands().get(0); 7687 } 7688 7689 public java.util.Optional<Value> ratio() { 7690 int i = optionalInputArguments.indexOf(InputParameter.ratio); 7691 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 7692 } 7693 7694 public java.util.Optional<Value> training_mode() { 7695 int i = optionalInputArguments.indexOf(InputParameter.training_mode); 7696 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 7697 } 7698 7699 public java.util.Optional<Long> seed() { 7700 Long seed = Attribute.seed.access(Long.class, onnxAttributes); 7701 return java.util.Optional.ofNullable(seed); 7702 } 7703 7704 } 7705 7706 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) { 7707 return new Dropout(resultType, optionalOutputs, data, ratio, training_mode, seed); 7708 } 7709 7710 @OpFactory.OpDeclaration(DynamicQuantizeLinear.NAME) 7711 public static final class DynamicQuantizeLinear extends OnnxOp { 7712 public static final String NAME = "DynamicQuantizeLinear"; 7713 7714 public enum Attribute implements OnnxAttribute.None { } 7715 7716 public enum TypeConstraint implements OnnxTypeConstraint { 7717 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32())))), 7718 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8())))), 7719 ; 7720 7721 final OnnxType.TypeVariable typeVariable; 7722 7723 TypeConstraint(OnnxType.TypeVariable typeVariable) { 7724 assert typeVariable.name().equals(name()); 7725 this.typeVariable = typeVariable; 7726 } 7727 7728 @Override 7729 public OnnxType.TypeVariable typeVariable() { 7730 return typeVariable; 7731 } 7732 } 7733 7734 public enum InputParameter implements OnnxParameter { 7735 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 7736 ; 7737 7738 final OnnxType type; 7739 final Quantifier quantifier; 7740 7741 InputParameter(OnnxType type, Quantifier quantifier) { 7742 this.type = type; 7743 this.quantifier = quantifier; 7744 } 7745 7746 @Override 7747 public OnnxType type() { 7748 return type; 7749 } 7750 7751 @Override 7752 public Quantifier quantifier() { 7753 return quantifier; 7754 } 7755 } 7756 7757 public enum OutputParameter implements OnnxParameter { 7758 y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 7759 y_scale(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 7760 y_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 7761 ; 7762 7763 final OnnxType type; 7764 final Quantifier quantifier; 7765 7766 OutputParameter(OnnxType type, Quantifier quantifier) { 7767 this.type = type; 7768 this.quantifier = quantifier; 7769 } 7770 7771 @Override 7772 public OnnxType type() { 7773 return type; 7774 } 7775 7776 @Override 7777 public Quantifier quantifier() { 7778 return quantifier; 7779 } 7780 } 7781 7782 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 7783 NAME, 7784 List.of(Attribute.values()), 7785 List.of(TypeConstraint.values()), 7786 List.of(InputParameter.values()), 7787 List.of(OutputParameter.values()) 7788 ); 7789 7790 public DynamicQuantizeLinear(ExternalizedOp def) { 7791 super(SCHEMA, def); 7792 } 7793 7794 DynamicQuantizeLinear(DynamicQuantizeLinear that, CopyContext cc) { 7795 super(that, cc); 7796 } 7797 7798 @Override 7799 public DynamicQuantizeLinear transform(CopyContext cc, OpTransformer ot) { 7800 return new DynamicQuantizeLinear(this, cc); 7801 } 7802 7803 DynamicQuantizeLinear(TypeElement resultType, Value x) { 7804 super(SCHEMA, resultType, Set.of(), List.of(x), List.of()); 7805 } 7806 7807 @Override 7808 public SequencedSet<OnnxParameter> onnxOutputs() { 7809 return onnxOutputs(SCHEMA); 7810 } 7811 7812 @Override 7813 public SequencedMap<OnnxParameter, Object> onnxInputs() { 7814 return onnxInputs(SCHEMA, List.of(x())); 7815 } 7816 7817 public Value x() { 7818 return operands().get(0); 7819 } 7820 7821 } 7822 7823 public static DynamicQuantizeLinear DynamicQuantizeLinear(TypeElement resultType, Value x) { 7824 return new DynamicQuantizeLinear(resultType, x); 7825 } 7826 7827 @OpFactory.OpDeclaration(Einsum.NAME) 7828 public static final class Einsum extends OnnxOp { 7829 public static final String NAME = "Einsum"; 7830 7831 public enum Attribute implements OnnxAttribute { 7832 equation(String.class, false, null), 7833 ; 7834 7835 final Class<?> t; 7836 final boolean optional; 7837 final Object defaultValue; 7838 7839 Attribute(Class<?> type, boolean optional, Object defaultValue) { 7840 this.t = type; 7841 this.optional = optional; 7842 this.defaultValue = defaultValue; 7843 assert optional || defaultValue == null; 7844 } 7845 7846 public Class<?> type() { 7847 return t; 7848 } 7849 7850 public boolean isOptional() { 7851 return optional; 7852 } 7853 7854 public Object defaultValue() { 7855 return defaultValue; 7856 } 7857 } 7858 7859 public enum TypeConstraint implements OnnxTypeConstraint { 7860 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())))), 7861 ; 7862 7863 final OnnxType.TypeVariable typeVariable; 7864 7865 TypeConstraint(OnnxType.TypeVariable typeVariable) { 7866 assert typeVariable.name().equals(name()); 7867 this.typeVariable = typeVariable; 7868 } 7869 7870 @Override 7871 public OnnxType.TypeVariable typeVariable() { 7872 return typeVariable; 7873 } 7874 } 7875 7876 public enum InputParameter implements OnnxParameter { 7877 Inputs(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC), 7878 ; 7879 7880 final OnnxType type; 7881 final Quantifier quantifier; 7882 7883 InputParameter(OnnxType type, Quantifier quantifier) { 7884 this.type = type; 7885 this.quantifier = quantifier; 7886 } 7887 7888 @Override 7889 public OnnxType type() { 7890 return type; 7891 } 7892 7893 @Override 7894 public Quantifier quantifier() { 7895 return quantifier; 7896 } 7897 } 7898 7899 public enum OutputParameter implements OnnxParameter { 7900 Output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 7901 ; 7902 7903 final OnnxType type; 7904 final Quantifier quantifier; 7905 7906 OutputParameter(OnnxType type, Quantifier quantifier) { 7907 this.type = type; 7908 this.quantifier = quantifier; 7909 } 7910 7911 @Override 7912 public OnnxType type() { 7913 return type; 7914 } 7915 7916 @Override 7917 public Quantifier quantifier() { 7918 return quantifier; 7919 } 7920 } 7921 7922 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 7923 NAME, 7924 List.of(Attribute.values()), 7925 List.of(TypeConstraint.values()), 7926 List.of(InputParameter.values()), 7927 List.of(OutputParameter.values()) 7928 ); 7929 7930 public Einsum(ExternalizedOp def) { 7931 super(SCHEMA, def); 7932 } 7933 7934 Einsum(Einsum that, CopyContext cc) { 7935 super(that, cc); 7936 } 7937 7938 @Override 7939 public Einsum transform(CopyContext cc, OpTransformer ot) { 7940 return new Einsum(this, cc); 7941 } 7942 7943 Einsum(TypeElement resultType, List<Value> Inputs, String equation) { 7944 super(SCHEMA, resultType, Set.of(), List.of(Inputs), List.of(equation)); 7945 } 7946 7947 @Override 7948 public SequencedSet<OnnxParameter> onnxOutputs() { 7949 return onnxOutputs(SCHEMA); 7950 } 7951 7952 @Override 7953 public SequencedMap<OnnxParameter, Object> onnxInputs() { 7954 return onnxInputs(SCHEMA, List.of(Inputs())); 7955 } 7956 7957 public List<Value> Inputs() { 7958 return operands(); 7959 } 7960 7961 public String equation() { 7962 String equation = Attribute.equation.access(String.class, onnxAttributes); 7963 return equation; 7964 } 7965 7966 } 7967 7968 public static Einsum Einsum(TypeElement resultType, List<Value> Inputs, String equation) { 7969 return new Einsum(resultType, Inputs, equation); 7970 } 7971 7972 @OpFactory.OpDeclaration(Elu.NAME) 7973 public static final class Elu extends OnnxOp { 7974 public static final String NAME = "Elu"; 7975 7976 public enum Attribute implements OnnxAttribute { 7977 alpha(Float.class, true, 1.0f), 7978 ; 7979 7980 final Class<?> t; 7981 final boolean optional; 7982 final Object defaultValue; 7983 7984 Attribute(Class<?> type, boolean optional, Object defaultValue) { 7985 this.t = type; 7986 this.optional = optional; 7987 this.defaultValue = defaultValue; 7988 assert optional || defaultValue == null; 7989 } 7990 7991 public Class<?> type() { 7992 return t; 7993 } 7994 7995 public boolean isOptional() { 7996 return optional; 7997 } 7998 7999 public Object defaultValue() { 8000 return defaultValue; 8001 } 8002 } 8003 8004 public enum TypeConstraint implements OnnxTypeConstraint { 8005 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 8006 ; 8007 8008 final OnnxType.TypeVariable typeVariable; 8009 8010 TypeConstraint(OnnxType.TypeVariable typeVariable) { 8011 assert typeVariable.name().equals(name()); 8012 this.typeVariable = typeVariable; 8013 } 8014 8015 @Override 8016 public OnnxType.TypeVariable typeVariable() { 8017 return typeVariable; 8018 } 8019 } 8020 8021 public enum InputParameter implements OnnxParameter { 8022 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8023 ; 8024 8025 final OnnxType type; 8026 final Quantifier quantifier; 8027 8028 InputParameter(OnnxType type, Quantifier quantifier) { 8029 this.type = type; 8030 this.quantifier = quantifier; 8031 } 8032 8033 @Override 8034 public OnnxType type() { 8035 return type; 8036 } 8037 8038 @Override 8039 public Quantifier quantifier() { 8040 return quantifier; 8041 } 8042 } 8043 8044 public enum OutputParameter implements OnnxParameter { 8045 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8046 ; 8047 8048 final OnnxType type; 8049 final Quantifier quantifier; 8050 8051 OutputParameter(OnnxType type, Quantifier quantifier) { 8052 this.type = type; 8053 this.quantifier = quantifier; 8054 } 8055 8056 @Override 8057 public OnnxType type() { 8058 return type; 8059 } 8060 8061 @Override 8062 public Quantifier quantifier() { 8063 return quantifier; 8064 } 8065 } 8066 8067 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 8068 NAME, 8069 List.of(Attribute.values()), 8070 List.of(TypeConstraint.values()), 8071 List.of(InputParameter.values()), 8072 List.of(OutputParameter.values()) 8073 ); 8074 8075 public Elu(ExternalizedOp def) { 8076 super(SCHEMA, def); 8077 } 8078 8079 Elu(Elu that, CopyContext cc) { 8080 super(that, cc); 8081 } 8082 8083 @Override 8084 public Elu transform(CopyContext cc, OpTransformer ot) { 8085 return new Elu(this, cc); 8086 } 8087 8088 Elu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) { 8089 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha)); 8090 } 8091 8092 @Override 8093 public SequencedSet<OnnxParameter> onnxOutputs() { 8094 return onnxOutputs(SCHEMA); 8095 } 8096 8097 @Override 8098 public SequencedMap<OnnxParameter, Object> onnxInputs() { 8099 return onnxInputs(SCHEMA, List.of(X())); 8100 } 8101 8102 public Value X() { 8103 return operands().get(0); 8104 } 8105 8106 public java.util.Optional<Float> alpha() { 8107 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 8108 return java.util.Optional.ofNullable(alpha); 8109 } 8110 8111 } 8112 8113 public static Elu Elu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) { 8114 return new Elu(resultType, X, alpha); 8115 } 8116 8117 @OpFactory.OpDeclaration(Equal.NAME) 8118 public static final class Equal extends OnnxOp { 8119 public static final String NAME = "Equal"; 8120 8121 public enum Attribute implements OnnxAttribute.None { } 8122 8123 public enum TypeConstraint implements OnnxTypeConstraint { 8124 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())))), 8125 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))), 8126 ; 8127 8128 final OnnxType.TypeVariable typeVariable; 8129 8130 TypeConstraint(OnnxType.TypeVariable typeVariable) { 8131 assert typeVariable.name().equals(name()); 8132 this.typeVariable = typeVariable; 8133 } 8134 8135 @Override 8136 public OnnxType.TypeVariable typeVariable() { 8137 return typeVariable; 8138 } 8139 } 8140 8141 public enum InputParameter implements OnnxParameter { 8142 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8143 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8144 ; 8145 8146 final OnnxType type; 8147 final Quantifier quantifier; 8148 8149 InputParameter(OnnxType type, Quantifier quantifier) { 8150 this.type = type; 8151 this.quantifier = quantifier; 8152 } 8153 8154 @Override 8155 public OnnxType type() { 8156 return type; 8157 } 8158 8159 @Override 8160 public Quantifier quantifier() { 8161 return quantifier; 8162 } 8163 } 8164 8165 public enum OutputParameter implements OnnxParameter { 8166 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 8167 ; 8168 8169 final OnnxType type; 8170 final Quantifier quantifier; 8171 8172 OutputParameter(OnnxType type, Quantifier quantifier) { 8173 this.type = type; 8174 this.quantifier = quantifier; 8175 } 8176 8177 @Override 8178 public OnnxType type() { 8179 return type; 8180 } 8181 8182 @Override 8183 public Quantifier quantifier() { 8184 return quantifier; 8185 } 8186 } 8187 8188 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 8189 NAME, 8190 List.of(Attribute.values()), 8191 List.of(TypeConstraint.values()), 8192 List.of(InputParameter.values()), 8193 List.of(OutputParameter.values()) 8194 ); 8195 8196 public Equal(ExternalizedOp def) { 8197 super(SCHEMA, def); 8198 } 8199 8200 Equal(Equal that, CopyContext cc) { 8201 super(that, cc); 8202 } 8203 8204 @Override 8205 public Equal transform(CopyContext cc, OpTransformer ot) { 8206 return new Equal(this, cc); 8207 } 8208 8209 Equal(TypeElement resultType, Value A, Value B) { 8210 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 8211 } 8212 8213 @Override 8214 public SequencedSet<OnnxParameter> onnxOutputs() { 8215 return onnxOutputs(SCHEMA); 8216 } 8217 8218 @Override 8219 public SequencedMap<OnnxParameter, Object> onnxInputs() { 8220 return onnxInputs(SCHEMA, List.of(A(), B())); 8221 } 8222 8223 public Value A() { 8224 return operands().get(0); 8225 } 8226 8227 public Value B() { 8228 return operands().get(1); 8229 } 8230 8231 } 8232 8233 public static Equal Equal(TypeElement resultType, Value A, Value B) { 8234 return new Equal(resultType, A, B); 8235 } 8236 8237 @OpFactory.OpDeclaration(Erf.NAME) 8238 public static final class Erf extends OnnxOp { 8239 public static final String NAME = "Erf"; 8240 8241 public enum Attribute implements OnnxAttribute.None { } 8242 8243 public enum TypeConstraint implements OnnxTypeConstraint { 8244 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())))), 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 input(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 output(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 Erf(ExternalizedOp def) { 8315 super(SCHEMA, def); 8316 } 8317 8318 Erf(Erf that, CopyContext cc) { 8319 super(that, cc); 8320 } 8321 8322 @Override 8323 public Erf transform(CopyContext cc, OpTransformer ot) { 8324 return new Erf(this, cc); 8325 } 8326 8327 Erf(TypeElement resultType, Value input) { 8328 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 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(input())); 8339 } 8340 8341 public Value input() { 8342 return operands().get(0); 8343 } 8344 8345 } 8346 8347 public static Erf Erf(TypeElement resultType, Value input) { 8348 return new Erf(resultType, input); 8349 } 8350 8351 @OpFactory.OpDeclaration(Exp.NAME) 8352 public static final class Exp extends OnnxOp { 8353 public static final String NAME = "Exp"; 8354 8355 public enum Attribute implements OnnxAttribute.None { } 8356 8357 public enum TypeConstraint implements OnnxTypeConstraint { 8358 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 8359 ; 8360 8361 final OnnxType.TypeVariable typeVariable; 8362 8363 TypeConstraint(OnnxType.TypeVariable typeVariable) { 8364 assert typeVariable.name().equals(name()); 8365 this.typeVariable = typeVariable; 8366 } 8367 8368 @Override 8369 public OnnxType.TypeVariable typeVariable() { 8370 return typeVariable; 8371 } 8372 } 8373 8374 public enum InputParameter implements OnnxParameter { 8375 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8376 ; 8377 8378 final OnnxType type; 8379 final Quantifier quantifier; 8380 8381 InputParameter(OnnxType type, Quantifier quantifier) { 8382 this.type = type; 8383 this.quantifier = quantifier; 8384 } 8385 8386 @Override 8387 public OnnxType type() { 8388 return type; 8389 } 8390 8391 @Override 8392 public Quantifier quantifier() { 8393 return quantifier; 8394 } 8395 } 8396 8397 public enum OutputParameter implements OnnxParameter { 8398 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8399 ; 8400 8401 final OnnxType type; 8402 final Quantifier quantifier; 8403 8404 OutputParameter(OnnxType type, Quantifier quantifier) { 8405 this.type = type; 8406 this.quantifier = quantifier; 8407 } 8408 8409 @Override 8410 public OnnxType type() { 8411 return type; 8412 } 8413 8414 @Override 8415 public Quantifier quantifier() { 8416 return quantifier; 8417 } 8418 } 8419 8420 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 8421 NAME, 8422 List.of(Attribute.values()), 8423 List.of(TypeConstraint.values()), 8424 List.of(InputParameter.values()), 8425 List.of(OutputParameter.values()) 8426 ); 8427 8428 public Exp(ExternalizedOp def) { 8429 super(SCHEMA, def); 8430 } 8431 8432 Exp(Exp that, CopyContext cc) { 8433 super(that, cc); 8434 } 8435 8436 @Override 8437 public Exp transform(CopyContext cc, OpTransformer ot) { 8438 return new Exp(this, cc); 8439 } 8440 8441 Exp(TypeElement resultType, Value input) { 8442 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 8443 } 8444 8445 @Override 8446 public SequencedSet<OnnxParameter> onnxOutputs() { 8447 return onnxOutputs(SCHEMA); 8448 } 8449 8450 @Override 8451 public SequencedMap<OnnxParameter, Object> onnxInputs() { 8452 return onnxInputs(SCHEMA, List.of(input())); 8453 } 8454 8455 public Value input() { 8456 return operands().get(0); 8457 } 8458 8459 } 8460 8461 public static Exp Exp(TypeElement resultType, Value input) { 8462 return new Exp(resultType, input); 8463 } 8464 8465 @OpFactory.OpDeclaration(Expand.NAME) 8466 public static final class Expand extends OnnxOp { 8467 public static final String NAME = "Expand"; 8468 8469 public enum Attribute implements OnnxAttribute.None { } 8470 8471 public enum TypeConstraint implements OnnxTypeConstraint { 8472 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())))), 8473 ; 8474 8475 final OnnxType.TypeVariable typeVariable; 8476 8477 TypeConstraint(OnnxType.TypeVariable typeVariable) { 8478 assert typeVariable.name().equals(name()); 8479 this.typeVariable = typeVariable; 8480 } 8481 8482 @Override 8483 public OnnxType.TypeVariable typeVariable() { 8484 return typeVariable; 8485 } 8486 } 8487 8488 public enum InputParameter implements OnnxParameter { 8489 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8490 shape(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 8491 ; 8492 8493 final OnnxType type; 8494 final Quantifier quantifier; 8495 8496 InputParameter(OnnxType type, Quantifier quantifier) { 8497 this.type = type; 8498 this.quantifier = quantifier; 8499 } 8500 8501 @Override 8502 public OnnxType type() { 8503 return type; 8504 } 8505 8506 @Override 8507 public Quantifier quantifier() { 8508 return quantifier; 8509 } 8510 } 8511 8512 public enum OutputParameter implements OnnxParameter { 8513 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8514 ; 8515 8516 final OnnxType type; 8517 final Quantifier quantifier; 8518 8519 OutputParameter(OnnxType type, Quantifier quantifier) { 8520 this.type = type; 8521 this.quantifier = quantifier; 8522 } 8523 8524 @Override 8525 public OnnxType type() { 8526 return type; 8527 } 8528 8529 @Override 8530 public Quantifier quantifier() { 8531 return quantifier; 8532 } 8533 } 8534 8535 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 8536 NAME, 8537 List.of(Attribute.values()), 8538 List.of(TypeConstraint.values()), 8539 List.of(InputParameter.values()), 8540 List.of(OutputParameter.values()) 8541 ); 8542 8543 public Expand(ExternalizedOp def) { 8544 super(SCHEMA, def); 8545 } 8546 8547 Expand(Expand that, CopyContext cc) { 8548 super(that, cc); 8549 } 8550 8551 @Override 8552 public Expand transform(CopyContext cc, OpTransformer ot) { 8553 return new Expand(this, cc); 8554 } 8555 8556 Expand(TypeElement resultType, Value input, Value shape) { 8557 super(SCHEMA, resultType, Set.of(), List.of(input, shape), List.of()); 8558 } 8559 8560 @Override 8561 public SequencedSet<OnnxParameter> onnxOutputs() { 8562 return onnxOutputs(SCHEMA); 8563 } 8564 8565 @Override 8566 public SequencedMap<OnnxParameter, Object> onnxInputs() { 8567 return onnxInputs(SCHEMA, List.of(input(), shape())); 8568 } 8569 8570 public Value input() { 8571 return operands().get(0); 8572 } 8573 8574 public Value shape() { 8575 return operands().get(1); 8576 } 8577 8578 } 8579 8580 public static Expand Expand(TypeElement resultType, Value input, Value shape) { 8581 return new Expand(resultType, input, shape); 8582 } 8583 8584 @OpFactory.OpDeclaration(EyeLike.NAME) 8585 public static final class EyeLike extends OnnxOp { 8586 public static final String NAME = "EyeLike"; 8587 8588 public enum Attribute implements OnnxAttribute { 8589 dtype(Long.class, true, null), 8590 k(Long.class, true, 0), 8591 ; 8592 8593 final Class<?> t; 8594 final boolean optional; 8595 final Object defaultValue; 8596 8597 Attribute(Class<?> type, boolean optional, Object defaultValue) { 8598 this.t = type; 8599 this.optional = optional; 8600 this.defaultValue = defaultValue; 8601 assert optional || defaultValue == null; 8602 } 8603 8604 public Class<?> type() { 8605 return t; 8606 } 8607 8608 public boolean isOptional() { 8609 return optional; 8610 } 8611 8612 public Object defaultValue() { 8613 return defaultValue; 8614 } 8615 } 8616 8617 public enum TypeConstraint implements OnnxTypeConstraint { 8618 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())))), 8619 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())))), 8620 ; 8621 8622 final OnnxType.TypeVariable typeVariable; 8623 8624 TypeConstraint(OnnxType.TypeVariable typeVariable) { 8625 assert typeVariable.name().equals(name()); 8626 this.typeVariable = typeVariable; 8627 } 8628 8629 @Override 8630 public OnnxType.TypeVariable typeVariable() { 8631 return typeVariable; 8632 } 8633 } 8634 8635 public enum InputParameter implements OnnxParameter { 8636 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 8637 ; 8638 8639 final OnnxType type; 8640 final Quantifier quantifier; 8641 8642 InputParameter(OnnxType type, Quantifier quantifier) { 8643 this.type = type; 8644 this.quantifier = quantifier; 8645 } 8646 8647 @Override 8648 public OnnxType type() { 8649 return type; 8650 } 8651 8652 @Override 8653 public Quantifier quantifier() { 8654 return quantifier; 8655 } 8656 } 8657 8658 public enum OutputParameter implements OnnxParameter { 8659 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 8660 ; 8661 8662 final OnnxType type; 8663 final Quantifier quantifier; 8664 8665 OutputParameter(OnnxType type, Quantifier quantifier) { 8666 this.type = type; 8667 this.quantifier = quantifier; 8668 } 8669 8670 @Override 8671 public OnnxType type() { 8672 return type; 8673 } 8674 8675 @Override 8676 public Quantifier quantifier() { 8677 return quantifier; 8678 } 8679 } 8680 8681 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 8682 NAME, 8683 List.of(Attribute.values()), 8684 List.of(TypeConstraint.values()), 8685 List.of(InputParameter.values()), 8686 List.of(OutputParameter.values()) 8687 ); 8688 8689 public EyeLike(ExternalizedOp def) { 8690 super(SCHEMA, def); 8691 } 8692 8693 EyeLike(EyeLike that, CopyContext cc) { 8694 super(that, cc); 8695 } 8696 8697 @Override 8698 public EyeLike transform(CopyContext cc, OpTransformer ot) { 8699 return new EyeLike(this, cc); 8700 } 8701 8702 EyeLike(TypeElement resultType, Value input, java.util.Optional<Long> dtype, java.util.Optional<Long> k) { 8703 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(dtype, k)); 8704 } 8705 8706 @Override 8707 public SequencedSet<OnnxParameter> onnxOutputs() { 8708 return onnxOutputs(SCHEMA); 8709 } 8710 8711 @Override 8712 public SequencedMap<OnnxParameter, Object> onnxInputs() { 8713 return onnxInputs(SCHEMA, List.of(input())); 8714 } 8715 8716 public Value input() { 8717 return operands().get(0); 8718 } 8719 8720 public java.util.Optional<Long> dtype() { 8721 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes); 8722 return java.util.Optional.ofNullable(dtype); 8723 } 8724 8725 public java.util.Optional<Long> k() { 8726 Long k = Attribute.k.access(Long.class, onnxAttributes); 8727 return java.util.Optional.ofNullable(k); 8728 } 8729 8730 } 8731 8732 public static EyeLike EyeLike(TypeElement resultType, Value input, java.util.Optional<Long> dtype, java.util.Optional<Long> k) { 8733 return new EyeLike(resultType, input, dtype, k); 8734 } 8735 8736 @OpFactory.OpDeclaration(FeatureVectorizer.NAME) 8737 public static final class FeatureVectorizer extends OnnxOp { 8738 public static final String NAME = "FeatureVectorizer"; 8739 8740 public enum Attribute implements OnnxAttribute { 8741 inputdimensions(long[].class, true, null), 8742 ; 8743 8744 final Class<?> t; 8745 final boolean optional; 8746 final Object defaultValue; 8747 8748 Attribute(Class<?> type, boolean optional, Object defaultValue) { 8749 this.t = type; 8750 this.optional = optional; 8751 this.defaultValue = defaultValue; 8752 assert optional || defaultValue == null; 8753 } 8754 8755 public Class<?> type() { 8756 return t; 8757 } 8758 8759 public boolean isOptional() { 8760 return optional; 8761 } 8762 8763 public Object defaultValue() { 8764 return defaultValue; 8765 } 8766 } 8767 8768 public enum TypeConstraint implements OnnxTypeConstraint { 8769 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 8770 ; 8771 8772 final OnnxType.TypeVariable typeVariable; 8773 8774 TypeConstraint(OnnxType.TypeVariable typeVariable) { 8775 assert typeVariable.name().equals(name()); 8776 this.typeVariable = typeVariable; 8777 } 8778 8779 @Override 8780 public OnnxType.TypeVariable typeVariable() { 8781 return typeVariable; 8782 } 8783 } 8784 8785 public enum InputParameter implements OnnxParameter { 8786 X(TypeConstraint.T1.typeVariable(), Quantifier.VARIADIC), 8787 ; 8788 8789 final OnnxType type; 8790 final Quantifier quantifier; 8791 8792 InputParameter(OnnxType type, Quantifier quantifier) { 8793 this.type = type; 8794 this.quantifier = quantifier; 8795 } 8796 8797 @Override 8798 public OnnxType type() { 8799 return type; 8800 } 8801 8802 @Override 8803 public Quantifier quantifier() { 8804 return quantifier; 8805 } 8806 } 8807 8808 public enum OutputParameter implements OnnxParameter { 8809 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 8810 ; 8811 8812 final OnnxType type; 8813 final Quantifier quantifier; 8814 8815 OutputParameter(OnnxType type, Quantifier quantifier) { 8816 this.type = type; 8817 this.quantifier = quantifier; 8818 } 8819 8820 @Override 8821 public OnnxType type() { 8822 return type; 8823 } 8824 8825 @Override 8826 public Quantifier quantifier() { 8827 return quantifier; 8828 } 8829 } 8830 8831 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 8832 NAME, 8833 List.of(Attribute.values()), 8834 List.of(TypeConstraint.values()), 8835 List.of(InputParameter.values()), 8836 List.of(OutputParameter.values()) 8837 ); 8838 8839 public FeatureVectorizer(ExternalizedOp def) { 8840 super(SCHEMA, def); 8841 } 8842 8843 FeatureVectorizer(FeatureVectorizer that, CopyContext cc) { 8844 super(that, cc); 8845 } 8846 8847 @Override 8848 public FeatureVectorizer transform(CopyContext cc, OpTransformer ot) { 8849 return new FeatureVectorizer(this, cc); 8850 } 8851 8852 FeatureVectorizer(TypeElement resultType, List<Value> X, java.util.Optional<long[]> inputdimensions) { 8853 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(inputdimensions)); 8854 } 8855 8856 @Override 8857 public SequencedSet<OnnxParameter> onnxOutputs() { 8858 return onnxOutputs(SCHEMA); 8859 } 8860 8861 @Override 8862 public SequencedMap<OnnxParameter, Object> onnxInputs() { 8863 return onnxInputs(SCHEMA, List.of(X())); 8864 } 8865 8866 public List<Value> X() { 8867 return operands(); 8868 } 8869 8870 public java.util.Optional<long[]> inputdimensions() { 8871 long[] inputdimensions = Attribute.inputdimensions.access(long[].class, onnxAttributes); 8872 return java.util.Optional.ofNullable(inputdimensions).map(long[]::clone); 8873 } 8874 8875 } 8876 8877 public static FeatureVectorizer FeatureVectorizer(TypeElement resultType, List<Value> X, java.util.Optional<long[]> inputdimensions) { 8878 return new FeatureVectorizer(resultType, X, inputdimensions); 8879 } 8880 8881 @OpFactory.OpDeclaration(Flatten.NAME) 8882 public static final class Flatten extends OnnxOp { 8883 public static final String NAME = "Flatten"; 8884 8885 public enum Attribute implements OnnxAttribute { 8886 axis(Long.class, true, 1), 8887 ; 8888 8889 final Class<?> t; 8890 final boolean optional; 8891 final Object defaultValue; 8892 8893 Attribute(Class<?> type, boolean optional, Object defaultValue) { 8894 this.t = type; 8895 this.optional = optional; 8896 this.defaultValue = defaultValue; 8897 assert optional || defaultValue == null; 8898 } 8899 8900 public Class<?> type() { 8901 return t; 8902 } 8903 8904 public boolean isOptional() { 8905 return optional; 8906 } 8907 8908 public Object defaultValue() { 8909 return defaultValue; 8910 } 8911 } 8912 8913 public enum TypeConstraint implements OnnxTypeConstraint { 8914 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())))), 8915 ; 8916 8917 final OnnxType.TypeVariable typeVariable; 8918 8919 TypeConstraint(OnnxType.TypeVariable typeVariable) { 8920 assert typeVariable.name().equals(name()); 8921 this.typeVariable = typeVariable; 8922 } 8923 8924 @Override 8925 public OnnxType.TypeVariable typeVariable() { 8926 return typeVariable; 8927 } 8928 } 8929 8930 public enum InputParameter implements OnnxParameter { 8931 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8932 ; 8933 8934 final OnnxType type; 8935 final Quantifier quantifier; 8936 8937 InputParameter(OnnxType type, Quantifier quantifier) { 8938 this.type = type; 8939 this.quantifier = quantifier; 8940 } 8941 8942 @Override 8943 public OnnxType type() { 8944 return type; 8945 } 8946 8947 @Override 8948 public Quantifier quantifier() { 8949 return quantifier; 8950 } 8951 } 8952 8953 public enum OutputParameter implements OnnxParameter { 8954 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 8955 ; 8956 8957 final OnnxType type; 8958 final Quantifier quantifier; 8959 8960 OutputParameter(OnnxType type, Quantifier quantifier) { 8961 this.type = type; 8962 this.quantifier = quantifier; 8963 } 8964 8965 @Override 8966 public OnnxType type() { 8967 return type; 8968 } 8969 8970 @Override 8971 public Quantifier quantifier() { 8972 return quantifier; 8973 } 8974 } 8975 8976 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 8977 NAME, 8978 List.of(Attribute.values()), 8979 List.of(TypeConstraint.values()), 8980 List.of(InputParameter.values()), 8981 List.of(OutputParameter.values()) 8982 ); 8983 8984 public Flatten(ExternalizedOp def) { 8985 super(SCHEMA, def); 8986 } 8987 8988 Flatten(Flatten that, CopyContext cc) { 8989 super(that, cc); 8990 } 8991 8992 @Override 8993 public Flatten transform(CopyContext cc, OpTransformer ot) { 8994 return new Flatten(this, cc); 8995 } 8996 8997 Flatten(TypeElement resultType, Value input, java.util.Optional<Long> axis) { 8998 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(axis)); 8999 } 9000 9001 @Override 9002 public SequencedSet<OnnxParameter> onnxOutputs() { 9003 return onnxOutputs(SCHEMA); 9004 } 9005 9006 @Override 9007 public SequencedMap<OnnxParameter, Object> onnxInputs() { 9008 return onnxInputs(SCHEMA, List.of(input())); 9009 } 9010 9011 public Value input() { 9012 return operands().get(0); 9013 } 9014 9015 public java.util.Optional<Long> axis() { 9016 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 9017 return java.util.Optional.ofNullable(axis); 9018 } 9019 9020 } 9021 9022 public static Flatten Flatten(TypeElement resultType, Value input, java.util.Optional<Long> axis) { 9023 return new Flatten(resultType, input, axis); 9024 } 9025 9026 @OpFactory.OpDeclaration(Floor.NAME) 9027 public static final class Floor extends OnnxOp { 9028 public static final String NAME = "Floor"; 9029 9030 public enum Attribute implements OnnxAttribute.None { } 9031 9032 public enum TypeConstraint implements OnnxTypeConstraint { 9033 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 9034 ; 9035 9036 final OnnxType.TypeVariable typeVariable; 9037 9038 TypeConstraint(OnnxType.TypeVariable typeVariable) { 9039 assert typeVariable.name().equals(name()); 9040 this.typeVariable = typeVariable; 9041 } 9042 9043 @Override 9044 public OnnxType.TypeVariable typeVariable() { 9045 return typeVariable; 9046 } 9047 } 9048 9049 public enum InputParameter implements OnnxParameter { 9050 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9051 ; 9052 9053 final OnnxType type; 9054 final Quantifier quantifier; 9055 9056 InputParameter(OnnxType type, Quantifier quantifier) { 9057 this.type = type; 9058 this.quantifier = quantifier; 9059 } 9060 9061 @Override 9062 public OnnxType type() { 9063 return type; 9064 } 9065 9066 @Override 9067 public Quantifier quantifier() { 9068 return quantifier; 9069 } 9070 } 9071 9072 public enum OutputParameter implements OnnxParameter { 9073 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9074 ; 9075 9076 final OnnxType type; 9077 final Quantifier quantifier; 9078 9079 OutputParameter(OnnxType type, Quantifier quantifier) { 9080 this.type = type; 9081 this.quantifier = quantifier; 9082 } 9083 9084 @Override 9085 public OnnxType type() { 9086 return type; 9087 } 9088 9089 @Override 9090 public Quantifier quantifier() { 9091 return quantifier; 9092 } 9093 } 9094 9095 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 9096 NAME, 9097 List.of(Attribute.values()), 9098 List.of(TypeConstraint.values()), 9099 List.of(InputParameter.values()), 9100 List.of(OutputParameter.values()) 9101 ); 9102 9103 public Floor(ExternalizedOp def) { 9104 super(SCHEMA, def); 9105 } 9106 9107 Floor(Floor that, CopyContext cc) { 9108 super(that, cc); 9109 } 9110 9111 @Override 9112 public Floor transform(CopyContext cc, OpTransformer ot) { 9113 return new Floor(this, cc); 9114 } 9115 9116 Floor(TypeElement resultType, Value X) { 9117 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 9118 } 9119 9120 @Override 9121 public SequencedSet<OnnxParameter> onnxOutputs() { 9122 return onnxOutputs(SCHEMA); 9123 } 9124 9125 @Override 9126 public SequencedMap<OnnxParameter, Object> onnxInputs() { 9127 return onnxInputs(SCHEMA, List.of(X())); 9128 } 9129 9130 public Value X() { 9131 return operands().get(0); 9132 } 9133 9134 } 9135 9136 public static Floor Floor(TypeElement resultType, Value X) { 9137 return new Floor(resultType, X); 9138 } 9139 9140 @OpFactory.OpDeclaration(GRU.NAME) 9141 public static final class GRU extends OnnxOp { 9142 public static final String NAME = "GRU"; 9143 9144 public enum Attribute implements OnnxAttribute { 9145 layout(Long.class, true, 0), 9146 activation_alpha(float[].class, true, null), 9147 hidden_size(Long.class, true, null), 9148 activation_beta(float[].class, true, null), 9149 activations(String[].class, true, null), 9150 linear_before_reset(Long.class, true, 0), 9151 clip(Float.class, true, null), 9152 direction(String.class, true, "forward"), 9153 ; 9154 9155 final Class<?> t; 9156 final boolean optional; 9157 final Object defaultValue; 9158 9159 Attribute(Class<?> type, boolean optional, Object defaultValue) { 9160 this.t = type; 9161 this.optional = optional; 9162 this.defaultValue = defaultValue; 9163 assert optional || defaultValue == null; 9164 } 9165 9166 public Class<?> type() { 9167 return t; 9168 } 9169 9170 public boolean isOptional() { 9171 return optional; 9172 } 9173 9174 public Object defaultValue() { 9175 return defaultValue; 9176 } 9177 } 9178 9179 public enum TypeConstraint implements OnnxTypeConstraint { 9180 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 9181 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32())))), 9182 ; 9183 9184 final OnnxType.TypeVariable typeVariable; 9185 9186 TypeConstraint(OnnxType.TypeVariable typeVariable) { 9187 assert typeVariable.name().equals(name()); 9188 this.typeVariable = typeVariable; 9189 } 9190 9191 @Override 9192 public OnnxType.TypeVariable typeVariable() { 9193 return typeVariable; 9194 } 9195 } 9196 9197 public enum InputParameter implements OnnxParameter { 9198 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9199 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9200 R(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9201 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 9202 sequence_lens(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL), 9203 initial_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 9204 ; 9205 9206 final OnnxType type; 9207 final Quantifier quantifier; 9208 9209 InputParameter(OnnxType type, Quantifier quantifier) { 9210 this.type = type; 9211 this.quantifier = quantifier; 9212 } 9213 9214 @Override 9215 public OnnxType type() { 9216 return type; 9217 } 9218 9219 @Override 9220 public Quantifier quantifier() { 9221 return quantifier; 9222 } 9223 } 9224 9225 public enum OutputParameter implements OnnxParameter { 9226 Y(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 9227 Y_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 9228 ; 9229 9230 final OnnxType type; 9231 final Quantifier quantifier; 9232 9233 OutputParameter(OnnxType type, Quantifier quantifier) { 9234 this.type = type; 9235 this.quantifier = quantifier; 9236 } 9237 9238 @Override 9239 public OnnxType type() { 9240 return type; 9241 } 9242 9243 @Override 9244 public Quantifier quantifier() { 9245 return quantifier; 9246 } 9247 } 9248 9249 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 9250 NAME, 9251 List.of(Attribute.values()), 9252 List.of(TypeConstraint.values()), 9253 List.of(InputParameter.values()), 9254 List.of(OutputParameter.values()) 9255 ); 9256 9257 public GRU(ExternalizedOp def) { 9258 super(SCHEMA, def); 9259 } 9260 9261 GRU(GRU that, CopyContext cc) { 9262 super(that, cc); 9263 } 9264 9265 @Override 9266 public GRU transform(CopyContext cc, OpTransformer ot) { 9267 return new GRU(this, cc); 9268 } 9269 9270 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) { 9271 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)); 9272 } 9273 9274 @Override 9275 public SequencedSet<OnnxParameter> onnxOutputs() { 9276 return onnxOutputs(SCHEMA); 9277 } 9278 9279 @Override 9280 public SequencedMap<OnnxParameter, Object> onnxInputs() { 9281 return onnxInputs(SCHEMA, List.of(X(), W(), R(), B(), sequence_lens(), initial_h())); 9282 } 9283 9284 public Value X() { 9285 return operands().get(0); 9286 } 9287 9288 public Value W() { 9289 return operands().get(1); 9290 } 9291 9292 public Value R() { 9293 return operands().get(2); 9294 } 9295 9296 public java.util.Optional<Value> B() { 9297 int i = optionalInputArguments.indexOf(InputParameter.B); 9298 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 9299 } 9300 9301 public java.util.Optional<Value> sequence_lens() { 9302 int i = optionalInputArguments.indexOf(InputParameter.sequence_lens); 9303 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 9304 } 9305 9306 public java.util.Optional<Value> initial_h() { 9307 int i = optionalInputArguments.indexOf(InputParameter.initial_h); 9308 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 9309 } 9310 9311 public java.util.Optional<Long> layout() { 9312 Long layout = Attribute.layout.access(Long.class, onnxAttributes); 9313 return java.util.Optional.ofNullable(layout); 9314 } 9315 9316 public java.util.Optional<float[]> activation_alpha() { 9317 float[] activation_alpha = Attribute.activation_alpha.access(float[].class, onnxAttributes); 9318 return java.util.Optional.ofNullable(activation_alpha).map(float[]::clone); 9319 } 9320 9321 public java.util.Optional<Long> hidden_size() { 9322 Long hidden_size = Attribute.hidden_size.access(Long.class, onnxAttributes); 9323 return java.util.Optional.ofNullable(hidden_size); 9324 } 9325 9326 public java.util.Optional<float[]> activation_beta() { 9327 float[] activation_beta = Attribute.activation_beta.access(float[].class, onnxAttributes); 9328 return java.util.Optional.ofNullable(activation_beta).map(float[]::clone); 9329 } 9330 9331 public java.util.Optional<String[]> activations() { 9332 String[] activations = Attribute.activations.access(String[].class, onnxAttributes); 9333 return java.util.Optional.ofNullable(activations).map(String[]::clone); 9334 } 9335 9336 public java.util.Optional<Long> linear_before_reset() { 9337 Long linear_before_reset = Attribute.linear_before_reset.access(Long.class, onnxAttributes); 9338 return java.util.Optional.ofNullable(linear_before_reset); 9339 } 9340 9341 public java.util.Optional<Float> clip() { 9342 Float clip = Attribute.clip.access(Float.class, onnxAttributes); 9343 return java.util.Optional.ofNullable(clip); 9344 } 9345 9346 public java.util.Optional<String> direction() { 9347 String direction = Attribute.direction.access(String.class, onnxAttributes); 9348 return java.util.Optional.ofNullable(direction); 9349 } 9350 9351 } 9352 9353 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) { 9354 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); 9355 } 9356 9357 @OpFactory.OpDeclaration(Gather.NAME) 9358 public static final class Gather extends OnnxOp { 9359 public static final String NAME = "Gather"; 9360 9361 public enum Attribute implements OnnxAttribute { 9362 axis(Long.class, true, 0), 9363 ; 9364 9365 final Class<?> t; 9366 final boolean optional; 9367 final Object defaultValue; 9368 9369 Attribute(Class<?> type, boolean optional, Object defaultValue) { 9370 this.t = type; 9371 this.optional = optional; 9372 this.defaultValue = defaultValue; 9373 assert optional || defaultValue == null; 9374 } 9375 9376 public Class<?> type() { 9377 return t; 9378 } 9379 9380 public boolean isOptional() { 9381 return optional; 9382 } 9383 9384 public Object defaultValue() { 9385 return defaultValue; 9386 } 9387 } 9388 9389 public enum TypeConstraint implements OnnxTypeConstraint { 9390 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())))), 9391 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 9392 ; 9393 9394 final OnnxType.TypeVariable typeVariable; 9395 9396 TypeConstraint(OnnxType.TypeVariable typeVariable) { 9397 assert typeVariable.name().equals(name()); 9398 this.typeVariable = typeVariable; 9399 } 9400 9401 @Override 9402 public OnnxType.TypeVariable typeVariable() { 9403 return typeVariable; 9404 } 9405 } 9406 9407 public enum InputParameter implements OnnxParameter { 9408 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9409 indices(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 9410 ; 9411 9412 final OnnxType type; 9413 final Quantifier quantifier; 9414 9415 InputParameter(OnnxType type, Quantifier quantifier) { 9416 this.type = type; 9417 this.quantifier = quantifier; 9418 } 9419 9420 @Override 9421 public OnnxType type() { 9422 return type; 9423 } 9424 9425 @Override 9426 public Quantifier quantifier() { 9427 return quantifier; 9428 } 9429 } 9430 9431 public enum OutputParameter implements OnnxParameter { 9432 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9433 ; 9434 9435 final OnnxType type; 9436 final Quantifier quantifier; 9437 9438 OutputParameter(OnnxType type, Quantifier quantifier) { 9439 this.type = type; 9440 this.quantifier = quantifier; 9441 } 9442 9443 @Override 9444 public OnnxType type() { 9445 return type; 9446 } 9447 9448 @Override 9449 public Quantifier quantifier() { 9450 return quantifier; 9451 } 9452 } 9453 9454 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 9455 NAME, 9456 List.of(Attribute.values()), 9457 List.of(TypeConstraint.values()), 9458 List.of(InputParameter.values()), 9459 List.of(OutputParameter.values()) 9460 ); 9461 9462 public Gather(ExternalizedOp def) { 9463 super(SCHEMA, def); 9464 } 9465 9466 Gather(Gather that, CopyContext cc) { 9467 super(that, cc); 9468 } 9469 9470 @Override 9471 public Gather transform(CopyContext cc, OpTransformer ot) { 9472 return new Gather(this, cc); 9473 } 9474 9475 Gather(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> axis) { 9476 super(SCHEMA, resultType, Set.of(), List.of(data, indices), List.of(axis)); 9477 } 9478 9479 @Override 9480 public SequencedSet<OnnxParameter> onnxOutputs() { 9481 return onnxOutputs(SCHEMA); 9482 } 9483 9484 @Override 9485 public SequencedMap<OnnxParameter, Object> onnxInputs() { 9486 return onnxInputs(SCHEMA, List.of(data(), indices())); 9487 } 9488 9489 public Value data() { 9490 return operands().get(0); 9491 } 9492 9493 public Value indices() { 9494 return operands().get(1); 9495 } 9496 9497 public java.util.Optional<Long> axis() { 9498 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 9499 return java.util.Optional.ofNullable(axis); 9500 } 9501 9502 } 9503 9504 public static Gather Gather(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> axis) { 9505 return new Gather(resultType, data, indices, axis); 9506 } 9507 9508 @OpFactory.OpDeclaration(GatherElements.NAME) 9509 public static final class GatherElements extends OnnxOp { 9510 public static final String NAME = "GatherElements"; 9511 9512 public enum Attribute implements OnnxAttribute { 9513 axis(Long.class, true, 0), 9514 ; 9515 9516 final Class<?> t; 9517 final boolean optional; 9518 final Object defaultValue; 9519 9520 Attribute(Class<?> type, boolean optional, Object defaultValue) { 9521 this.t = type; 9522 this.optional = optional; 9523 this.defaultValue = defaultValue; 9524 assert optional || defaultValue == null; 9525 } 9526 9527 public Class<?> type() { 9528 return t; 9529 } 9530 9531 public boolean isOptional() { 9532 return optional; 9533 } 9534 9535 public Object defaultValue() { 9536 return defaultValue; 9537 } 9538 } 9539 9540 public enum TypeConstraint implements OnnxTypeConstraint { 9541 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())))), 9542 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 9543 ; 9544 9545 final OnnxType.TypeVariable typeVariable; 9546 9547 TypeConstraint(OnnxType.TypeVariable typeVariable) { 9548 assert typeVariable.name().equals(name()); 9549 this.typeVariable = typeVariable; 9550 } 9551 9552 @Override 9553 public OnnxType.TypeVariable typeVariable() { 9554 return typeVariable; 9555 } 9556 } 9557 9558 public enum InputParameter implements OnnxParameter { 9559 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9560 indices(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 9561 ; 9562 9563 final OnnxType type; 9564 final Quantifier quantifier; 9565 9566 InputParameter(OnnxType type, Quantifier quantifier) { 9567 this.type = type; 9568 this.quantifier = quantifier; 9569 } 9570 9571 @Override 9572 public OnnxType type() { 9573 return type; 9574 } 9575 9576 @Override 9577 public Quantifier quantifier() { 9578 return quantifier; 9579 } 9580 } 9581 9582 public enum OutputParameter implements OnnxParameter { 9583 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9584 ; 9585 9586 final OnnxType type; 9587 final Quantifier quantifier; 9588 9589 OutputParameter(OnnxType type, Quantifier quantifier) { 9590 this.type = type; 9591 this.quantifier = quantifier; 9592 } 9593 9594 @Override 9595 public OnnxType type() { 9596 return type; 9597 } 9598 9599 @Override 9600 public Quantifier quantifier() { 9601 return quantifier; 9602 } 9603 } 9604 9605 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 9606 NAME, 9607 List.of(Attribute.values()), 9608 List.of(TypeConstraint.values()), 9609 List.of(InputParameter.values()), 9610 List.of(OutputParameter.values()) 9611 ); 9612 9613 public GatherElements(ExternalizedOp def) { 9614 super(SCHEMA, def); 9615 } 9616 9617 GatherElements(GatherElements that, CopyContext cc) { 9618 super(that, cc); 9619 } 9620 9621 @Override 9622 public GatherElements transform(CopyContext cc, OpTransformer ot) { 9623 return new GatherElements(this, cc); 9624 } 9625 9626 GatherElements(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> axis) { 9627 super(SCHEMA, resultType, Set.of(), List.of(data, indices), List.of(axis)); 9628 } 9629 9630 @Override 9631 public SequencedSet<OnnxParameter> onnxOutputs() { 9632 return onnxOutputs(SCHEMA); 9633 } 9634 9635 @Override 9636 public SequencedMap<OnnxParameter, Object> onnxInputs() { 9637 return onnxInputs(SCHEMA, List.of(data(), indices())); 9638 } 9639 9640 public Value data() { 9641 return operands().get(0); 9642 } 9643 9644 public Value indices() { 9645 return operands().get(1); 9646 } 9647 9648 public java.util.Optional<Long> axis() { 9649 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 9650 return java.util.Optional.ofNullable(axis); 9651 } 9652 9653 } 9654 9655 public static GatherElements GatherElements(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> axis) { 9656 return new GatherElements(resultType, data, indices, axis); 9657 } 9658 9659 @OpFactory.OpDeclaration(GatherND.NAME) 9660 public static final class GatherND extends OnnxOp { 9661 public static final String NAME = "GatherND"; 9662 9663 public enum Attribute implements OnnxAttribute { 9664 batch_dims(Long.class, true, 0), 9665 ; 9666 9667 final Class<?> t; 9668 final boolean optional; 9669 final Object defaultValue; 9670 9671 Attribute(Class<?> type, boolean optional, Object defaultValue) { 9672 this.t = type; 9673 this.optional = optional; 9674 this.defaultValue = defaultValue; 9675 assert optional || defaultValue == null; 9676 } 9677 9678 public Class<?> type() { 9679 return t; 9680 } 9681 9682 public boolean isOptional() { 9683 return optional; 9684 } 9685 9686 public Object defaultValue() { 9687 return defaultValue; 9688 } 9689 } 9690 9691 public enum TypeConstraint implements OnnxTypeConstraint { 9692 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())))), 9693 ; 9694 9695 final OnnxType.TypeVariable typeVariable; 9696 9697 TypeConstraint(OnnxType.TypeVariable typeVariable) { 9698 assert typeVariable.name().equals(name()); 9699 this.typeVariable = typeVariable; 9700 } 9701 9702 @Override 9703 public OnnxType.TypeVariable typeVariable() { 9704 return typeVariable; 9705 } 9706 } 9707 9708 public enum InputParameter implements OnnxParameter { 9709 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9710 indices(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 9711 ; 9712 9713 final OnnxType type; 9714 final Quantifier quantifier; 9715 9716 InputParameter(OnnxType type, Quantifier quantifier) { 9717 this.type = type; 9718 this.quantifier = quantifier; 9719 } 9720 9721 @Override 9722 public OnnxType type() { 9723 return type; 9724 } 9725 9726 @Override 9727 public Quantifier quantifier() { 9728 return quantifier; 9729 } 9730 } 9731 9732 public enum OutputParameter implements OnnxParameter { 9733 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9734 ; 9735 9736 final OnnxType type; 9737 final Quantifier quantifier; 9738 9739 OutputParameter(OnnxType type, Quantifier quantifier) { 9740 this.type = type; 9741 this.quantifier = quantifier; 9742 } 9743 9744 @Override 9745 public OnnxType type() { 9746 return type; 9747 } 9748 9749 @Override 9750 public Quantifier quantifier() { 9751 return quantifier; 9752 } 9753 } 9754 9755 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 9756 NAME, 9757 List.of(Attribute.values()), 9758 List.of(TypeConstraint.values()), 9759 List.of(InputParameter.values()), 9760 List.of(OutputParameter.values()) 9761 ); 9762 9763 public GatherND(ExternalizedOp def) { 9764 super(SCHEMA, def); 9765 } 9766 9767 GatherND(GatherND that, CopyContext cc) { 9768 super(that, cc); 9769 } 9770 9771 @Override 9772 public GatherND transform(CopyContext cc, OpTransformer ot) { 9773 return new GatherND(this, cc); 9774 } 9775 9776 GatherND(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> batch_dims) { 9777 super(SCHEMA, resultType, Set.of(), List.of(data, indices), List.of(batch_dims)); 9778 } 9779 9780 @Override 9781 public SequencedSet<OnnxParameter> onnxOutputs() { 9782 return onnxOutputs(SCHEMA); 9783 } 9784 9785 @Override 9786 public SequencedMap<OnnxParameter, Object> onnxInputs() { 9787 return onnxInputs(SCHEMA, List.of(data(), indices())); 9788 } 9789 9790 public Value data() { 9791 return operands().get(0); 9792 } 9793 9794 public Value indices() { 9795 return operands().get(1); 9796 } 9797 9798 public java.util.Optional<Long> batch_dims() { 9799 Long batch_dims = Attribute.batch_dims.access(Long.class, onnxAttributes); 9800 return java.util.Optional.ofNullable(batch_dims); 9801 } 9802 9803 } 9804 9805 public static GatherND GatherND(TypeElement resultType, Value data, Value indices, java.util.Optional<Long> batch_dims) { 9806 return new GatherND(resultType, data, indices, batch_dims); 9807 } 9808 9809 @OpFactory.OpDeclaration(Gelu.NAME) 9810 public static final class Gelu extends OnnxOp { 9811 public static final String NAME = "Gelu"; 9812 9813 public enum Attribute implements OnnxAttribute { 9814 approximate(String.class, true, "none"), 9815 ; 9816 9817 final Class<?> t; 9818 final boolean optional; 9819 final Object defaultValue; 9820 9821 Attribute(Class<?> type, boolean optional, Object defaultValue) { 9822 this.t = type; 9823 this.optional = optional; 9824 this.defaultValue = defaultValue; 9825 assert optional || defaultValue == null; 9826 } 9827 9828 public Class<?> type() { 9829 return t; 9830 } 9831 9832 public boolean isOptional() { 9833 return optional; 9834 } 9835 9836 public Object defaultValue() { 9837 return defaultValue; 9838 } 9839 } 9840 9841 public enum TypeConstraint implements OnnxTypeConstraint { 9842 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 9843 ; 9844 9845 final OnnxType.TypeVariable typeVariable; 9846 9847 TypeConstraint(OnnxType.TypeVariable typeVariable) { 9848 assert typeVariable.name().equals(name()); 9849 this.typeVariable = typeVariable; 9850 } 9851 9852 @Override 9853 public OnnxType.TypeVariable typeVariable() { 9854 return typeVariable; 9855 } 9856 } 9857 9858 public enum InputParameter implements OnnxParameter { 9859 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9860 ; 9861 9862 final OnnxType type; 9863 final Quantifier quantifier; 9864 9865 InputParameter(OnnxType type, Quantifier quantifier) { 9866 this.type = type; 9867 this.quantifier = quantifier; 9868 } 9869 9870 @Override 9871 public OnnxType type() { 9872 return type; 9873 } 9874 9875 @Override 9876 public Quantifier quantifier() { 9877 return quantifier; 9878 } 9879 } 9880 9881 public enum OutputParameter implements OnnxParameter { 9882 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 9883 ; 9884 9885 final OnnxType type; 9886 final Quantifier quantifier; 9887 9888 OutputParameter(OnnxType type, Quantifier quantifier) { 9889 this.type = type; 9890 this.quantifier = quantifier; 9891 } 9892 9893 @Override 9894 public OnnxType type() { 9895 return type; 9896 } 9897 9898 @Override 9899 public Quantifier quantifier() { 9900 return quantifier; 9901 } 9902 } 9903 9904 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 9905 NAME, 9906 List.of(Attribute.values()), 9907 List.of(TypeConstraint.values()), 9908 List.of(InputParameter.values()), 9909 List.of(OutputParameter.values()) 9910 ); 9911 9912 public Gelu(ExternalizedOp def) { 9913 super(SCHEMA, def); 9914 } 9915 9916 Gelu(Gelu that, CopyContext cc) { 9917 super(that, cc); 9918 } 9919 9920 @Override 9921 public Gelu transform(CopyContext cc, OpTransformer ot) { 9922 return new Gelu(this, cc); 9923 } 9924 9925 Gelu(TypeElement resultType, Value X, java.util.Optional<String> approximate) { 9926 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(approximate)); 9927 } 9928 9929 @Override 9930 public SequencedSet<OnnxParameter> onnxOutputs() { 9931 return onnxOutputs(SCHEMA); 9932 } 9933 9934 @Override 9935 public SequencedMap<OnnxParameter, Object> onnxInputs() { 9936 return onnxInputs(SCHEMA, List.of(X())); 9937 } 9938 9939 public Value X() { 9940 return operands().get(0); 9941 } 9942 9943 public java.util.Optional<String> approximate() { 9944 String approximate = Attribute.approximate.access(String.class, onnxAttributes); 9945 return java.util.Optional.ofNullable(approximate); 9946 } 9947 9948 } 9949 9950 public static Gelu Gelu(TypeElement resultType, Value X, java.util.Optional<String> approximate) { 9951 return new Gelu(resultType, X, approximate); 9952 } 9953 9954 @OpFactory.OpDeclaration(Gemm.NAME) 9955 public static final class Gemm extends OnnxOp { 9956 public static final String NAME = "Gemm"; 9957 9958 public enum Attribute implements OnnxAttribute { 9959 alpha(Float.class, true, 1.0f), 9960 transB(Long.class, true, 0), 9961 beta(Float.class, true, 1.0f), 9962 transA(Long.class, true, 0), 9963 ; 9964 9965 final Class<?> t; 9966 final boolean optional; 9967 final Object defaultValue; 9968 9969 Attribute(Class<?> type, boolean optional, Object defaultValue) { 9970 this.t = type; 9971 this.optional = optional; 9972 this.defaultValue = defaultValue; 9973 assert optional || defaultValue == null; 9974 } 9975 9976 public Class<?> type() { 9977 return t; 9978 } 9979 9980 public boolean isOptional() { 9981 return optional; 9982 } 9983 9984 public Object defaultValue() { 9985 return defaultValue; 9986 } 9987 } 9988 9989 public enum TypeConstraint implements OnnxTypeConstraint { 9990 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())))), 9991 ; 9992 9993 final OnnxType.TypeVariable typeVariable; 9994 9995 TypeConstraint(OnnxType.TypeVariable typeVariable) { 9996 assert typeVariable.name().equals(name()); 9997 this.typeVariable = typeVariable; 9998 } 9999 10000 @Override 10001 public OnnxType.TypeVariable typeVariable() { 10002 return typeVariable; 10003 } 10004 } 10005 10006 public enum InputParameter implements OnnxParameter { 10007 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10008 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10009 C(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 10010 ; 10011 10012 final OnnxType type; 10013 final Quantifier quantifier; 10014 10015 InputParameter(OnnxType type, Quantifier quantifier) { 10016 this.type = type; 10017 this.quantifier = quantifier; 10018 } 10019 10020 @Override 10021 public OnnxType type() { 10022 return type; 10023 } 10024 10025 @Override 10026 public Quantifier quantifier() { 10027 return quantifier; 10028 } 10029 } 10030 10031 public enum OutputParameter implements OnnxParameter { 10032 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10033 ; 10034 10035 final OnnxType type; 10036 final Quantifier quantifier; 10037 10038 OutputParameter(OnnxType type, Quantifier quantifier) { 10039 this.type = type; 10040 this.quantifier = quantifier; 10041 } 10042 10043 @Override 10044 public OnnxType type() { 10045 return type; 10046 } 10047 10048 @Override 10049 public Quantifier quantifier() { 10050 return quantifier; 10051 } 10052 } 10053 10054 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 10055 NAME, 10056 List.of(Attribute.values()), 10057 List.of(TypeConstraint.values()), 10058 List.of(InputParameter.values()), 10059 List.of(OutputParameter.values()) 10060 ); 10061 10062 public Gemm(ExternalizedOp def) { 10063 super(SCHEMA, def); 10064 } 10065 10066 Gemm(Gemm that, CopyContext cc) { 10067 super(that, cc); 10068 } 10069 10070 @Override 10071 public Gemm transform(CopyContext cc, OpTransformer ot) { 10072 return new Gemm(this, cc); 10073 } 10074 10075 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) { 10076 super(SCHEMA, resultType, Set.of(), List.of(A, B, C), List.of(alpha, transB, beta, transA)); 10077 } 10078 10079 @Override 10080 public SequencedSet<OnnxParameter> onnxOutputs() { 10081 return onnxOutputs(SCHEMA); 10082 } 10083 10084 @Override 10085 public SequencedMap<OnnxParameter, Object> onnxInputs() { 10086 return onnxInputs(SCHEMA, List.of(A(), B(), C())); 10087 } 10088 10089 public Value A() { 10090 return operands().get(0); 10091 } 10092 10093 public Value B() { 10094 return operands().get(1); 10095 } 10096 10097 public java.util.Optional<Value> C() { 10098 int i = optionalInputArguments.indexOf(InputParameter.C); 10099 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 10100 } 10101 10102 public java.util.Optional<Float> alpha() { 10103 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 10104 return java.util.Optional.ofNullable(alpha); 10105 } 10106 10107 public java.util.Optional<Long> transB() { 10108 Long transB = Attribute.transB.access(Long.class, onnxAttributes); 10109 return java.util.Optional.ofNullable(transB); 10110 } 10111 10112 public java.util.Optional<Float> beta() { 10113 Float beta = Attribute.beta.access(Float.class, onnxAttributes); 10114 return java.util.Optional.ofNullable(beta); 10115 } 10116 10117 public java.util.Optional<Long> transA() { 10118 Long transA = Attribute.transA.access(Long.class, onnxAttributes); 10119 return java.util.Optional.ofNullable(transA); 10120 } 10121 10122 } 10123 10124 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) { 10125 return new Gemm(resultType, A, B, C, alpha, transB, beta, transA); 10126 } 10127 10128 @OpFactory.OpDeclaration(GlobalAveragePool.NAME) 10129 public static final class GlobalAveragePool extends OnnxOp { 10130 public static final String NAME = "GlobalAveragePool"; 10131 10132 public enum Attribute implements OnnxAttribute.None { } 10133 10134 public enum TypeConstraint implements OnnxTypeConstraint { 10135 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 10136 ; 10137 10138 final OnnxType.TypeVariable typeVariable; 10139 10140 TypeConstraint(OnnxType.TypeVariable typeVariable) { 10141 assert typeVariable.name().equals(name()); 10142 this.typeVariable = typeVariable; 10143 } 10144 10145 @Override 10146 public OnnxType.TypeVariable typeVariable() { 10147 return typeVariable; 10148 } 10149 } 10150 10151 public enum InputParameter implements OnnxParameter { 10152 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10153 ; 10154 10155 final OnnxType type; 10156 final Quantifier quantifier; 10157 10158 InputParameter(OnnxType type, Quantifier quantifier) { 10159 this.type = type; 10160 this.quantifier = quantifier; 10161 } 10162 10163 @Override 10164 public OnnxType type() { 10165 return type; 10166 } 10167 10168 @Override 10169 public Quantifier quantifier() { 10170 return quantifier; 10171 } 10172 } 10173 10174 public enum OutputParameter implements OnnxParameter { 10175 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10176 ; 10177 10178 final OnnxType type; 10179 final Quantifier quantifier; 10180 10181 OutputParameter(OnnxType type, Quantifier quantifier) { 10182 this.type = type; 10183 this.quantifier = quantifier; 10184 } 10185 10186 @Override 10187 public OnnxType type() { 10188 return type; 10189 } 10190 10191 @Override 10192 public Quantifier quantifier() { 10193 return quantifier; 10194 } 10195 } 10196 10197 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 10198 NAME, 10199 List.of(Attribute.values()), 10200 List.of(TypeConstraint.values()), 10201 List.of(InputParameter.values()), 10202 List.of(OutputParameter.values()) 10203 ); 10204 10205 public GlobalAveragePool(ExternalizedOp def) { 10206 super(SCHEMA, def); 10207 } 10208 10209 GlobalAveragePool(GlobalAveragePool that, CopyContext cc) { 10210 super(that, cc); 10211 } 10212 10213 @Override 10214 public GlobalAveragePool transform(CopyContext cc, OpTransformer ot) { 10215 return new GlobalAveragePool(this, cc); 10216 } 10217 10218 GlobalAveragePool(TypeElement resultType, Value X) { 10219 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 10220 } 10221 10222 @Override 10223 public SequencedSet<OnnxParameter> onnxOutputs() { 10224 return onnxOutputs(SCHEMA); 10225 } 10226 10227 @Override 10228 public SequencedMap<OnnxParameter, Object> onnxInputs() { 10229 return onnxInputs(SCHEMA, List.of(X())); 10230 } 10231 10232 public Value X() { 10233 return operands().get(0); 10234 } 10235 10236 } 10237 10238 public static GlobalAveragePool GlobalAveragePool(TypeElement resultType, Value X) { 10239 return new GlobalAveragePool(resultType, X); 10240 } 10241 10242 @OpFactory.OpDeclaration(GlobalLpPool.NAME) 10243 public static final class GlobalLpPool extends OnnxOp { 10244 public static final String NAME = "GlobalLpPool"; 10245 10246 public enum Attribute implements OnnxAttribute { 10247 p(Long.class, true, 2), 10248 ; 10249 10250 final Class<?> t; 10251 final boolean optional; 10252 final Object defaultValue; 10253 10254 Attribute(Class<?> type, boolean optional, Object defaultValue) { 10255 this.t = type; 10256 this.optional = optional; 10257 this.defaultValue = defaultValue; 10258 assert optional || defaultValue == null; 10259 } 10260 10261 public Class<?> type() { 10262 return t; 10263 } 10264 10265 public boolean isOptional() { 10266 return optional; 10267 } 10268 10269 public Object defaultValue() { 10270 return defaultValue; 10271 } 10272 } 10273 10274 public enum TypeConstraint implements OnnxTypeConstraint { 10275 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 10276 ; 10277 10278 final OnnxType.TypeVariable typeVariable; 10279 10280 TypeConstraint(OnnxType.TypeVariable typeVariable) { 10281 assert typeVariable.name().equals(name()); 10282 this.typeVariable = typeVariable; 10283 } 10284 10285 @Override 10286 public OnnxType.TypeVariable typeVariable() { 10287 return typeVariable; 10288 } 10289 } 10290 10291 public enum InputParameter implements OnnxParameter { 10292 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10293 ; 10294 10295 final OnnxType type; 10296 final Quantifier quantifier; 10297 10298 InputParameter(OnnxType type, Quantifier quantifier) { 10299 this.type = type; 10300 this.quantifier = quantifier; 10301 } 10302 10303 @Override 10304 public OnnxType type() { 10305 return type; 10306 } 10307 10308 @Override 10309 public Quantifier quantifier() { 10310 return quantifier; 10311 } 10312 } 10313 10314 public enum OutputParameter implements OnnxParameter { 10315 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10316 ; 10317 10318 final OnnxType type; 10319 final Quantifier quantifier; 10320 10321 OutputParameter(OnnxType type, Quantifier quantifier) { 10322 this.type = type; 10323 this.quantifier = quantifier; 10324 } 10325 10326 @Override 10327 public OnnxType type() { 10328 return type; 10329 } 10330 10331 @Override 10332 public Quantifier quantifier() { 10333 return quantifier; 10334 } 10335 } 10336 10337 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 10338 NAME, 10339 List.of(Attribute.values()), 10340 List.of(TypeConstraint.values()), 10341 List.of(InputParameter.values()), 10342 List.of(OutputParameter.values()) 10343 ); 10344 10345 public GlobalLpPool(ExternalizedOp def) { 10346 super(SCHEMA, def); 10347 } 10348 10349 GlobalLpPool(GlobalLpPool that, CopyContext cc) { 10350 super(that, cc); 10351 } 10352 10353 @Override 10354 public GlobalLpPool transform(CopyContext cc, OpTransformer ot) { 10355 return new GlobalLpPool(this, cc); 10356 } 10357 10358 GlobalLpPool(TypeElement resultType, Value X, java.util.Optional<Long> p) { 10359 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(p)); 10360 } 10361 10362 @Override 10363 public SequencedSet<OnnxParameter> onnxOutputs() { 10364 return onnxOutputs(SCHEMA); 10365 } 10366 10367 @Override 10368 public SequencedMap<OnnxParameter, Object> onnxInputs() { 10369 return onnxInputs(SCHEMA, List.of(X())); 10370 } 10371 10372 public Value X() { 10373 return operands().get(0); 10374 } 10375 10376 public java.util.Optional<Long> p() { 10377 Long p = Attribute.p.access(Long.class, onnxAttributes); 10378 return java.util.Optional.ofNullable(p); 10379 } 10380 10381 } 10382 10383 public static GlobalLpPool GlobalLpPool(TypeElement resultType, Value X, java.util.Optional<Long> p) { 10384 return new GlobalLpPool(resultType, X, p); 10385 } 10386 10387 @OpFactory.OpDeclaration(GlobalMaxPool.NAME) 10388 public static final class GlobalMaxPool extends OnnxOp { 10389 public static final String NAME = "GlobalMaxPool"; 10390 10391 public enum Attribute implements OnnxAttribute.None { } 10392 10393 public enum TypeConstraint implements OnnxTypeConstraint { 10394 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 10395 ; 10396 10397 final OnnxType.TypeVariable typeVariable; 10398 10399 TypeConstraint(OnnxType.TypeVariable typeVariable) { 10400 assert typeVariable.name().equals(name()); 10401 this.typeVariable = typeVariable; 10402 } 10403 10404 @Override 10405 public OnnxType.TypeVariable typeVariable() { 10406 return typeVariable; 10407 } 10408 } 10409 10410 public enum InputParameter implements OnnxParameter { 10411 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10412 ; 10413 10414 final OnnxType type; 10415 final Quantifier quantifier; 10416 10417 InputParameter(OnnxType type, Quantifier quantifier) { 10418 this.type = type; 10419 this.quantifier = quantifier; 10420 } 10421 10422 @Override 10423 public OnnxType type() { 10424 return type; 10425 } 10426 10427 @Override 10428 public Quantifier quantifier() { 10429 return quantifier; 10430 } 10431 } 10432 10433 public enum OutputParameter implements OnnxParameter { 10434 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10435 ; 10436 10437 final OnnxType type; 10438 final Quantifier quantifier; 10439 10440 OutputParameter(OnnxType type, Quantifier quantifier) { 10441 this.type = type; 10442 this.quantifier = quantifier; 10443 } 10444 10445 @Override 10446 public OnnxType type() { 10447 return type; 10448 } 10449 10450 @Override 10451 public Quantifier quantifier() { 10452 return quantifier; 10453 } 10454 } 10455 10456 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 10457 NAME, 10458 List.of(Attribute.values()), 10459 List.of(TypeConstraint.values()), 10460 List.of(InputParameter.values()), 10461 List.of(OutputParameter.values()) 10462 ); 10463 10464 public GlobalMaxPool(ExternalizedOp def) { 10465 super(SCHEMA, def); 10466 } 10467 10468 GlobalMaxPool(GlobalMaxPool that, CopyContext cc) { 10469 super(that, cc); 10470 } 10471 10472 @Override 10473 public GlobalMaxPool transform(CopyContext cc, OpTransformer ot) { 10474 return new GlobalMaxPool(this, cc); 10475 } 10476 10477 GlobalMaxPool(TypeElement resultType, Value X) { 10478 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 10479 } 10480 10481 @Override 10482 public SequencedSet<OnnxParameter> onnxOutputs() { 10483 return onnxOutputs(SCHEMA); 10484 } 10485 10486 @Override 10487 public SequencedMap<OnnxParameter, Object> onnxInputs() { 10488 return onnxInputs(SCHEMA, List.of(X())); 10489 } 10490 10491 public Value X() { 10492 return operands().get(0); 10493 } 10494 10495 } 10496 10497 public static GlobalMaxPool GlobalMaxPool(TypeElement resultType, Value X) { 10498 return new GlobalMaxPool(resultType, X); 10499 } 10500 10501 @OpFactory.OpDeclaration(Gradient.NAME) 10502 public static final class Gradient extends OnnxOp { 10503 public static final String NAME = "Gradient"; 10504 10505 public enum Attribute implements OnnxAttribute { 10506 y(String.class, false, null), 10507 zs(String[].class, true, null), 10508 xs(String[].class, false, null), 10509 ; 10510 10511 final Class<?> t; 10512 final boolean optional; 10513 final Object defaultValue; 10514 10515 Attribute(Class<?> type, boolean optional, Object defaultValue) { 10516 this.t = type; 10517 this.optional = optional; 10518 this.defaultValue = defaultValue; 10519 assert optional || defaultValue == null; 10520 } 10521 10522 public Class<?> type() { 10523 return t; 10524 } 10525 10526 public boolean isOptional() { 10527 return optional; 10528 } 10529 10530 public Object defaultValue() { 10531 return defaultValue; 10532 } 10533 } 10534 10535 public enum TypeConstraint implements OnnxTypeConstraint { 10536 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())))), 10537 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 10538 ; 10539 10540 final OnnxType.TypeVariable typeVariable; 10541 10542 TypeConstraint(OnnxType.TypeVariable typeVariable) { 10543 assert typeVariable.name().equals(name()); 10544 this.typeVariable = typeVariable; 10545 } 10546 10547 @Override 10548 public OnnxType.TypeVariable typeVariable() { 10549 return typeVariable; 10550 } 10551 } 10552 10553 public enum InputParameter implements OnnxParameter { 10554 Inputs(TypeConstraint.T1.typeVariable(), Quantifier.VARIADIC), 10555 ; 10556 10557 final OnnxType type; 10558 final Quantifier quantifier; 10559 10560 InputParameter(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 enum OutputParameter implements OnnxParameter { 10577 Outputs(TypeConstraint.T2.typeVariable(), Quantifier.VARIADIC), 10578 ; 10579 10580 final OnnxType type; 10581 final Quantifier quantifier; 10582 10583 OutputParameter(OnnxType type, Quantifier quantifier) { 10584 this.type = type; 10585 this.quantifier = quantifier; 10586 } 10587 10588 @Override 10589 public OnnxType type() { 10590 return type; 10591 } 10592 10593 @Override 10594 public Quantifier quantifier() { 10595 return quantifier; 10596 } 10597 } 10598 10599 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 10600 NAME, 10601 List.of(Attribute.values()), 10602 List.of(TypeConstraint.values()), 10603 List.of(InputParameter.values()), 10604 List.of(OutputParameter.values()) 10605 ); 10606 10607 public Gradient(ExternalizedOp def) { 10608 super(SCHEMA, def); 10609 } 10610 10611 Gradient(Gradient that, CopyContext cc) { 10612 super(that, cc); 10613 } 10614 10615 @Override 10616 public Gradient transform(CopyContext cc, OpTransformer ot) { 10617 return new Gradient(this, cc); 10618 } 10619 10620 Gradient(TypeElement resultType, List<Value> Inputs, String y, java.util.Optional<String[]> zs, String[] xs) { 10621 super(SCHEMA, resultType, Set.of(), List.of(Inputs), List.of(y, zs, xs)); 10622 } 10623 10624 @Override 10625 public SequencedSet<OnnxParameter> onnxOutputs() { 10626 return onnxOutputs(SCHEMA); 10627 } 10628 10629 @Override 10630 public SequencedMap<OnnxParameter, Object> onnxInputs() { 10631 return onnxInputs(SCHEMA, List.of(Inputs())); 10632 } 10633 10634 public List<Value> Inputs() { 10635 return operands(); 10636 } 10637 10638 public String y() { 10639 String y = Attribute.y.access(String.class, onnxAttributes); 10640 return y; 10641 } 10642 10643 public java.util.Optional<String[]> zs() { 10644 String[] zs = Attribute.zs.access(String[].class, onnxAttributes); 10645 return java.util.Optional.ofNullable(zs).map(String[]::clone); 10646 } 10647 10648 public String[] xs() { 10649 String[] xs = Attribute.xs.access(String[].class, onnxAttributes); 10650 return xs.clone(); 10651 } 10652 10653 } 10654 10655 public static Gradient Gradient(TypeElement resultType, List<Value> Inputs, String y, java.util.Optional<String[]> zs, String[] xs) { 10656 return new Gradient(resultType, Inputs, y, zs, xs); 10657 } 10658 10659 @OpFactory.OpDeclaration(Greater.NAME) 10660 public static final class Greater extends OnnxOp { 10661 public static final String NAME = "Greater"; 10662 10663 public enum Attribute implements OnnxAttribute.None { } 10664 10665 public enum TypeConstraint implements OnnxTypeConstraint { 10666 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())))), 10667 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))), 10668 ; 10669 10670 final OnnxType.TypeVariable typeVariable; 10671 10672 TypeConstraint(OnnxType.TypeVariable typeVariable) { 10673 assert typeVariable.name().equals(name()); 10674 this.typeVariable = typeVariable; 10675 } 10676 10677 @Override 10678 public OnnxType.TypeVariable typeVariable() { 10679 return typeVariable; 10680 } 10681 } 10682 10683 public enum InputParameter implements OnnxParameter { 10684 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10685 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10686 ; 10687 10688 final OnnxType type; 10689 final Quantifier quantifier; 10690 10691 InputParameter(OnnxType type, Quantifier quantifier) { 10692 this.type = type; 10693 this.quantifier = quantifier; 10694 } 10695 10696 @Override 10697 public OnnxType type() { 10698 return type; 10699 } 10700 10701 @Override 10702 public Quantifier quantifier() { 10703 return quantifier; 10704 } 10705 } 10706 10707 public enum OutputParameter implements OnnxParameter { 10708 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 10709 ; 10710 10711 final OnnxType type; 10712 final Quantifier quantifier; 10713 10714 OutputParameter(OnnxType type, Quantifier quantifier) { 10715 this.type = type; 10716 this.quantifier = quantifier; 10717 } 10718 10719 @Override 10720 public OnnxType type() { 10721 return type; 10722 } 10723 10724 @Override 10725 public Quantifier quantifier() { 10726 return quantifier; 10727 } 10728 } 10729 10730 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 10731 NAME, 10732 List.of(Attribute.values()), 10733 List.of(TypeConstraint.values()), 10734 List.of(InputParameter.values()), 10735 List.of(OutputParameter.values()) 10736 ); 10737 10738 public Greater(ExternalizedOp def) { 10739 super(SCHEMA, def); 10740 } 10741 10742 Greater(Greater that, CopyContext cc) { 10743 super(that, cc); 10744 } 10745 10746 @Override 10747 public Greater transform(CopyContext cc, OpTransformer ot) { 10748 return new Greater(this, cc); 10749 } 10750 10751 Greater(TypeElement resultType, Value A, Value B) { 10752 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 10753 } 10754 10755 @Override 10756 public SequencedSet<OnnxParameter> onnxOutputs() { 10757 return onnxOutputs(SCHEMA); 10758 } 10759 10760 @Override 10761 public SequencedMap<OnnxParameter, Object> onnxInputs() { 10762 return onnxInputs(SCHEMA, List.of(A(), B())); 10763 } 10764 10765 public Value A() { 10766 return operands().get(0); 10767 } 10768 10769 public Value B() { 10770 return operands().get(1); 10771 } 10772 10773 } 10774 10775 public static Greater Greater(TypeElement resultType, Value A, Value B) { 10776 return new Greater(resultType, A, B); 10777 } 10778 10779 @OpFactory.OpDeclaration(GreaterOrEqual.NAME) 10780 public static final class GreaterOrEqual extends OnnxOp { 10781 public static final String NAME = "GreaterOrEqual"; 10782 10783 public enum Attribute implements OnnxAttribute.None { } 10784 10785 public enum TypeConstraint implements OnnxTypeConstraint { 10786 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())))), 10787 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))), 10788 ; 10789 10790 final OnnxType.TypeVariable typeVariable; 10791 10792 TypeConstraint(OnnxType.TypeVariable typeVariable) { 10793 assert typeVariable.name().equals(name()); 10794 this.typeVariable = typeVariable; 10795 } 10796 10797 @Override 10798 public OnnxType.TypeVariable typeVariable() { 10799 return typeVariable; 10800 } 10801 } 10802 10803 public enum InputParameter implements OnnxParameter { 10804 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10805 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 10806 ; 10807 10808 final OnnxType type; 10809 final Quantifier quantifier; 10810 10811 InputParameter(OnnxType type, Quantifier quantifier) { 10812 this.type = type; 10813 this.quantifier = quantifier; 10814 } 10815 10816 @Override 10817 public OnnxType type() { 10818 return type; 10819 } 10820 10821 @Override 10822 public Quantifier quantifier() { 10823 return quantifier; 10824 } 10825 } 10826 10827 public enum OutputParameter implements OnnxParameter { 10828 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 10829 ; 10830 10831 final OnnxType type; 10832 final Quantifier quantifier; 10833 10834 OutputParameter(OnnxType type, Quantifier quantifier) { 10835 this.type = type; 10836 this.quantifier = quantifier; 10837 } 10838 10839 @Override 10840 public OnnxType type() { 10841 return type; 10842 } 10843 10844 @Override 10845 public Quantifier quantifier() { 10846 return quantifier; 10847 } 10848 } 10849 10850 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 10851 NAME, 10852 List.of(Attribute.values()), 10853 List.of(TypeConstraint.values()), 10854 List.of(InputParameter.values()), 10855 List.of(OutputParameter.values()) 10856 ); 10857 10858 public GreaterOrEqual(ExternalizedOp def) { 10859 super(SCHEMA, def); 10860 } 10861 10862 GreaterOrEqual(GreaterOrEqual that, CopyContext cc) { 10863 super(that, cc); 10864 } 10865 10866 @Override 10867 public GreaterOrEqual transform(CopyContext cc, OpTransformer ot) { 10868 return new GreaterOrEqual(this, cc); 10869 } 10870 10871 GreaterOrEqual(TypeElement resultType, Value A, Value B) { 10872 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 10873 } 10874 10875 @Override 10876 public SequencedSet<OnnxParameter> onnxOutputs() { 10877 return onnxOutputs(SCHEMA); 10878 } 10879 10880 @Override 10881 public SequencedMap<OnnxParameter, Object> onnxInputs() { 10882 return onnxInputs(SCHEMA, List.of(A(), B())); 10883 } 10884 10885 public Value A() { 10886 return operands().get(0); 10887 } 10888 10889 public Value B() { 10890 return operands().get(1); 10891 } 10892 10893 } 10894 10895 public static GreaterOrEqual GreaterOrEqual(TypeElement resultType, Value A, Value B) { 10896 return new GreaterOrEqual(resultType, A, B); 10897 } 10898 10899 @OpFactory.OpDeclaration(GridSample.NAME) 10900 public static final class GridSample extends OnnxOp { 10901 public static final String NAME = "GridSample"; 10902 10903 public enum Attribute implements OnnxAttribute { 10904 mode(String.class, true, "linear"), 10905 align_corners(Long.class, true, 0), 10906 padding_mode(String.class, true, "zeros"), 10907 ; 10908 10909 final Class<?> t; 10910 final boolean optional; 10911 final Object defaultValue; 10912 10913 Attribute(Class<?> type, boolean optional, Object defaultValue) { 10914 this.t = type; 10915 this.optional = optional; 10916 this.defaultValue = defaultValue; 10917 assert optional || defaultValue == null; 10918 } 10919 10920 public Class<?> type() { 10921 return t; 10922 } 10923 10924 public boolean isOptional() { 10925 return optional; 10926 } 10927 10928 public Object defaultValue() { 10929 return defaultValue; 10930 } 10931 } 10932 10933 public enum TypeConstraint implements OnnxTypeConstraint { 10934 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())))), 10935 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 10936 ; 10937 10938 final OnnxType.TypeVariable typeVariable; 10939 10940 TypeConstraint(OnnxType.TypeVariable typeVariable) { 10941 assert typeVariable.name().equals(name()); 10942 this.typeVariable = typeVariable; 10943 } 10944 10945 @Override 10946 public OnnxType.TypeVariable typeVariable() { 10947 return typeVariable; 10948 } 10949 } 10950 10951 public enum InputParameter implements OnnxParameter { 10952 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 10953 grid(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 10954 ; 10955 10956 final OnnxType type; 10957 final Quantifier quantifier; 10958 10959 InputParameter(OnnxType type, Quantifier quantifier) { 10960 this.type = type; 10961 this.quantifier = quantifier; 10962 } 10963 10964 @Override 10965 public OnnxType type() { 10966 return type; 10967 } 10968 10969 @Override 10970 public Quantifier quantifier() { 10971 return quantifier; 10972 } 10973 } 10974 10975 public enum OutputParameter implements OnnxParameter { 10976 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 10977 ; 10978 10979 final OnnxType type; 10980 final Quantifier quantifier; 10981 10982 OutputParameter(OnnxType type, Quantifier quantifier) { 10983 this.type = type; 10984 this.quantifier = quantifier; 10985 } 10986 10987 @Override 10988 public OnnxType type() { 10989 return type; 10990 } 10991 10992 @Override 10993 public Quantifier quantifier() { 10994 return quantifier; 10995 } 10996 } 10997 10998 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 10999 NAME, 11000 List.of(Attribute.values()), 11001 List.of(TypeConstraint.values()), 11002 List.of(InputParameter.values()), 11003 List.of(OutputParameter.values()) 11004 ); 11005 11006 public GridSample(ExternalizedOp def) { 11007 super(SCHEMA, def); 11008 } 11009 11010 GridSample(GridSample that, CopyContext cc) { 11011 super(that, cc); 11012 } 11013 11014 @Override 11015 public GridSample transform(CopyContext cc, OpTransformer ot) { 11016 return new GridSample(this, cc); 11017 } 11018 11019 GridSample(TypeElement resultType, Value X, Value grid, java.util.Optional<String> mode, java.util.Optional<Long> align_corners, java.util.Optional<String> padding_mode) { 11020 super(SCHEMA, resultType, Set.of(), List.of(X, grid), List.of(mode, align_corners, padding_mode)); 11021 } 11022 11023 @Override 11024 public SequencedSet<OnnxParameter> onnxOutputs() { 11025 return onnxOutputs(SCHEMA); 11026 } 11027 11028 @Override 11029 public SequencedMap<OnnxParameter, Object> onnxInputs() { 11030 return onnxInputs(SCHEMA, List.of(X(), grid())); 11031 } 11032 11033 public Value X() { 11034 return operands().get(0); 11035 } 11036 11037 public Value grid() { 11038 return operands().get(1); 11039 } 11040 11041 public java.util.Optional<String> mode() { 11042 String mode = Attribute.mode.access(String.class, onnxAttributes); 11043 return java.util.Optional.ofNullable(mode); 11044 } 11045 11046 public java.util.Optional<Long> align_corners() { 11047 Long align_corners = Attribute.align_corners.access(Long.class, onnxAttributes); 11048 return java.util.Optional.ofNullable(align_corners); 11049 } 11050 11051 public java.util.Optional<String> padding_mode() { 11052 String padding_mode = Attribute.padding_mode.access(String.class, onnxAttributes); 11053 return java.util.Optional.ofNullable(padding_mode); 11054 } 11055 11056 } 11057 11058 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) { 11059 return new GridSample(resultType, X, grid, mode, align_corners, padding_mode); 11060 } 11061 11062 @OpFactory.OpDeclaration(GroupNormalization.NAME) 11063 public static final class GroupNormalization extends OnnxOp { 11064 public static final String NAME = "GroupNormalization"; 11065 11066 public enum Attribute implements OnnxAttribute { 11067 epsilon(Float.class, true, 1.0E-5f), 11068 stash_type(Long.class, true, 1), 11069 num_groups(Long.class, false, null), 11070 ; 11071 11072 final Class<?> t; 11073 final boolean optional; 11074 final Object defaultValue; 11075 11076 Attribute(Class<?> type, boolean optional, Object defaultValue) { 11077 this.t = type; 11078 this.optional = optional; 11079 this.defaultValue = defaultValue; 11080 assert optional || defaultValue == null; 11081 } 11082 11083 public Class<?> type() { 11084 return t; 11085 } 11086 11087 public boolean isOptional() { 11088 return optional; 11089 } 11090 11091 public Object defaultValue() { 11092 return defaultValue; 11093 } 11094 } 11095 11096 public enum TypeConstraint implements OnnxTypeConstraint { 11097 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 11098 ; 11099 11100 final OnnxType.TypeVariable typeVariable; 11101 11102 TypeConstraint(OnnxType.TypeVariable typeVariable) { 11103 assert typeVariable.name().equals(name()); 11104 this.typeVariable = typeVariable; 11105 } 11106 11107 @Override 11108 public OnnxType.TypeVariable typeVariable() { 11109 return typeVariable; 11110 } 11111 } 11112 11113 public enum InputParameter implements OnnxParameter { 11114 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11115 scale(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11116 bias(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11117 ; 11118 11119 final OnnxType type; 11120 final Quantifier quantifier; 11121 11122 InputParameter(OnnxType type, Quantifier quantifier) { 11123 this.type = type; 11124 this.quantifier = quantifier; 11125 } 11126 11127 @Override 11128 public OnnxType type() { 11129 return type; 11130 } 11131 11132 @Override 11133 public Quantifier quantifier() { 11134 return quantifier; 11135 } 11136 } 11137 11138 public enum OutputParameter implements OnnxParameter { 11139 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11140 ; 11141 11142 final OnnxType type; 11143 final Quantifier quantifier; 11144 11145 OutputParameter(OnnxType type, Quantifier quantifier) { 11146 this.type = type; 11147 this.quantifier = quantifier; 11148 } 11149 11150 @Override 11151 public OnnxType type() { 11152 return type; 11153 } 11154 11155 @Override 11156 public Quantifier quantifier() { 11157 return quantifier; 11158 } 11159 } 11160 11161 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 11162 NAME, 11163 List.of(Attribute.values()), 11164 List.of(TypeConstraint.values()), 11165 List.of(InputParameter.values()), 11166 List.of(OutputParameter.values()) 11167 ); 11168 11169 public GroupNormalization(ExternalizedOp def) { 11170 super(SCHEMA, def); 11171 } 11172 11173 GroupNormalization(GroupNormalization that, CopyContext cc) { 11174 super(that, cc); 11175 } 11176 11177 @Override 11178 public GroupNormalization transform(CopyContext cc, OpTransformer ot) { 11179 return new GroupNormalization(this, cc); 11180 } 11181 11182 GroupNormalization(TypeElement resultType, Value X, Value scale, Value bias, java.util.Optional<Float> epsilon, java.util.Optional<Long> stash_type, long num_groups) { 11183 super(SCHEMA, resultType, Set.of(), List.of(X, scale, bias), List.of(epsilon, stash_type, num_groups)); 11184 } 11185 11186 @Override 11187 public SequencedSet<OnnxParameter> onnxOutputs() { 11188 return onnxOutputs(SCHEMA); 11189 } 11190 11191 @Override 11192 public SequencedMap<OnnxParameter, Object> onnxInputs() { 11193 return onnxInputs(SCHEMA, List.of(X(), scale(), bias())); 11194 } 11195 11196 public Value X() { 11197 return operands().get(0); 11198 } 11199 11200 public Value scale() { 11201 return operands().get(1); 11202 } 11203 11204 public Value bias() { 11205 return operands().get(2); 11206 } 11207 11208 public java.util.Optional<Float> epsilon() { 11209 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes); 11210 return java.util.Optional.ofNullable(epsilon); 11211 } 11212 11213 public java.util.Optional<Long> stash_type() { 11214 Long stash_type = Attribute.stash_type.access(Long.class, onnxAttributes); 11215 return java.util.Optional.ofNullable(stash_type); 11216 } 11217 11218 public long num_groups() { 11219 long num_groups = Attribute.num_groups.access(Long.class, onnxAttributes); 11220 return num_groups; 11221 } 11222 11223 } 11224 11225 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) { 11226 return new GroupNormalization(resultType, X, scale, bias, epsilon, stash_type, num_groups); 11227 } 11228 11229 @OpFactory.OpDeclaration(HammingWindow.NAME) 11230 public static final class HammingWindow extends OnnxOp { 11231 public static final String NAME = "HammingWindow"; 11232 11233 public enum Attribute implements OnnxAttribute { 11234 periodic(Long.class, true, 1), 11235 output_datatype(Long.class, true, 1), 11236 ; 11237 11238 final Class<?> t; 11239 final boolean optional; 11240 final Object defaultValue; 11241 11242 Attribute(Class<?> type, boolean optional, Object defaultValue) { 11243 this.t = type; 11244 this.optional = optional; 11245 this.defaultValue = defaultValue; 11246 assert optional || defaultValue == null; 11247 } 11248 11249 public Class<?> type() { 11250 return t; 11251 } 11252 11253 public boolean isOptional() { 11254 return optional; 11255 } 11256 11257 public Object defaultValue() { 11258 return defaultValue; 11259 } 11260 } 11261 11262 public enum TypeConstraint implements OnnxTypeConstraint { 11263 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 11264 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())))), 11265 ; 11266 11267 final OnnxType.TypeVariable typeVariable; 11268 11269 TypeConstraint(OnnxType.TypeVariable typeVariable) { 11270 assert typeVariable.name().equals(name()); 11271 this.typeVariable = typeVariable; 11272 } 11273 11274 @Override 11275 public OnnxType.TypeVariable typeVariable() { 11276 return typeVariable; 11277 } 11278 } 11279 11280 public enum InputParameter implements OnnxParameter { 11281 size(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 11282 ; 11283 11284 final OnnxType type; 11285 final Quantifier quantifier; 11286 11287 InputParameter(OnnxType type, Quantifier quantifier) { 11288 this.type = type; 11289 this.quantifier = quantifier; 11290 } 11291 11292 @Override 11293 public OnnxType type() { 11294 return type; 11295 } 11296 11297 @Override 11298 public Quantifier quantifier() { 11299 return quantifier; 11300 } 11301 } 11302 11303 public enum OutputParameter implements OnnxParameter { 11304 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 11305 ; 11306 11307 final OnnxType type; 11308 final Quantifier quantifier; 11309 11310 OutputParameter(OnnxType type, Quantifier quantifier) { 11311 this.type = type; 11312 this.quantifier = quantifier; 11313 } 11314 11315 @Override 11316 public OnnxType type() { 11317 return type; 11318 } 11319 11320 @Override 11321 public Quantifier quantifier() { 11322 return quantifier; 11323 } 11324 } 11325 11326 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 11327 NAME, 11328 List.of(Attribute.values()), 11329 List.of(TypeConstraint.values()), 11330 List.of(InputParameter.values()), 11331 List.of(OutputParameter.values()) 11332 ); 11333 11334 public HammingWindow(ExternalizedOp def) { 11335 super(SCHEMA, def); 11336 } 11337 11338 HammingWindow(HammingWindow that, CopyContext cc) { 11339 super(that, cc); 11340 } 11341 11342 @Override 11343 public HammingWindow transform(CopyContext cc, OpTransformer ot) { 11344 return new HammingWindow(this, cc); 11345 } 11346 11347 HammingWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) { 11348 super(SCHEMA, resultType, Set.of(), List.of(size), List.of(periodic, output_datatype)); 11349 } 11350 11351 @Override 11352 public SequencedSet<OnnxParameter> onnxOutputs() { 11353 return onnxOutputs(SCHEMA); 11354 } 11355 11356 @Override 11357 public SequencedMap<OnnxParameter, Object> onnxInputs() { 11358 return onnxInputs(SCHEMA, List.of(size())); 11359 } 11360 11361 public Value size() { 11362 return operands().get(0); 11363 } 11364 11365 public java.util.Optional<Long> periodic() { 11366 Long periodic = Attribute.periodic.access(Long.class, onnxAttributes); 11367 return java.util.Optional.ofNullable(periodic); 11368 } 11369 11370 public java.util.Optional<Long> output_datatype() { 11371 Long output_datatype = Attribute.output_datatype.access(Long.class, onnxAttributes); 11372 return java.util.Optional.ofNullable(output_datatype); 11373 } 11374 11375 } 11376 11377 public static HammingWindow HammingWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) { 11378 return new HammingWindow(resultType, size, periodic, output_datatype); 11379 } 11380 11381 @OpFactory.OpDeclaration(HannWindow.NAME) 11382 public static final class HannWindow extends OnnxOp { 11383 public static final String NAME = "HannWindow"; 11384 11385 public enum Attribute implements OnnxAttribute { 11386 periodic(Long.class, true, 1), 11387 output_datatype(Long.class, true, 1), 11388 ; 11389 11390 final Class<?> t; 11391 final boolean optional; 11392 final Object defaultValue; 11393 11394 Attribute(Class<?> type, boolean optional, Object defaultValue) { 11395 this.t = type; 11396 this.optional = optional; 11397 this.defaultValue = defaultValue; 11398 assert optional || defaultValue == null; 11399 } 11400 11401 public Class<?> type() { 11402 return t; 11403 } 11404 11405 public boolean isOptional() { 11406 return optional; 11407 } 11408 11409 public Object defaultValue() { 11410 return defaultValue; 11411 } 11412 } 11413 11414 public enum TypeConstraint implements OnnxTypeConstraint { 11415 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 11416 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())))), 11417 ; 11418 11419 final OnnxType.TypeVariable typeVariable; 11420 11421 TypeConstraint(OnnxType.TypeVariable typeVariable) { 11422 assert typeVariable.name().equals(name()); 11423 this.typeVariable = typeVariable; 11424 } 11425 11426 @Override 11427 public OnnxType.TypeVariable typeVariable() { 11428 return typeVariable; 11429 } 11430 } 11431 11432 public enum InputParameter implements OnnxParameter { 11433 size(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 11434 ; 11435 11436 final OnnxType type; 11437 final Quantifier quantifier; 11438 11439 InputParameter(OnnxType type, Quantifier quantifier) { 11440 this.type = type; 11441 this.quantifier = quantifier; 11442 } 11443 11444 @Override 11445 public OnnxType type() { 11446 return type; 11447 } 11448 11449 @Override 11450 public Quantifier quantifier() { 11451 return quantifier; 11452 } 11453 } 11454 11455 public enum OutputParameter implements OnnxParameter { 11456 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 11457 ; 11458 11459 final OnnxType type; 11460 final Quantifier quantifier; 11461 11462 OutputParameter(OnnxType type, Quantifier quantifier) { 11463 this.type = type; 11464 this.quantifier = quantifier; 11465 } 11466 11467 @Override 11468 public OnnxType type() { 11469 return type; 11470 } 11471 11472 @Override 11473 public Quantifier quantifier() { 11474 return quantifier; 11475 } 11476 } 11477 11478 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 11479 NAME, 11480 List.of(Attribute.values()), 11481 List.of(TypeConstraint.values()), 11482 List.of(InputParameter.values()), 11483 List.of(OutputParameter.values()) 11484 ); 11485 11486 public HannWindow(ExternalizedOp def) { 11487 super(SCHEMA, def); 11488 } 11489 11490 HannWindow(HannWindow that, CopyContext cc) { 11491 super(that, cc); 11492 } 11493 11494 @Override 11495 public HannWindow transform(CopyContext cc, OpTransformer ot) { 11496 return new HannWindow(this, cc); 11497 } 11498 11499 HannWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) { 11500 super(SCHEMA, resultType, Set.of(), List.of(size), List.of(periodic, output_datatype)); 11501 } 11502 11503 @Override 11504 public SequencedSet<OnnxParameter> onnxOutputs() { 11505 return onnxOutputs(SCHEMA); 11506 } 11507 11508 @Override 11509 public SequencedMap<OnnxParameter, Object> onnxInputs() { 11510 return onnxInputs(SCHEMA, List.of(size())); 11511 } 11512 11513 public Value size() { 11514 return operands().get(0); 11515 } 11516 11517 public java.util.Optional<Long> periodic() { 11518 Long periodic = Attribute.periodic.access(Long.class, onnxAttributes); 11519 return java.util.Optional.ofNullable(periodic); 11520 } 11521 11522 public java.util.Optional<Long> output_datatype() { 11523 Long output_datatype = Attribute.output_datatype.access(Long.class, onnxAttributes); 11524 return java.util.Optional.ofNullable(output_datatype); 11525 } 11526 11527 } 11528 11529 public static HannWindow HannWindow(TypeElement resultType, Value size, java.util.Optional<Long> periodic, java.util.Optional<Long> output_datatype) { 11530 return new HannWindow(resultType, size, periodic, output_datatype); 11531 } 11532 11533 @OpFactory.OpDeclaration(HardSigmoid.NAME) 11534 public static final class HardSigmoid extends OnnxOp { 11535 public static final String NAME = "HardSigmoid"; 11536 11537 public enum Attribute implements OnnxAttribute { 11538 alpha(Float.class, true, 0.2f), 11539 beta(Float.class, true, 0.5f), 11540 ; 11541 11542 final Class<?> t; 11543 final boolean optional; 11544 final Object defaultValue; 11545 11546 Attribute(Class<?> type, boolean optional, Object defaultValue) { 11547 this.t = type; 11548 this.optional = optional; 11549 this.defaultValue = defaultValue; 11550 assert optional || defaultValue == null; 11551 } 11552 11553 public Class<?> type() { 11554 return t; 11555 } 11556 11557 public boolean isOptional() { 11558 return optional; 11559 } 11560 11561 public Object defaultValue() { 11562 return defaultValue; 11563 } 11564 } 11565 11566 public enum TypeConstraint implements OnnxTypeConstraint { 11567 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 11568 ; 11569 11570 final OnnxType.TypeVariable typeVariable; 11571 11572 TypeConstraint(OnnxType.TypeVariable typeVariable) { 11573 assert typeVariable.name().equals(name()); 11574 this.typeVariable = typeVariable; 11575 } 11576 11577 @Override 11578 public OnnxType.TypeVariable typeVariable() { 11579 return typeVariable; 11580 } 11581 } 11582 11583 public enum InputParameter implements OnnxParameter { 11584 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11585 ; 11586 11587 final OnnxType type; 11588 final Quantifier quantifier; 11589 11590 InputParameter(OnnxType type, Quantifier quantifier) { 11591 this.type = type; 11592 this.quantifier = quantifier; 11593 } 11594 11595 @Override 11596 public OnnxType type() { 11597 return type; 11598 } 11599 11600 @Override 11601 public Quantifier quantifier() { 11602 return quantifier; 11603 } 11604 } 11605 11606 public enum OutputParameter implements OnnxParameter { 11607 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11608 ; 11609 11610 final OnnxType type; 11611 final Quantifier quantifier; 11612 11613 OutputParameter(OnnxType type, Quantifier quantifier) { 11614 this.type = type; 11615 this.quantifier = quantifier; 11616 } 11617 11618 @Override 11619 public OnnxType type() { 11620 return type; 11621 } 11622 11623 @Override 11624 public Quantifier quantifier() { 11625 return quantifier; 11626 } 11627 } 11628 11629 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 11630 NAME, 11631 List.of(Attribute.values()), 11632 List.of(TypeConstraint.values()), 11633 List.of(InputParameter.values()), 11634 List.of(OutputParameter.values()) 11635 ); 11636 11637 public HardSigmoid(ExternalizedOp def) { 11638 super(SCHEMA, def); 11639 } 11640 11641 HardSigmoid(HardSigmoid that, CopyContext cc) { 11642 super(that, cc); 11643 } 11644 11645 @Override 11646 public HardSigmoid transform(CopyContext cc, OpTransformer ot) { 11647 return new HardSigmoid(this, cc); 11648 } 11649 11650 HardSigmoid(TypeElement resultType, Value X, java.util.Optional<Float> alpha, java.util.Optional<Float> beta) { 11651 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha, beta)); 11652 } 11653 11654 @Override 11655 public SequencedSet<OnnxParameter> onnxOutputs() { 11656 return onnxOutputs(SCHEMA); 11657 } 11658 11659 @Override 11660 public SequencedMap<OnnxParameter, Object> onnxInputs() { 11661 return onnxInputs(SCHEMA, List.of(X())); 11662 } 11663 11664 public Value X() { 11665 return operands().get(0); 11666 } 11667 11668 public java.util.Optional<Float> alpha() { 11669 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 11670 return java.util.Optional.ofNullable(alpha); 11671 } 11672 11673 public java.util.Optional<Float> beta() { 11674 Float beta = Attribute.beta.access(Float.class, onnxAttributes); 11675 return java.util.Optional.ofNullable(beta); 11676 } 11677 11678 } 11679 11680 public static HardSigmoid HardSigmoid(TypeElement resultType, Value X, java.util.Optional<Float> alpha, java.util.Optional<Float> beta) { 11681 return new HardSigmoid(resultType, X, alpha, beta); 11682 } 11683 11684 @OpFactory.OpDeclaration(HardSwish.NAME) 11685 public static final class HardSwish extends OnnxOp { 11686 public static final String NAME = "HardSwish"; 11687 11688 public enum Attribute implements OnnxAttribute.None { } 11689 11690 public enum TypeConstraint implements OnnxTypeConstraint { 11691 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 11692 ; 11693 11694 final OnnxType.TypeVariable typeVariable; 11695 11696 TypeConstraint(OnnxType.TypeVariable typeVariable) { 11697 assert typeVariable.name().equals(name()); 11698 this.typeVariable = typeVariable; 11699 } 11700 11701 @Override 11702 public OnnxType.TypeVariable typeVariable() { 11703 return typeVariable; 11704 } 11705 } 11706 11707 public enum InputParameter implements OnnxParameter { 11708 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11709 ; 11710 11711 final OnnxType type; 11712 final Quantifier quantifier; 11713 11714 InputParameter(OnnxType type, Quantifier quantifier) { 11715 this.type = type; 11716 this.quantifier = quantifier; 11717 } 11718 11719 @Override 11720 public OnnxType type() { 11721 return type; 11722 } 11723 11724 @Override 11725 public Quantifier quantifier() { 11726 return quantifier; 11727 } 11728 } 11729 11730 public enum OutputParameter implements OnnxParameter { 11731 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11732 ; 11733 11734 final OnnxType type; 11735 final Quantifier quantifier; 11736 11737 OutputParameter(OnnxType type, Quantifier quantifier) { 11738 this.type = type; 11739 this.quantifier = quantifier; 11740 } 11741 11742 @Override 11743 public OnnxType type() { 11744 return type; 11745 } 11746 11747 @Override 11748 public Quantifier quantifier() { 11749 return quantifier; 11750 } 11751 } 11752 11753 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 11754 NAME, 11755 List.of(Attribute.values()), 11756 List.of(TypeConstraint.values()), 11757 List.of(InputParameter.values()), 11758 List.of(OutputParameter.values()) 11759 ); 11760 11761 public HardSwish(ExternalizedOp def) { 11762 super(SCHEMA, def); 11763 } 11764 11765 HardSwish(HardSwish that, CopyContext cc) { 11766 super(that, cc); 11767 } 11768 11769 @Override 11770 public HardSwish transform(CopyContext cc, OpTransformer ot) { 11771 return new HardSwish(this, cc); 11772 } 11773 11774 HardSwish(TypeElement resultType, Value X) { 11775 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 11776 } 11777 11778 @Override 11779 public SequencedSet<OnnxParameter> onnxOutputs() { 11780 return onnxOutputs(SCHEMA); 11781 } 11782 11783 @Override 11784 public SequencedMap<OnnxParameter, Object> onnxInputs() { 11785 return onnxInputs(SCHEMA, List.of(X())); 11786 } 11787 11788 public Value X() { 11789 return operands().get(0); 11790 } 11791 11792 } 11793 11794 public static HardSwish HardSwish(TypeElement resultType, Value X) { 11795 return new HardSwish(resultType, X); 11796 } 11797 11798 @OpFactory.OpDeclaration(Hardmax.NAME) 11799 public static final class Hardmax extends OnnxOp { 11800 public static final String NAME = "Hardmax"; 11801 11802 public enum Attribute implements OnnxAttribute { 11803 axis(Long.class, true, -1), 11804 ; 11805 11806 final Class<?> t; 11807 final boolean optional; 11808 final Object defaultValue; 11809 11810 Attribute(Class<?> type, boolean optional, Object defaultValue) { 11811 this.t = type; 11812 this.optional = optional; 11813 this.defaultValue = defaultValue; 11814 assert optional || defaultValue == null; 11815 } 11816 11817 public Class<?> type() { 11818 return t; 11819 } 11820 11821 public boolean isOptional() { 11822 return optional; 11823 } 11824 11825 public Object defaultValue() { 11826 return defaultValue; 11827 } 11828 } 11829 11830 public enum TypeConstraint implements OnnxTypeConstraint { 11831 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 11832 ; 11833 11834 final OnnxType.TypeVariable typeVariable; 11835 11836 TypeConstraint(OnnxType.TypeVariable typeVariable) { 11837 assert typeVariable.name().equals(name()); 11838 this.typeVariable = typeVariable; 11839 } 11840 11841 @Override 11842 public OnnxType.TypeVariable typeVariable() { 11843 return typeVariable; 11844 } 11845 } 11846 11847 public enum InputParameter implements OnnxParameter { 11848 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11849 ; 11850 11851 final OnnxType type; 11852 final Quantifier quantifier; 11853 11854 InputParameter(OnnxType type, Quantifier quantifier) { 11855 this.type = type; 11856 this.quantifier = quantifier; 11857 } 11858 11859 @Override 11860 public OnnxType type() { 11861 return type; 11862 } 11863 11864 @Override 11865 public Quantifier quantifier() { 11866 return quantifier; 11867 } 11868 } 11869 11870 public enum OutputParameter implements OnnxParameter { 11871 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 11872 ; 11873 11874 final OnnxType type; 11875 final Quantifier quantifier; 11876 11877 OutputParameter(OnnxType type, Quantifier quantifier) { 11878 this.type = type; 11879 this.quantifier = quantifier; 11880 } 11881 11882 @Override 11883 public OnnxType type() { 11884 return type; 11885 } 11886 11887 @Override 11888 public Quantifier quantifier() { 11889 return quantifier; 11890 } 11891 } 11892 11893 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 11894 NAME, 11895 List.of(Attribute.values()), 11896 List.of(TypeConstraint.values()), 11897 List.of(InputParameter.values()), 11898 List.of(OutputParameter.values()) 11899 ); 11900 11901 public Hardmax(ExternalizedOp def) { 11902 super(SCHEMA, def); 11903 } 11904 11905 Hardmax(Hardmax that, CopyContext cc) { 11906 super(that, cc); 11907 } 11908 11909 @Override 11910 public Hardmax transform(CopyContext cc, OpTransformer ot) { 11911 return new Hardmax(this, cc); 11912 } 11913 11914 Hardmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) { 11915 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(axis)); 11916 } 11917 11918 @Override 11919 public SequencedSet<OnnxParameter> onnxOutputs() { 11920 return onnxOutputs(SCHEMA); 11921 } 11922 11923 @Override 11924 public SequencedMap<OnnxParameter, Object> onnxInputs() { 11925 return onnxInputs(SCHEMA, List.of(input())); 11926 } 11927 11928 public Value input() { 11929 return operands().get(0); 11930 } 11931 11932 public java.util.Optional<Long> axis() { 11933 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 11934 return java.util.Optional.ofNullable(axis); 11935 } 11936 11937 } 11938 11939 public static Hardmax Hardmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) { 11940 return new Hardmax(resultType, input, axis); 11941 } 11942 11943 @OpFactory.OpDeclaration(Identity.NAME) 11944 public static final class Identity extends OnnxOp { 11945 public static final String NAME = "Identity"; 11946 11947 public enum Attribute implements OnnxAttribute.None { } 11948 11949 public enum TypeConstraint implements OnnxTypeConstraint { 11950 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.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()))))), 11951 ; 11952 11953 final OnnxType.TypeVariable typeVariable; 11954 11955 TypeConstraint(OnnxType.TypeVariable typeVariable) { 11956 assert typeVariable.name().equals(name()); 11957 this.typeVariable = typeVariable; 11958 } 11959 11960 @Override 11961 public OnnxType.TypeVariable typeVariable() { 11962 return typeVariable; 11963 } 11964 } 11965 11966 public enum InputParameter implements OnnxParameter { 11967 input(TypeConstraint.V.typeVariable(), Quantifier.REQUIRED), 11968 ; 11969 11970 final OnnxType type; 11971 final Quantifier quantifier; 11972 11973 InputParameter(OnnxType type, Quantifier quantifier) { 11974 this.type = type; 11975 this.quantifier = quantifier; 11976 } 11977 11978 @Override 11979 public OnnxType type() { 11980 return type; 11981 } 11982 11983 @Override 11984 public Quantifier quantifier() { 11985 return quantifier; 11986 } 11987 } 11988 11989 public enum OutputParameter implements OnnxParameter { 11990 output(TypeConstraint.V.typeVariable(), Quantifier.REQUIRED), 11991 ; 11992 11993 final OnnxType type; 11994 final Quantifier quantifier; 11995 11996 OutputParameter(OnnxType type, Quantifier quantifier) { 11997 this.type = type; 11998 this.quantifier = quantifier; 11999 } 12000 12001 @Override 12002 public OnnxType type() { 12003 return type; 12004 } 12005 12006 @Override 12007 public Quantifier quantifier() { 12008 return quantifier; 12009 } 12010 } 12011 12012 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 12013 NAME, 12014 List.of(Attribute.values()), 12015 List.of(TypeConstraint.values()), 12016 List.of(InputParameter.values()), 12017 List.of(OutputParameter.values()) 12018 ); 12019 12020 public Identity(ExternalizedOp def) { 12021 super(SCHEMA, def); 12022 } 12023 12024 Identity(Identity that, CopyContext cc) { 12025 super(that, cc); 12026 } 12027 12028 @Override 12029 public Identity transform(CopyContext cc, OpTransformer ot) { 12030 return new Identity(this, cc); 12031 } 12032 12033 Identity(TypeElement resultType, Value input) { 12034 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 12035 } 12036 12037 @Override 12038 public SequencedSet<OnnxParameter> onnxOutputs() { 12039 return onnxOutputs(SCHEMA); 12040 } 12041 12042 @Override 12043 public SequencedMap<OnnxParameter, Object> onnxInputs() { 12044 return onnxInputs(SCHEMA, List.of(input())); 12045 } 12046 12047 public Value input() { 12048 return operands().get(0); 12049 } 12050 12051 } 12052 12053 public static Identity Identity(TypeElement resultType, Value input) { 12054 return new Identity(resultType, input); 12055 } 12056 12057 @OpFactory.OpDeclaration(ImageDecoder.NAME) 12058 public static final class ImageDecoder extends OnnxOp { 12059 public static final String NAME = "ImageDecoder"; 12060 12061 public enum Attribute implements OnnxAttribute { 12062 pixel_format(String.class, true, "RGB"), 12063 ; 12064 12065 final Class<?> t; 12066 final boolean optional; 12067 final Object defaultValue; 12068 12069 Attribute(Class<?> type, boolean optional, Object defaultValue) { 12070 this.t = type; 12071 this.optional = optional; 12072 this.defaultValue = defaultValue; 12073 assert optional || defaultValue == null; 12074 } 12075 12076 public Class<?> type() { 12077 return t; 12078 } 12079 12080 public boolean isOptional() { 12081 return optional; 12082 } 12083 12084 public Object defaultValue() { 12085 return defaultValue; 12086 } 12087 } 12088 12089 public enum TypeConstraint implements OnnxTypeConstraint { 12090 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.uint8())))), 12091 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.uint8())))), 12092 ; 12093 12094 final OnnxType.TypeVariable typeVariable; 12095 12096 TypeConstraint(OnnxType.TypeVariable typeVariable) { 12097 assert typeVariable.name().equals(name()); 12098 this.typeVariable = typeVariable; 12099 } 12100 12101 @Override 12102 public OnnxType.TypeVariable typeVariable() { 12103 return typeVariable; 12104 } 12105 } 12106 12107 public enum InputParameter implements OnnxParameter { 12108 encoded_stream(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 12109 ; 12110 12111 final OnnxType type; 12112 final Quantifier quantifier; 12113 12114 InputParameter(OnnxType type, Quantifier quantifier) { 12115 this.type = type; 12116 this.quantifier = quantifier; 12117 } 12118 12119 @Override 12120 public OnnxType type() { 12121 return type; 12122 } 12123 12124 @Override 12125 public Quantifier quantifier() { 12126 return quantifier; 12127 } 12128 } 12129 12130 public enum OutputParameter implements OnnxParameter { 12131 image(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 12132 ; 12133 12134 final OnnxType type; 12135 final Quantifier quantifier; 12136 12137 OutputParameter(OnnxType type, Quantifier quantifier) { 12138 this.type = type; 12139 this.quantifier = quantifier; 12140 } 12141 12142 @Override 12143 public OnnxType type() { 12144 return type; 12145 } 12146 12147 @Override 12148 public Quantifier quantifier() { 12149 return quantifier; 12150 } 12151 } 12152 12153 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 12154 NAME, 12155 List.of(Attribute.values()), 12156 List.of(TypeConstraint.values()), 12157 List.of(InputParameter.values()), 12158 List.of(OutputParameter.values()) 12159 ); 12160 12161 public ImageDecoder(ExternalizedOp def) { 12162 super(SCHEMA, def); 12163 } 12164 12165 ImageDecoder(ImageDecoder that, CopyContext cc) { 12166 super(that, cc); 12167 } 12168 12169 @Override 12170 public ImageDecoder transform(CopyContext cc, OpTransformer ot) { 12171 return new ImageDecoder(this, cc); 12172 } 12173 12174 ImageDecoder(TypeElement resultType, Value encoded_stream, java.util.Optional<String> pixel_format) { 12175 super(SCHEMA, resultType, Set.of(), List.of(encoded_stream), List.of(pixel_format)); 12176 } 12177 12178 @Override 12179 public SequencedSet<OnnxParameter> onnxOutputs() { 12180 return onnxOutputs(SCHEMA); 12181 } 12182 12183 @Override 12184 public SequencedMap<OnnxParameter, Object> onnxInputs() { 12185 return onnxInputs(SCHEMA, List.of(encoded_stream())); 12186 } 12187 12188 public Value encoded_stream() { 12189 return operands().get(0); 12190 } 12191 12192 public java.util.Optional<String> pixel_format() { 12193 String pixel_format = Attribute.pixel_format.access(String.class, onnxAttributes); 12194 return java.util.Optional.ofNullable(pixel_format); 12195 } 12196 12197 } 12198 12199 public static ImageDecoder ImageDecoder(TypeElement resultType, Value encoded_stream, java.util.Optional<String> pixel_format) { 12200 return new ImageDecoder(resultType, encoded_stream, pixel_format); 12201 } 12202 12203 @OpFactory.OpDeclaration(Imputer.NAME) 12204 public static final class Imputer extends OnnxOp { 12205 public static final String NAME = "Imputer"; 12206 12207 public enum Attribute implements OnnxAttribute { 12208 replaced_value_int64(Long.class, true, 0), 12209 replaced_value_float(Float.class, true, 0.0f), 12210 imputed_value_int64s(long[].class, true, null), 12211 imputed_value_floats(float[].class, true, null), 12212 ; 12213 12214 final Class<?> t; 12215 final boolean optional; 12216 final Object defaultValue; 12217 12218 Attribute(Class<?> type, boolean optional, Object defaultValue) { 12219 this.t = type; 12220 this.optional = optional; 12221 this.defaultValue = defaultValue; 12222 assert optional || defaultValue == null; 12223 } 12224 12225 public Class<?> type() { 12226 return t; 12227 } 12228 12229 public boolean isOptional() { 12230 return optional; 12231 } 12232 12233 public Object defaultValue() { 12234 return defaultValue; 12235 } 12236 } 12237 12238 public enum TypeConstraint implements OnnxTypeConstraint { 12239 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 12240 ; 12241 12242 final OnnxType.TypeVariable typeVariable; 12243 12244 TypeConstraint(OnnxType.TypeVariable typeVariable) { 12245 assert typeVariable.name().equals(name()); 12246 this.typeVariable = typeVariable; 12247 } 12248 12249 @Override 12250 public OnnxType.TypeVariable typeVariable() { 12251 return typeVariable; 12252 } 12253 } 12254 12255 public enum InputParameter implements OnnxParameter { 12256 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 12257 ; 12258 12259 final OnnxType type; 12260 final Quantifier quantifier; 12261 12262 InputParameter(OnnxType type, Quantifier quantifier) { 12263 this.type = type; 12264 this.quantifier = quantifier; 12265 } 12266 12267 @Override 12268 public OnnxType type() { 12269 return type; 12270 } 12271 12272 @Override 12273 public Quantifier quantifier() { 12274 return quantifier; 12275 } 12276 } 12277 12278 public enum OutputParameter implements OnnxParameter { 12279 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 12280 ; 12281 12282 final OnnxType type; 12283 final Quantifier quantifier; 12284 12285 OutputParameter(OnnxType type, Quantifier quantifier) { 12286 this.type = type; 12287 this.quantifier = quantifier; 12288 } 12289 12290 @Override 12291 public OnnxType type() { 12292 return type; 12293 } 12294 12295 @Override 12296 public Quantifier quantifier() { 12297 return quantifier; 12298 } 12299 } 12300 12301 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 12302 NAME, 12303 List.of(Attribute.values()), 12304 List.of(TypeConstraint.values()), 12305 List.of(InputParameter.values()), 12306 List.of(OutputParameter.values()) 12307 ); 12308 12309 public Imputer(ExternalizedOp def) { 12310 super(SCHEMA, def); 12311 } 12312 12313 Imputer(Imputer that, CopyContext cc) { 12314 super(that, cc); 12315 } 12316 12317 @Override 12318 public Imputer transform(CopyContext cc, OpTransformer ot) { 12319 return new Imputer(this, cc); 12320 } 12321 12322 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) { 12323 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(replaced_value_int64, replaced_value_float, imputed_value_int64s, imputed_value_floats)); 12324 } 12325 12326 @Override 12327 public SequencedSet<OnnxParameter> onnxOutputs() { 12328 return onnxOutputs(SCHEMA); 12329 } 12330 12331 @Override 12332 public SequencedMap<OnnxParameter, Object> onnxInputs() { 12333 return onnxInputs(SCHEMA, List.of(X())); 12334 } 12335 12336 public Value X() { 12337 return operands().get(0); 12338 } 12339 12340 public java.util.Optional<Long> replaced_value_int64() { 12341 Long replaced_value_int64 = Attribute.replaced_value_int64.access(Long.class, onnxAttributes); 12342 return java.util.Optional.ofNullable(replaced_value_int64); 12343 } 12344 12345 public java.util.Optional<Float> replaced_value_float() { 12346 Float replaced_value_float = Attribute.replaced_value_float.access(Float.class, onnxAttributes); 12347 return java.util.Optional.ofNullable(replaced_value_float); 12348 } 12349 12350 public java.util.Optional<long[]> imputed_value_int64s() { 12351 long[] imputed_value_int64s = Attribute.imputed_value_int64s.access(long[].class, onnxAttributes); 12352 return java.util.Optional.ofNullable(imputed_value_int64s).map(long[]::clone); 12353 } 12354 12355 public java.util.Optional<float[]> imputed_value_floats() { 12356 float[] imputed_value_floats = Attribute.imputed_value_floats.access(float[].class, onnxAttributes); 12357 return java.util.Optional.ofNullable(imputed_value_floats).map(float[]::clone); 12358 } 12359 12360 } 12361 12362 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) { 12363 return new Imputer(resultType, X, replaced_value_int64, replaced_value_float, imputed_value_int64s, imputed_value_floats); 12364 } 12365 12366 @OpFactory.OpDeclaration(InstanceNormalization.NAME) 12367 public static final class InstanceNormalization extends OnnxOp { 12368 public static final String NAME = "InstanceNormalization"; 12369 12370 public enum Attribute implements OnnxAttribute { 12371 epsilon(Float.class, true, 1.0E-5f), 12372 ; 12373 12374 final Class<?> t; 12375 final boolean optional; 12376 final Object defaultValue; 12377 12378 Attribute(Class<?> type, boolean optional, Object defaultValue) { 12379 this.t = type; 12380 this.optional = optional; 12381 this.defaultValue = defaultValue; 12382 assert optional || defaultValue == null; 12383 } 12384 12385 public Class<?> type() { 12386 return t; 12387 } 12388 12389 public boolean isOptional() { 12390 return optional; 12391 } 12392 12393 public Object defaultValue() { 12394 return defaultValue; 12395 } 12396 } 12397 12398 public enum TypeConstraint implements OnnxTypeConstraint { 12399 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 12400 ; 12401 12402 final OnnxType.TypeVariable typeVariable; 12403 12404 TypeConstraint(OnnxType.TypeVariable typeVariable) { 12405 assert typeVariable.name().equals(name()); 12406 this.typeVariable = typeVariable; 12407 } 12408 12409 @Override 12410 public OnnxType.TypeVariable typeVariable() { 12411 return typeVariable; 12412 } 12413 } 12414 12415 public enum InputParameter implements OnnxParameter { 12416 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 12417 scale(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 12418 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 12419 ; 12420 12421 final OnnxType type; 12422 final Quantifier quantifier; 12423 12424 InputParameter(OnnxType type, Quantifier quantifier) { 12425 this.type = type; 12426 this.quantifier = quantifier; 12427 } 12428 12429 @Override 12430 public OnnxType type() { 12431 return type; 12432 } 12433 12434 @Override 12435 public Quantifier quantifier() { 12436 return quantifier; 12437 } 12438 } 12439 12440 public enum OutputParameter implements OnnxParameter { 12441 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 12442 ; 12443 12444 final OnnxType type; 12445 final Quantifier quantifier; 12446 12447 OutputParameter(OnnxType type, Quantifier quantifier) { 12448 this.type = type; 12449 this.quantifier = quantifier; 12450 } 12451 12452 @Override 12453 public OnnxType type() { 12454 return type; 12455 } 12456 12457 @Override 12458 public Quantifier quantifier() { 12459 return quantifier; 12460 } 12461 } 12462 12463 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 12464 NAME, 12465 List.of(Attribute.values()), 12466 List.of(TypeConstraint.values()), 12467 List.of(InputParameter.values()), 12468 List.of(OutputParameter.values()) 12469 ); 12470 12471 public InstanceNormalization(ExternalizedOp def) { 12472 super(SCHEMA, def); 12473 } 12474 12475 InstanceNormalization(InstanceNormalization that, CopyContext cc) { 12476 super(that, cc); 12477 } 12478 12479 @Override 12480 public InstanceNormalization transform(CopyContext cc, OpTransformer ot) { 12481 return new InstanceNormalization(this, cc); 12482 } 12483 12484 InstanceNormalization(TypeElement resultType, Value input, Value scale, Value B, java.util.Optional<Float> epsilon) { 12485 super(SCHEMA, resultType, Set.of(), List.of(input, scale, B), List.of(epsilon)); 12486 } 12487 12488 @Override 12489 public SequencedSet<OnnxParameter> onnxOutputs() { 12490 return onnxOutputs(SCHEMA); 12491 } 12492 12493 @Override 12494 public SequencedMap<OnnxParameter, Object> onnxInputs() { 12495 return onnxInputs(SCHEMA, List.of(input(), scale(), B())); 12496 } 12497 12498 public Value input() { 12499 return operands().get(0); 12500 } 12501 12502 public Value scale() { 12503 return operands().get(1); 12504 } 12505 12506 public Value B() { 12507 return operands().get(2); 12508 } 12509 12510 public java.util.Optional<Float> epsilon() { 12511 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes); 12512 return java.util.Optional.ofNullable(epsilon); 12513 } 12514 12515 } 12516 12517 public static InstanceNormalization InstanceNormalization(TypeElement resultType, Value input, Value scale, Value B, java.util.Optional<Float> epsilon) { 12518 return new InstanceNormalization(resultType, input, scale, B, epsilon); 12519 } 12520 12521 @OpFactory.OpDeclaration(IsInf.NAME) 12522 public static final class IsInf extends OnnxOp { 12523 public static final String NAME = "IsInf"; 12524 12525 public enum Attribute implements OnnxAttribute { 12526 detect_negative(Long.class, true, 1), 12527 detect_positive(Long.class, true, 1), 12528 ; 12529 12530 final Class<?> t; 12531 final boolean optional; 12532 final Object defaultValue; 12533 12534 Attribute(Class<?> type, boolean optional, Object defaultValue) { 12535 this.t = type; 12536 this.optional = optional; 12537 this.defaultValue = defaultValue; 12538 assert optional || defaultValue == null; 12539 } 12540 12541 public Class<?> type() { 12542 return t; 12543 } 12544 12545 public boolean isOptional() { 12546 return optional; 12547 } 12548 12549 public Object defaultValue() { 12550 return defaultValue; 12551 } 12552 } 12553 12554 public enum TypeConstraint implements OnnxTypeConstraint { 12555 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())))), 12556 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bool())))), 12557 ; 12558 12559 final OnnxType.TypeVariable typeVariable; 12560 12561 TypeConstraint(OnnxType.TypeVariable typeVariable) { 12562 assert typeVariable.name().equals(name()); 12563 this.typeVariable = typeVariable; 12564 } 12565 12566 @Override 12567 public OnnxType.TypeVariable typeVariable() { 12568 return typeVariable; 12569 } 12570 } 12571 12572 public enum InputParameter implements OnnxParameter { 12573 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 12574 ; 12575 12576 final OnnxType type; 12577 final Quantifier quantifier; 12578 12579 InputParameter(OnnxType type, Quantifier quantifier) { 12580 this.type = type; 12581 this.quantifier = quantifier; 12582 } 12583 12584 @Override 12585 public OnnxType type() { 12586 return type; 12587 } 12588 12589 @Override 12590 public Quantifier quantifier() { 12591 return quantifier; 12592 } 12593 } 12594 12595 public enum OutputParameter implements OnnxParameter { 12596 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 12597 ; 12598 12599 final OnnxType type; 12600 final Quantifier quantifier; 12601 12602 OutputParameter(OnnxType type, Quantifier quantifier) { 12603 this.type = type; 12604 this.quantifier = quantifier; 12605 } 12606 12607 @Override 12608 public OnnxType type() { 12609 return type; 12610 } 12611 12612 @Override 12613 public Quantifier quantifier() { 12614 return quantifier; 12615 } 12616 } 12617 12618 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 12619 NAME, 12620 List.of(Attribute.values()), 12621 List.of(TypeConstraint.values()), 12622 List.of(InputParameter.values()), 12623 List.of(OutputParameter.values()) 12624 ); 12625 12626 public IsInf(ExternalizedOp def) { 12627 super(SCHEMA, def); 12628 } 12629 12630 IsInf(IsInf that, CopyContext cc) { 12631 super(that, cc); 12632 } 12633 12634 @Override 12635 public IsInf transform(CopyContext cc, OpTransformer ot) { 12636 return new IsInf(this, cc); 12637 } 12638 12639 IsInf(TypeElement resultType, Value X, java.util.Optional<Long> detect_negative, java.util.Optional<Long> detect_positive) { 12640 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(detect_negative, detect_positive)); 12641 } 12642 12643 @Override 12644 public SequencedSet<OnnxParameter> onnxOutputs() { 12645 return onnxOutputs(SCHEMA); 12646 } 12647 12648 @Override 12649 public SequencedMap<OnnxParameter, Object> onnxInputs() { 12650 return onnxInputs(SCHEMA, List.of(X())); 12651 } 12652 12653 public Value X() { 12654 return operands().get(0); 12655 } 12656 12657 public java.util.Optional<Long> detect_negative() { 12658 Long detect_negative = Attribute.detect_negative.access(Long.class, onnxAttributes); 12659 return java.util.Optional.ofNullable(detect_negative); 12660 } 12661 12662 public java.util.Optional<Long> detect_positive() { 12663 Long detect_positive = Attribute.detect_positive.access(Long.class, onnxAttributes); 12664 return java.util.Optional.ofNullable(detect_positive); 12665 } 12666 12667 } 12668 12669 public static IsInf IsInf(TypeElement resultType, Value X, java.util.Optional<Long> detect_negative, java.util.Optional<Long> detect_positive) { 12670 return new IsInf(resultType, X, detect_negative, detect_positive); 12671 } 12672 12673 @OpFactory.OpDeclaration(IsNaN.NAME) 12674 public static final class IsNaN extends OnnxOp { 12675 public static final String NAME = "IsNaN"; 12676 12677 public enum Attribute implements OnnxAttribute.None { } 12678 12679 public enum TypeConstraint implements OnnxTypeConstraint { 12680 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())))), 12681 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bool())))), 12682 ; 12683 12684 final OnnxType.TypeVariable typeVariable; 12685 12686 TypeConstraint(OnnxType.TypeVariable typeVariable) { 12687 assert typeVariable.name().equals(name()); 12688 this.typeVariable = typeVariable; 12689 } 12690 12691 @Override 12692 public OnnxType.TypeVariable typeVariable() { 12693 return typeVariable; 12694 } 12695 } 12696 12697 public enum InputParameter implements OnnxParameter { 12698 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 12699 ; 12700 12701 final OnnxType type; 12702 final Quantifier quantifier; 12703 12704 InputParameter(OnnxType type, Quantifier quantifier) { 12705 this.type = type; 12706 this.quantifier = quantifier; 12707 } 12708 12709 @Override 12710 public OnnxType type() { 12711 return type; 12712 } 12713 12714 @Override 12715 public Quantifier quantifier() { 12716 return quantifier; 12717 } 12718 } 12719 12720 public enum OutputParameter implements OnnxParameter { 12721 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 12722 ; 12723 12724 final OnnxType type; 12725 final Quantifier quantifier; 12726 12727 OutputParameter(OnnxType type, Quantifier quantifier) { 12728 this.type = type; 12729 this.quantifier = quantifier; 12730 } 12731 12732 @Override 12733 public OnnxType type() { 12734 return type; 12735 } 12736 12737 @Override 12738 public Quantifier quantifier() { 12739 return quantifier; 12740 } 12741 } 12742 12743 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 12744 NAME, 12745 List.of(Attribute.values()), 12746 List.of(TypeConstraint.values()), 12747 List.of(InputParameter.values()), 12748 List.of(OutputParameter.values()) 12749 ); 12750 12751 public IsNaN(ExternalizedOp def) { 12752 super(SCHEMA, def); 12753 } 12754 12755 IsNaN(IsNaN that, CopyContext cc) { 12756 super(that, cc); 12757 } 12758 12759 @Override 12760 public IsNaN transform(CopyContext cc, OpTransformer ot) { 12761 return new IsNaN(this, cc); 12762 } 12763 12764 IsNaN(TypeElement resultType, Value X) { 12765 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 12766 } 12767 12768 @Override 12769 public SequencedSet<OnnxParameter> onnxOutputs() { 12770 return onnxOutputs(SCHEMA); 12771 } 12772 12773 @Override 12774 public SequencedMap<OnnxParameter, Object> onnxInputs() { 12775 return onnxInputs(SCHEMA, List.of(X())); 12776 } 12777 12778 public Value X() { 12779 return operands().get(0); 12780 } 12781 12782 } 12783 12784 public static IsNaN IsNaN(TypeElement resultType, Value X) { 12785 return new IsNaN(resultType, X); 12786 } 12787 12788 @OpFactory.OpDeclaration(LRN.NAME) 12789 public static final class LRN extends OnnxOp { 12790 public static final String NAME = "LRN"; 12791 12792 public enum Attribute implements OnnxAttribute { 12793 size(Long.class, false, null), 12794 alpha(Float.class, true, 1.0E-4f), 12795 bias(Float.class, true, 1.0f), 12796 beta(Float.class, true, 0.75f), 12797 ; 12798 12799 final Class<?> t; 12800 final boolean optional; 12801 final Object defaultValue; 12802 12803 Attribute(Class<?> type, boolean optional, Object defaultValue) { 12804 this.t = type; 12805 this.optional = optional; 12806 this.defaultValue = defaultValue; 12807 assert optional || defaultValue == null; 12808 } 12809 12810 public Class<?> type() { 12811 return t; 12812 } 12813 12814 public boolean isOptional() { 12815 return optional; 12816 } 12817 12818 public Object defaultValue() { 12819 return defaultValue; 12820 } 12821 } 12822 12823 public enum TypeConstraint implements OnnxTypeConstraint { 12824 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 12825 ; 12826 12827 final OnnxType.TypeVariable typeVariable; 12828 12829 TypeConstraint(OnnxType.TypeVariable typeVariable) { 12830 assert typeVariable.name().equals(name()); 12831 this.typeVariable = typeVariable; 12832 } 12833 12834 @Override 12835 public OnnxType.TypeVariable typeVariable() { 12836 return typeVariable; 12837 } 12838 } 12839 12840 public enum InputParameter implements OnnxParameter { 12841 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 12842 ; 12843 12844 final OnnxType type; 12845 final Quantifier quantifier; 12846 12847 InputParameter(OnnxType type, Quantifier quantifier) { 12848 this.type = type; 12849 this.quantifier = quantifier; 12850 } 12851 12852 @Override 12853 public OnnxType type() { 12854 return type; 12855 } 12856 12857 @Override 12858 public Quantifier quantifier() { 12859 return quantifier; 12860 } 12861 } 12862 12863 public enum OutputParameter implements OnnxParameter { 12864 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 12865 ; 12866 12867 final OnnxType type; 12868 final Quantifier quantifier; 12869 12870 OutputParameter(OnnxType type, Quantifier quantifier) { 12871 this.type = type; 12872 this.quantifier = quantifier; 12873 } 12874 12875 @Override 12876 public OnnxType type() { 12877 return type; 12878 } 12879 12880 @Override 12881 public Quantifier quantifier() { 12882 return quantifier; 12883 } 12884 } 12885 12886 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 12887 NAME, 12888 List.of(Attribute.values()), 12889 List.of(TypeConstraint.values()), 12890 List.of(InputParameter.values()), 12891 List.of(OutputParameter.values()) 12892 ); 12893 12894 public LRN(ExternalizedOp def) { 12895 super(SCHEMA, def); 12896 } 12897 12898 LRN(LRN that, CopyContext cc) { 12899 super(that, cc); 12900 } 12901 12902 @Override 12903 public LRN transform(CopyContext cc, OpTransformer ot) { 12904 return new LRN(this, cc); 12905 } 12906 12907 LRN(TypeElement resultType, Value X, long size, java.util.Optional<Float> alpha, java.util.Optional<Float> bias, java.util.Optional<Float> beta) { 12908 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(size, alpha, bias, beta)); 12909 } 12910 12911 @Override 12912 public SequencedSet<OnnxParameter> onnxOutputs() { 12913 return onnxOutputs(SCHEMA); 12914 } 12915 12916 @Override 12917 public SequencedMap<OnnxParameter, Object> onnxInputs() { 12918 return onnxInputs(SCHEMA, List.of(X())); 12919 } 12920 12921 public Value X() { 12922 return operands().get(0); 12923 } 12924 12925 public long size() { 12926 long size = Attribute.size.access(Long.class, onnxAttributes); 12927 return size; 12928 } 12929 12930 public java.util.Optional<Float> alpha() { 12931 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 12932 return java.util.Optional.ofNullable(alpha); 12933 } 12934 12935 public java.util.Optional<Float> bias() { 12936 Float bias = Attribute.bias.access(Float.class, onnxAttributes); 12937 return java.util.Optional.ofNullable(bias); 12938 } 12939 12940 public java.util.Optional<Float> beta() { 12941 Float beta = Attribute.beta.access(Float.class, onnxAttributes); 12942 return java.util.Optional.ofNullable(beta); 12943 } 12944 12945 } 12946 12947 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) { 12948 return new LRN(resultType, X, size, alpha, bias, beta); 12949 } 12950 12951 @OpFactory.OpDeclaration(LSTM.NAME) 12952 public static final class LSTM extends OnnxOp { 12953 public static final String NAME = "LSTM"; 12954 12955 public enum Attribute implements OnnxAttribute { 12956 layout(Long.class, true, 0), 12957 input_forget(Long.class, true, 0), 12958 activation_alpha(float[].class, true, null), 12959 hidden_size(Long.class, true, null), 12960 activation_beta(float[].class, true, null), 12961 activations(String[].class, true, null), 12962 clip(Float.class, true, null), 12963 direction(String.class, true, "forward"), 12964 ; 12965 12966 final Class<?> t; 12967 final boolean optional; 12968 final Object defaultValue; 12969 12970 Attribute(Class<?> type, boolean optional, Object defaultValue) { 12971 this.t = type; 12972 this.optional = optional; 12973 this.defaultValue = defaultValue; 12974 assert optional || defaultValue == null; 12975 } 12976 12977 public Class<?> type() { 12978 return t; 12979 } 12980 12981 public boolean isOptional() { 12982 return optional; 12983 } 12984 12985 public Object defaultValue() { 12986 return defaultValue; 12987 } 12988 } 12989 12990 public enum TypeConstraint implements OnnxTypeConstraint { 12991 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 12992 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32())))), 12993 ; 12994 12995 final OnnxType.TypeVariable typeVariable; 12996 12997 TypeConstraint(OnnxType.TypeVariable typeVariable) { 12998 assert typeVariable.name().equals(name()); 12999 this.typeVariable = typeVariable; 13000 } 13001 13002 @Override 13003 public OnnxType.TypeVariable typeVariable() { 13004 return typeVariable; 13005 } 13006 } 13007 13008 public enum InputParameter implements OnnxParameter { 13009 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13010 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13011 R(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13012 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 13013 sequence_lens(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL), 13014 initial_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 13015 initial_c(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 13016 P(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 13017 ; 13018 13019 final OnnxType type; 13020 final Quantifier quantifier; 13021 13022 InputParameter(OnnxType type, Quantifier quantifier) { 13023 this.type = type; 13024 this.quantifier = quantifier; 13025 } 13026 13027 @Override 13028 public OnnxType type() { 13029 return type; 13030 } 13031 13032 @Override 13033 public Quantifier quantifier() { 13034 return quantifier; 13035 } 13036 } 13037 13038 public enum OutputParameter implements OnnxParameter { 13039 Y(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 13040 Y_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 13041 Y_c(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 13042 ; 13043 13044 final OnnxType type; 13045 final Quantifier quantifier; 13046 13047 OutputParameter(OnnxType type, Quantifier quantifier) { 13048 this.type = type; 13049 this.quantifier = quantifier; 13050 } 13051 13052 @Override 13053 public OnnxType type() { 13054 return type; 13055 } 13056 13057 @Override 13058 public Quantifier quantifier() { 13059 return quantifier; 13060 } 13061 } 13062 13063 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 13064 NAME, 13065 List.of(Attribute.values()), 13066 List.of(TypeConstraint.values()), 13067 List.of(InputParameter.values()), 13068 List.of(OutputParameter.values()) 13069 ); 13070 13071 public LSTM(ExternalizedOp def) { 13072 super(SCHEMA, def); 13073 } 13074 13075 LSTM(LSTM that, CopyContext cc) { 13076 super(that, cc); 13077 } 13078 13079 @Override 13080 public LSTM transform(CopyContext cc, OpTransformer ot) { 13081 return new LSTM(this, cc); 13082 } 13083 13084 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) { 13085 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)); 13086 } 13087 13088 @Override 13089 public SequencedSet<OnnxParameter> onnxOutputs() { 13090 return onnxOutputs(SCHEMA); 13091 } 13092 13093 @Override 13094 public SequencedMap<OnnxParameter, Object> onnxInputs() { 13095 return onnxInputs(SCHEMA, List.of(X(), W(), R(), B(), sequence_lens(), initial_h(), initial_c(), P())); 13096 } 13097 13098 public Value X() { 13099 return operands().get(0); 13100 } 13101 13102 public Value W() { 13103 return operands().get(1); 13104 } 13105 13106 public Value R() { 13107 return operands().get(2); 13108 } 13109 13110 public java.util.Optional<Value> B() { 13111 int i = optionalInputArguments.indexOf(InputParameter.B); 13112 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 13113 } 13114 13115 public java.util.Optional<Value> sequence_lens() { 13116 int i = optionalInputArguments.indexOf(InputParameter.sequence_lens); 13117 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 13118 } 13119 13120 public java.util.Optional<Value> initial_h() { 13121 int i = optionalInputArguments.indexOf(InputParameter.initial_h); 13122 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 13123 } 13124 13125 public java.util.Optional<Value> initial_c() { 13126 int i = optionalInputArguments.indexOf(InputParameter.initial_c); 13127 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 13128 } 13129 13130 public java.util.Optional<Value> P() { 13131 int i = optionalInputArguments.indexOf(InputParameter.P); 13132 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 13133 } 13134 13135 public java.util.Optional<Long> layout() { 13136 Long layout = Attribute.layout.access(Long.class, onnxAttributes); 13137 return java.util.Optional.ofNullable(layout); 13138 } 13139 13140 public java.util.Optional<Long> input_forget() { 13141 Long input_forget = Attribute.input_forget.access(Long.class, onnxAttributes); 13142 return java.util.Optional.ofNullable(input_forget); 13143 } 13144 13145 public java.util.Optional<float[]> activation_alpha() { 13146 float[] activation_alpha = Attribute.activation_alpha.access(float[].class, onnxAttributes); 13147 return java.util.Optional.ofNullable(activation_alpha).map(float[]::clone); 13148 } 13149 13150 public java.util.Optional<Long> hidden_size() { 13151 Long hidden_size = Attribute.hidden_size.access(Long.class, onnxAttributes); 13152 return java.util.Optional.ofNullable(hidden_size); 13153 } 13154 13155 public java.util.Optional<float[]> activation_beta() { 13156 float[] activation_beta = Attribute.activation_beta.access(float[].class, onnxAttributes); 13157 return java.util.Optional.ofNullable(activation_beta).map(float[]::clone); 13158 } 13159 13160 public java.util.Optional<String[]> activations() { 13161 String[] activations = Attribute.activations.access(String[].class, onnxAttributes); 13162 return java.util.Optional.ofNullable(activations).map(String[]::clone); 13163 } 13164 13165 public java.util.Optional<Float> clip() { 13166 Float clip = Attribute.clip.access(Float.class, onnxAttributes); 13167 return java.util.Optional.ofNullable(clip); 13168 } 13169 13170 public java.util.Optional<String> direction() { 13171 String direction = Attribute.direction.access(String.class, onnxAttributes); 13172 return java.util.Optional.ofNullable(direction); 13173 } 13174 13175 } 13176 13177 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) { 13178 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); 13179 } 13180 13181 @OpFactory.OpDeclaration(LabelEncoder.NAME) 13182 public static final class LabelEncoder extends OnnxOp { 13183 public static final String NAME = "LabelEncoder"; 13184 13185 public enum Attribute implements OnnxAttribute { 13186 values_strings(String[].class, true, null), 13187 keys_int64s(long[].class, true, null), 13188 keys_tensor(Tensor.class, true, null), 13189 keys_strings(String[].class, true, null), 13190 default_float(Float.class, true, -0.0f), 13191 keys_floats(float[].class, true, null), 13192 default_tensor(Tensor.class, true, null), 13193 default_int64(Long.class, true, -1), 13194 values_tensor(Tensor.class, true, null), 13195 values_int64s(long[].class, true, null), 13196 default_string(String.class, true, "_Unused"), 13197 values_floats(float[].class, true, null), 13198 ; 13199 13200 final Class<?> t; 13201 final boolean optional; 13202 final Object defaultValue; 13203 13204 Attribute(Class<?> type, boolean optional, Object defaultValue) { 13205 this.t = type; 13206 this.optional = optional; 13207 this.defaultValue = defaultValue; 13208 assert optional || defaultValue == null; 13209 } 13210 13211 public Class<?> type() { 13212 return t; 13213 } 13214 13215 public boolean isOptional() { 13216 return optional; 13217 } 13218 13219 public Object defaultValue() { 13220 return defaultValue; 13221 } 13222 } 13223 13224 public enum TypeConstraint implements OnnxTypeConstraint { 13225 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())))), 13226 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())))), 13227 ; 13228 13229 final OnnxType.TypeVariable typeVariable; 13230 13231 TypeConstraint(OnnxType.TypeVariable typeVariable) { 13232 assert typeVariable.name().equals(name()); 13233 this.typeVariable = typeVariable; 13234 } 13235 13236 @Override 13237 public OnnxType.TypeVariable typeVariable() { 13238 return typeVariable; 13239 } 13240 } 13241 13242 public enum InputParameter implements OnnxParameter { 13243 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 13244 ; 13245 13246 final OnnxType type; 13247 final Quantifier quantifier; 13248 13249 InputParameter(OnnxType type, Quantifier quantifier) { 13250 this.type = type; 13251 this.quantifier = quantifier; 13252 } 13253 13254 @Override 13255 public OnnxType type() { 13256 return type; 13257 } 13258 13259 @Override 13260 public Quantifier quantifier() { 13261 return quantifier; 13262 } 13263 } 13264 13265 public enum OutputParameter implements OnnxParameter { 13266 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 13267 ; 13268 13269 final OnnxType type; 13270 final Quantifier quantifier; 13271 13272 OutputParameter(OnnxType type, Quantifier quantifier) { 13273 this.type = type; 13274 this.quantifier = quantifier; 13275 } 13276 13277 @Override 13278 public OnnxType type() { 13279 return type; 13280 } 13281 13282 @Override 13283 public Quantifier quantifier() { 13284 return quantifier; 13285 } 13286 } 13287 13288 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 13289 NAME, 13290 List.of(Attribute.values()), 13291 List.of(TypeConstraint.values()), 13292 List.of(InputParameter.values()), 13293 List.of(OutputParameter.values()) 13294 ); 13295 13296 public LabelEncoder(ExternalizedOp def) { 13297 super(SCHEMA, def); 13298 } 13299 13300 LabelEncoder(LabelEncoder that, CopyContext cc) { 13301 super(that, cc); 13302 } 13303 13304 @Override 13305 public LabelEncoder transform(CopyContext cc, OpTransformer ot) { 13306 return new LabelEncoder(this, cc); 13307 } 13308 13309 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) { 13310 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)); 13311 } 13312 13313 @Override 13314 public SequencedSet<OnnxParameter> onnxOutputs() { 13315 return onnxOutputs(SCHEMA); 13316 } 13317 13318 @Override 13319 public SequencedMap<OnnxParameter, Object> onnxInputs() { 13320 return onnxInputs(SCHEMA, List.of(X())); 13321 } 13322 13323 public Value X() { 13324 return operands().get(0); 13325 } 13326 13327 public java.util.Optional<String[]> values_strings() { 13328 String[] values_strings = Attribute.values_strings.access(String[].class, onnxAttributes); 13329 return java.util.Optional.ofNullable(values_strings).map(String[]::clone); 13330 } 13331 13332 public java.util.Optional<long[]> keys_int64s() { 13333 long[] keys_int64s = Attribute.keys_int64s.access(long[].class, onnxAttributes); 13334 return java.util.Optional.ofNullable(keys_int64s).map(long[]::clone); 13335 } 13336 13337 public java.util.Optional<Tensor> keys_tensor() { 13338 Tensor keys_tensor = Attribute.keys_tensor.access(Tensor.class, onnxAttributes); 13339 return java.util.Optional.ofNullable(keys_tensor); 13340 } 13341 13342 public java.util.Optional<String[]> keys_strings() { 13343 String[] keys_strings = Attribute.keys_strings.access(String[].class, onnxAttributes); 13344 return java.util.Optional.ofNullable(keys_strings).map(String[]::clone); 13345 } 13346 13347 public java.util.Optional<Float> default_float() { 13348 Float default_float = Attribute.default_float.access(Float.class, onnxAttributes); 13349 return java.util.Optional.ofNullable(default_float); 13350 } 13351 13352 public java.util.Optional<float[]> keys_floats() { 13353 float[] keys_floats = Attribute.keys_floats.access(float[].class, onnxAttributes); 13354 return java.util.Optional.ofNullable(keys_floats).map(float[]::clone); 13355 } 13356 13357 public java.util.Optional<Tensor> default_tensor() { 13358 Tensor default_tensor = Attribute.default_tensor.access(Tensor.class, onnxAttributes); 13359 return java.util.Optional.ofNullable(default_tensor); 13360 } 13361 13362 public java.util.Optional<Long> default_int64() { 13363 Long default_int64 = Attribute.default_int64.access(Long.class, onnxAttributes); 13364 return java.util.Optional.ofNullable(default_int64); 13365 } 13366 13367 public java.util.Optional<Tensor> values_tensor() { 13368 Tensor values_tensor = Attribute.values_tensor.access(Tensor.class, onnxAttributes); 13369 return java.util.Optional.ofNullable(values_tensor); 13370 } 13371 13372 public java.util.Optional<long[]> values_int64s() { 13373 long[] values_int64s = Attribute.values_int64s.access(long[].class, onnxAttributes); 13374 return java.util.Optional.ofNullable(values_int64s).map(long[]::clone); 13375 } 13376 13377 public java.util.Optional<String> default_string() { 13378 String default_string = Attribute.default_string.access(String.class, onnxAttributes); 13379 return java.util.Optional.ofNullable(default_string); 13380 } 13381 13382 public java.util.Optional<float[]> values_floats() { 13383 float[] values_floats = Attribute.values_floats.access(float[].class, onnxAttributes); 13384 return java.util.Optional.ofNullable(values_floats).map(float[]::clone); 13385 } 13386 13387 } 13388 13389 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) { 13390 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); 13391 } 13392 13393 @OpFactory.OpDeclaration(LayerNormalization.NAME) 13394 public static final class LayerNormalization extends OnnxOp { 13395 public static final String NAME = "LayerNormalization"; 13396 13397 public enum Attribute implements OnnxAttribute { 13398 epsilon(Float.class, true, 1.0E-5f), 13399 stash_type(Long.class, true, 1), 13400 axis(Long.class, true, -1), 13401 ; 13402 13403 final Class<?> t; 13404 final boolean optional; 13405 final Object defaultValue; 13406 13407 Attribute(Class<?> type, boolean optional, Object defaultValue) { 13408 this.t = type; 13409 this.optional = optional; 13410 this.defaultValue = defaultValue; 13411 assert optional || defaultValue == null; 13412 } 13413 13414 public Class<?> type() { 13415 return t; 13416 } 13417 13418 public boolean isOptional() { 13419 return optional; 13420 } 13421 13422 public Object defaultValue() { 13423 return defaultValue; 13424 } 13425 } 13426 13427 public enum TypeConstraint implements OnnxTypeConstraint { 13428 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 13429 U(new OnnxType.TypeVariable("U", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.bfloat16())))), 13430 ; 13431 13432 final OnnxType.TypeVariable typeVariable; 13433 13434 TypeConstraint(OnnxType.TypeVariable typeVariable) { 13435 assert typeVariable.name().equals(name()); 13436 this.typeVariable = typeVariable; 13437 } 13438 13439 @Override 13440 public OnnxType.TypeVariable typeVariable() { 13441 return typeVariable; 13442 } 13443 } 13444 13445 public enum InputParameter implements OnnxParameter { 13446 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13447 Scale(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13448 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 13449 ; 13450 13451 final OnnxType type; 13452 final Quantifier quantifier; 13453 13454 InputParameter(OnnxType type, Quantifier quantifier) { 13455 this.type = type; 13456 this.quantifier = quantifier; 13457 } 13458 13459 @Override 13460 public OnnxType type() { 13461 return type; 13462 } 13463 13464 @Override 13465 public Quantifier quantifier() { 13466 return quantifier; 13467 } 13468 } 13469 13470 public enum OutputParameter implements OnnxParameter { 13471 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13472 Mean(TypeConstraint.U.typeVariable(), Quantifier.OPTIONAL), 13473 InvStdDev(TypeConstraint.U.typeVariable(), Quantifier.OPTIONAL), 13474 ; 13475 13476 final OnnxType type; 13477 final Quantifier quantifier; 13478 13479 OutputParameter(OnnxType type, Quantifier quantifier) { 13480 this.type = type; 13481 this.quantifier = quantifier; 13482 } 13483 13484 @Override 13485 public OnnxType type() { 13486 return type; 13487 } 13488 13489 @Override 13490 public Quantifier quantifier() { 13491 return quantifier; 13492 } 13493 } 13494 13495 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 13496 NAME, 13497 List.of(Attribute.values()), 13498 List.of(TypeConstraint.values()), 13499 List.of(InputParameter.values()), 13500 List.of(OutputParameter.values()) 13501 ); 13502 13503 public LayerNormalization(ExternalizedOp def) { 13504 super(SCHEMA, def); 13505 } 13506 13507 LayerNormalization(LayerNormalization that, CopyContext cc) { 13508 super(that, cc); 13509 } 13510 13511 @Override 13512 public LayerNormalization transform(CopyContext cc, OpTransformer ot) { 13513 return new LayerNormalization(this, cc); 13514 } 13515 13516 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) { 13517 super(SCHEMA, resultType, optionalOutputs, List.of(X, Scale, B), List.of(epsilon, stash_type, axis)); 13518 } 13519 13520 @Override 13521 public SequencedSet<OnnxParameter> onnxOutputs() { 13522 return onnxOutputs(SCHEMA); 13523 } 13524 13525 @Override 13526 public SequencedMap<OnnxParameter, Object> onnxInputs() { 13527 return onnxInputs(SCHEMA, List.of(X(), Scale(), B())); 13528 } 13529 13530 public Value X() { 13531 return operands().get(0); 13532 } 13533 13534 public Value Scale() { 13535 return operands().get(1); 13536 } 13537 13538 public java.util.Optional<Value> B() { 13539 int i = optionalInputArguments.indexOf(InputParameter.B); 13540 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 13541 } 13542 13543 public java.util.Optional<Float> epsilon() { 13544 Float epsilon = Attribute.epsilon.access(Float.class, onnxAttributes); 13545 return java.util.Optional.ofNullable(epsilon); 13546 } 13547 13548 public java.util.Optional<Long> stash_type() { 13549 Long stash_type = Attribute.stash_type.access(Long.class, onnxAttributes); 13550 return java.util.Optional.ofNullable(stash_type); 13551 } 13552 13553 public java.util.Optional<Long> axis() { 13554 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 13555 return java.util.Optional.ofNullable(axis); 13556 } 13557 13558 } 13559 13560 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) { 13561 return new LayerNormalization(resultType, optionalOutputs, X, Scale, B, epsilon, stash_type, axis); 13562 } 13563 13564 @OpFactory.OpDeclaration(LeakyRelu.NAME) 13565 public static final class LeakyRelu extends OnnxOp { 13566 public static final String NAME = "LeakyRelu"; 13567 13568 public enum Attribute implements OnnxAttribute { 13569 alpha(Float.class, true, 0.01f), 13570 ; 13571 13572 final Class<?> t; 13573 final boolean optional; 13574 final Object defaultValue; 13575 13576 Attribute(Class<?> type, boolean optional, Object defaultValue) { 13577 this.t = type; 13578 this.optional = optional; 13579 this.defaultValue = defaultValue; 13580 assert optional || defaultValue == null; 13581 } 13582 13583 public Class<?> type() { 13584 return t; 13585 } 13586 13587 public boolean isOptional() { 13588 return optional; 13589 } 13590 13591 public Object defaultValue() { 13592 return defaultValue; 13593 } 13594 } 13595 13596 public enum TypeConstraint implements OnnxTypeConstraint { 13597 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 13598 ; 13599 13600 final OnnxType.TypeVariable typeVariable; 13601 13602 TypeConstraint(OnnxType.TypeVariable typeVariable) { 13603 assert typeVariable.name().equals(name()); 13604 this.typeVariable = typeVariable; 13605 } 13606 13607 @Override 13608 public OnnxType.TypeVariable typeVariable() { 13609 return typeVariable; 13610 } 13611 } 13612 13613 public enum InputParameter implements OnnxParameter { 13614 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13615 ; 13616 13617 final OnnxType type; 13618 final Quantifier quantifier; 13619 13620 InputParameter(OnnxType type, Quantifier quantifier) { 13621 this.type = type; 13622 this.quantifier = quantifier; 13623 } 13624 13625 @Override 13626 public OnnxType type() { 13627 return type; 13628 } 13629 13630 @Override 13631 public Quantifier quantifier() { 13632 return quantifier; 13633 } 13634 } 13635 13636 public enum OutputParameter implements OnnxParameter { 13637 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13638 ; 13639 13640 final OnnxType type; 13641 final Quantifier quantifier; 13642 13643 OutputParameter(OnnxType type, Quantifier quantifier) { 13644 this.type = type; 13645 this.quantifier = quantifier; 13646 } 13647 13648 @Override 13649 public OnnxType type() { 13650 return type; 13651 } 13652 13653 @Override 13654 public Quantifier quantifier() { 13655 return quantifier; 13656 } 13657 } 13658 13659 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 13660 NAME, 13661 List.of(Attribute.values()), 13662 List.of(TypeConstraint.values()), 13663 List.of(InputParameter.values()), 13664 List.of(OutputParameter.values()) 13665 ); 13666 13667 public LeakyRelu(ExternalizedOp def) { 13668 super(SCHEMA, def); 13669 } 13670 13671 LeakyRelu(LeakyRelu that, CopyContext cc) { 13672 super(that, cc); 13673 } 13674 13675 @Override 13676 public LeakyRelu transform(CopyContext cc, OpTransformer ot) { 13677 return new LeakyRelu(this, cc); 13678 } 13679 13680 LeakyRelu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) { 13681 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha)); 13682 } 13683 13684 @Override 13685 public SequencedSet<OnnxParameter> onnxOutputs() { 13686 return onnxOutputs(SCHEMA); 13687 } 13688 13689 @Override 13690 public SequencedMap<OnnxParameter, Object> onnxInputs() { 13691 return onnxInputs(SCHEMA, List.of(X())); 13692 } 13693 13694 public Value X() { 13695 return operands().get(0); 13696 } 13697 13698 public java.util.Optional<Float> alpha() { 13699 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 13700 return java.util.Optional.ofNullable(alpha); 13701 } 13702 13703 } 13704 13705 public static LeakyRelu LeakyRelu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) { 13706 return new LeakyRelu(resultType, X, alpha); 13707 } 13708 13709 @OpFactory.OpDeclaration(Less.NAME) 13710 public static final class Less extends OnnxOp { 13711 public static final String NAME = "Less"; 13712 13713 public enum Attribute implements OnnxAttribute.None { } 13714 13715 public enum TypeConstraint implements OnnxTypeConstraint { 13716 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())))), 13717 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))), 13718 ; 13719 13720 final OnnxType.TypeVariable typeVariable; 13721 13722 TypeConstraint(OnnxType.TypeVariable typeVariable) { 13723 assert typeVariable.name().equals(name()); 13724 this.typeVariable = typeVariable; 13725 } 13726 13727 @Override 13728 public OnnxType.TypeVariable typeVariable() { 13729 return typeVariable; 13730 } 13731 } 13732 13733 public enum InputParameter implements OnnxParameter { 13734 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13735 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13736 ; 13737 13738 final OnnxType type; 13739 final Quantifier quantifier; 13740 13741 InputParameter(OnnxType type, Quantifier quantifier) { 13742 this.type = type; 13743 this.quantifier = quantifier; 13744 } 13745 13746 @Override 13747 public OnnxType type() { 13748 return type; 13749 } 13750 13751 @Override 13752 public Quantifier quantifier() { 13753 return quantifier; 13754 } 13755 } 13756 13757 public enum OutputParameter implements OnnxParameter { 13758 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 13759 ; 13760 13761 final OnnxType type; 13762 final Quantifier quantifier; 13763 13764 OutputParameter(OnnxType type, Quantifier quantifier) { 13765 this.type = type; 13766 this.quantifier = quantifier; 13767 } 13768 13769 @Override 13770 public OnnxType type() { 13771 return type; 13772 } 13773 13774 @Override 13775 public Quantifier quantifier() { 13776 return quantifier; 13777 } 13778 } 13779 13780 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 13781 NAME, 13782 List.of(Attribute.values()), 13783 List.of(TypeConstraint.values()), 13784 List.of(InputParameter.values()), 13785 List.of(OutputParameter.values()) 13786 ); 13787 13788 public Less(ExternalizedOp def) { 13789 super(SCHEMA, def); 13790 } 13791 13792 Less(Less that, CopyContext cc) { 13793 super(that, cc); 13794 } 13795 13796 @Override 13797 public Less transform(CopyContext cc, OpTransformer ot) { 13798 return new Less(this, cc); 13799 } 13800 13801 Less(TypeElement resultType, Value A, Value B) { 13802 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 13803 } 13804 13805 @Override 13806 public SequencedSet<OnnxParameter> onnxOutputs() { 13807 return onnxOutputs(SCHEMA); 13808 } 13809 13810 @Override 13811 public SequencedMap<OnnxParameter, Object> onnxInputs() { 13812 return onnxInputs(SCHEMA, List.of(A(), B())); 13813 } 13814 13815 public Value A() { 13816 return operands().get(0); 13817 } 13818 13819 public Value B() { 13820 return operands().get(1); 13821 } 13822 13823 } 13824 13825 public static Less Less(TypeElement resultType, Value A, Value B) { 13826 return new Less(resultType, A, B); 13827 } 13828 13829 @OpFactory.OpDeclaration(LessOrEqual.NAME) 13830 public static final class LessOrEqual extends OnnxOp { 13831 public static final String NAME = "LessOrEqual"; 13832 13833 public enum Attribute implements OnnxAttribute.None { } 13834 13835 public enum TypeConstraint implements OnnxTypeConstraint { 13836 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())))), 13837 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))), 13838 ; 13839 13840 final OnnxType.TypeVariable typeVariable; 13841 13842 TypeConstraint(OnnxType.TypeVariable typeVariable) { 13843 assert typeVariable.name().equals(name()); 13844 this.typeVariable = typeVariable; 13845 } 13846 13847 @Override 13848 public OnnxType.TypeVariable typeVariable() { 13849 return typeVariable; 13850 } 13851 } 13852 13853 public enum InputParameter implements OnnxParameter { 13854 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13855 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 13856 ; 13857 13858 final OnnxType type; 13859 final Quantifier quantifier; 13860 13861 InputParameter(OnnxType type, Quantifier quantifier) { 13862 this.type = type; 13863 this.quantifier = quantifier; 13864 } 13865 13866 @Override 13867 public OnnxType type() { 13868 return type; 13869 } 13870 13871 @Override 13872 public Quantifier quantifier() { 13873 return quantifier; 13874 } 13875 } 13876 13877 public enum OutputParameter implements OnnxParameter { 13878 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 13879 ; 13880 13881 final OnnxType type; 13882 final Quantifier quantifier; 13883 13884 OutputParameter(OnnxType type, Quantifier quantifier) { 13885 this.type = type; 13886 this.quantifier = quantifier; 13887 } 13888 13889 @Override 13890 public OnnxType type() { 13891 return type; 13892 } 13893 13894 @Override 13895 public Quantifier quantifier() { 13896 return quantifier; 13897 } 13898 } 13899 13900 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 13901 NAME, 13902 List.of(Attribute.values()), 13903 List.of(TypeConstraint.values()), 13904 List.of(InputParameter.values()), 13905 List.of(OutputParameter.values()) 13906 ); 13907 13908 public LessOrEqual(ExternalizedOp def) { 13909 super(SCHEMA, def); 13910 } 13911 13912 LessOrEqual(LessOrEqual that, CopyContext cc) { 13913 super(that, cc); 13914 } 13915 13916 @Override 13917 public LessOrEqual transform(CopyContext cc, OpTransformer ot) { 13918 return new LessOrEqual(this, cc); 13919 } 13920 13921 LessOrEqual(TypeElement resultType, Value A, Value B) { 13922 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 13923 } 13924 13925 @Override 13926 public SequencedSet<OnnxParameter> onnxOutputs() { 13927 return onnxOutputs(SCHEMA); 13928 } 13929 13930 @Override 13931 public SequencedMap<OnnxParameter, Object> onnxInputs() { 13932 return onnxInputs(SCHEMA, List.of(A(), B())); 13933 } 13934 13935 public Value A() { 13936 return operands().get(0); 13937 } 13938 13939 public Value B() { 13940 return operands().get(1); 13941 } 13942 13943 } 13944 13945 public static LessOrEqual LessOrEqual(TypeElement resultType, Value A, Value B) { 13946 return new LessOrEqual(resultType, A, B); 13947 } 13948 13949 @OpFactory.OpDeclaration(LinearClassifier.NAME) 13950 public static final class LinearClassifier extends OnnxOp { 13951 public static final String NAME = "LinearClassifier"; 13952 13953 public enum Attribute implements OnnxAttribute { 13954 classlabels_ints(long[].class, true, null), 13955 post_transform(String.class, true, "NONE"), 13956 coefficients(float[].class, false, null), 13957 multi_class(Long.class, true, 0), 13958 intercepts(float[].class, true, null), 13959 classlabels_strings(String[].class, true, null), 13960 ; 13961 13962 final Class<?> t; 13963 final boolean optional; 13964 final Object defaultValue; 13965 13966 Attribute(Class<?> type, boolean optional, Object defaultValue) { 13967 this.t = type; 13968 this.optional = optional; 13969 this.defaultValue = defaultValue; 13970 assert optional || defaultValue == null; 13971 } 13972 13973 public Class<?> type() { 13974 return t; 13975 } 13976 13977 public boolean isOptional() { 13978 return optional; 13979 } 13980 13981 public Object defaultValue() { 13982 return defaultValue; 13983 } 13984 } 13985 13986 public enum TypeConstraint implements OnnxTypeConstraint { 13987 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 13988 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))), 13989 ; 13990 13991 final OnnxType.TypeVariable typeVariable; 13992 13993 TypeConstraint(OnnxType.TypeVariable typeVariable) { 13994 assert typeVariable.name().equals(name()); 13995 this.typeVariable = typeVariable; 13996 } 13997 13998 @Override 13999 public OnnxType.TypeVariable typeVariable() { 14000 return typeVariable; 14001 } 14002 } 14003 14004 public enum InputParameter implements OnnxParameter { 14005 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 14006 ; 14007 14008 final OnnxType type; 14009 final Quantifier quantifier; 14010 14011 InputParameter(OnnxType type, Quantifier quantifier) { 14012 this.type = type; 14013 this.quantifier = quantifier; 14014 } 14015 14016 @Override 14017 public OnnxType type() { 14018 return type; 14019 } 14020 14021 @Override 14022 public Quantifier quantifier() { 14023 return quantifier; 14024 } 14025 } 14026 14027 public enum OutputParameter implements OnnxParameter { 14028 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 14029 Z(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 14030 ; 14031 14032 final OnnxType type; 14033 final Quantifier quantifier; 14034 14035 OutputParameter(OnnxType type, Quantifier quantifier) { 14036 this.type = type; 14037 this.quantifier = quantifier; 14038 } 14039 14040 @Override 14041 public OnnxType type() { 14042 return type; 14043 } 14044 14045 @Override 14046 public Quantifier quantifier() { 14047 return quantifier; 14048 } 14049 } 14050 14051 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 14052 NAME, 14053 List.of(Attribute.values()), 14054 List.of(TypeConstraint.values()), 14055 List.of(InputParameter.values()), 14056 List.of(OutputParameter.values()) 14057 ); 14058 14059 public LinearClassifier(ExternalizedOp def) { 14060 super(SCHEMA, def); 14061 } 14062 14063 LinearClassifier(LinearClassifier that, CopyContext cc) { 14064 super(that, cc); 14065 } 14066 14067 @Override 14068 public LinearClassifier transform(CopyContext cc, OpTransformer ot) { 14069 return new LinearClassifier(this, cc); 14070 } 14071 14072 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) { 14073 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(classlabels_ints, post_transform, coefficients, multi_class, intercepts, classlabels_strings)); 14074 } 14075 14076 @Override 14077 public SequencedSet<OnnxParameter> onnxOutputs() { 14078 return onnxOutputs(SCHEMA); 14079 } 14080 14081 @Override 14082 public SequencedMap<OnnxParameter, Object> onnxInputs() { 14083 return onnxInputs(SCHEMA, List.of(X())); 14084 } 14085 14086 public Value X() { 14087 return operands().get(0); 14088 } 14089 14090 public java.util.Optional<long[]> classlabels_ints() { 14091 long[] classlabels_ints = Attribute.classlabels_ints.access(long[].class, onnxAttributes); 14092 return java.util.Optional.ofNullable(classlabels_ints).map(long[]::clone); 14093 } 14094 14095 public java.util.Optional<String> post_transform() { 14096 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes); 14097 return java.util.Optional.ofNullable(post_transform); 14098 } 14099 14100 public float[] coefficients() { 14101 float[] coefficients = Attribute.coefficients.access(float[].class, onnxAttributes); 14102 return coefficients.clone(); 14103 } 14104 14105 public java.util.Optional<Long> multi_class() { 14106 Long multi_class = Attribute.multi_class.access(Long.class, onnxAttributes); 14107 return java.util.Optional.ofNullable(multi_class); 14108 } 14109 14110 public java.util.Optional<float[]> intercepts() { 14111 float[] intercepts = Attribute.intercepts.access(float[].class, onnxAttributes); 14112 return java.util.Optional.ofNullable(intercepts).map(float[]::clone); 14113 } 14114 14115 public java.util.Optional<String[]> classlabels_strings() { 14116 String[] classlabels_strings = Attribute.classlabels_strings.access(String[].class, onnxAttributes); 14117 return java.util.Optional.ofNullable(classlabels_strings).map(String[]::clone); 14118 } 14119 14120 } 14121 14122 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) { 14123 return new LinearClassifier(resultType, X, classlabels_ints, post_transform, coefficients, multi_class, intercepts, classlabels_strings); 14124 } 14125 14126 @OpFactory.OpDeclaration(LinearRegressor.NAME) 14127 public static final class LinearRegressor extends OnnxOp { 14128 public static final String NAME = "LinearRegressor"; 14129 14130 public enum Attribute implements OnnxAttribute { 14131 post_transform(String.class, true, "NONE"), 14132 coefficients(float[].class, true, null), 14133 targets(Long.class, true, 1), 14134 intercepts(float[].class, true, null), 14135 ; 14136 14137 final Class<?> t; 14138 final boolean optional; 14139 final Object defaultValue; 14140 14141 Attribute(Class<?> type, boolean optional, Object defaultValue) { 14142 this.t = type; 14143 this.optional = optional; 14144 this.defaultValue = defaultValue; 14145 assert optional || defaultValue == null; 14146 } 14147 14148 public Class<?> type() { 14149 return t; 14150 } 14151 14152 public boolean isOptional() { 14153 return optional; 14154 } 14155 14156 public Object defaultValue() { 14157 return defaultValue; 14158 } 14159 } 14160 14161 public enum TypeConstraint implements OnnxTypeConstraint { 14162 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 14163 ; 14164 14165 final OnnxType.TypeVariable typeVariable; 14166 14167 TypeConstraint(OnnxType.TypeVariable typeVariable) { 14168 assert typeVariable.name().equals(name()); 14169 this.typeVariable = typeVariable; 14170 } 14171 14172 @Override 14173 public OnnxType.TypeVariable typeVariable() { 14174 return typeVariable; 14175 } 14176 } 14177 14178 public enum InputParameter implements OnnxParameter { 14179 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14180 ; 14181 14182 final OnnxType type; 14183 final Quantifier quantifier; 14184 14185 InputParameter(OnnxType type, Quantifier quantifier) { 14186 this.type = type; 14187 this.quantifier = quantifier; 14188 } 14189 14190 @Override 14191 public OnnxType type() { 14192 return type; 14193 } 14194 14195 @Override 14196 public Quantifier quantifier() { 14197 return quantifier; 14198 } 14199 } 14200 14201 public enum OutputParameter implements OnnxParameter { 14202 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 14203 ; 14204 14205 final OnnxType type; 14206 final Quantifier quantifier; 14207 14208 OutputParameter(OnnxType type, Quantifier quantifier) { 14209 this.type = type; 14210 this.quantifier = quantifier; 14211 } 14212 14213 @Override 14214 public OnnxType type() { 14215 return type; 14216 } 14217 14218 @Override 14219 public Quantifier quantifier() { 14220 return quantifier; 14221 } 14222 } 14223 14224 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 14225 NAME, 14226 List.of(Attribute.values()), 14227 List.of(TypeConstraint.values()), 14228 List.of(InputParameter.values()), 14229 List.of(OutputParameter.values()) 14230 ); 14231 14232 public LinearRegressor(ExternalizedOp def) { 14233 super(SCHEMA, def); 14234 } 14235 14236 LinearRegressor(LinearRegressor that, CopyContext cc) { 14237 super(that, cc); 14238 } 14239 14240 @Override 14241 public LinearRegressor transform(CopyContext cc, OpTransformer ot) { 14242 return new LinearRegressor(this, cc); 14243 } 14244 14245 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) { 14246 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(post_transform, coefficients, targets, intercepts)); 14247 } 14248 14249 @Override 14250 public SequencedSet<OnnxParameter> onnxOutputs() { 14251 return onnxOutputs(SCHEMA); 14252 } 14253 14254 @Override 14255 public SequencedMap<OnnxParameter, Object> onnxInputs() { 14256 return onnxInputs(SCHEMA, List.of(X())); 14257 } 14258 14259 public Value X() { 14260 return operands().get(0); 14261 } 14262 14263 public java.util.Optional<String> post_transform() { 14264 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes); 14265 return java.util.Optional.ofNullable(post_transform); 14266 } 14267 14268 public java.util.Optional<float[]> coefficients() { 14269 float[] coefficients = Attribute.coefficients.access(float[].class, onnxAttributes); 14270 return java.util.Optional.ofNullable(coefficients).map(float[]::clone); 14271 } 14272 14273 public java.util.Optional<Long> targets() { 14274 Long targets = Attribute.targets.access(Long.class, onnxAttributes); 14275 return java.util.Optional.ofNullable(targets); 14276 } 14277 14278 public java.util.Optional<float[]> intercepts() { 14279 float[] intercepts = Attribute.intercepts.access(float[].class, onnxAttributes); 14280 return java.util.Optional.ofNullable(intercepts).map(float[]::clone); 14281 } 14282 14283 } 14284 14285 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) { 14286 return new LinearRegressor(resultType, X, post_transform, coefficients, targets, intercepts); 14287 } 14288 14289 @OpFactory.OpDeclaration(Log.NAME) 14290 public static final class Log extends OnnxOp { 14291 public static final String NAME = "Log"; 14292 14293 public enum Attribute implements OnnxAttribute.None { } 14294 14295 public enum TypeConstraint implements OnnxTypeConstraint { 14296 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 14297 ; 14298 14299 final OnnxType.TypeVariable typeVariable; 14300 14301 TypeConstraint(OnnxType.TypeVariable typeVariable) { 14302 assert typeVariable.name().equals(name()); 14303 this.typeVariable = typeVariable; 14304 } 14305 14306 @Override 14307 public OnnxType.TypeVariable typeVariable() { 14308 return typeVariable; 14309 } 14310 } 14311 14312 public enum InputParameter implements OnnxParameter { 14313 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14314 ; 14315 14316 final OnnxType type; 14317 final Quantifier quantifier; 14318 14319 InputParameter(OnnxType type, Quantifier quantifier) { 14320 this.type = type; 14321 this.quantifier = quantifier; 14322 } 14323 14324 @Override 14325 public OnnxType type() { 14326 return type; 14327 } 14328 14329 @Override 14330 public Quantifier quantifier() { 14331 return quantifier; 14332 } 14333 } 14334 14335 public enum OutputParameter implements OnnxParameter { 14336 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14337 ; 14338 14339 final OnnxType type; 14340 final Quantifier quantifier; 14341 14342 OutputParameter(OnnxType type, Quantifier quantifier) { 14343 this.type = type; 14344 this.quantifier = quantifier; 14345 } 14346 14347 @Override 14348 public OnnxType type() { 14349 return type; 14350 } 14351 14352 @Override 14353 public Quantifier quantifier() { 14354 return quantifier; 14355 } 14356 } 14357 14358 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 14359 NAME, 14360 List.of(Attribute.values()), 14361 List.of(TypeConstraint.values()), 14362 List.of(InputParameter.values()), 14363 List.of(OutputParameter.values()) 14364 ); 14365 14366 public Log(ExternalizedOp def) { 14367 super(SCHEMA, def); 14368 } 14369 14370 Log(Log that, CopyContext cc) { 14371 super(that, cc); 14372 } 14373 14374 @Override 14375 public Log transform(CopyContext cc, OpTransformer ot) { 14376 return new Log(this, cc); 14377 } 14378 14379 Log(TypeElement resultType, Value input) { 14380 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 14381 } 14382 14383 @Override 14384 public SequencedSet<OnnxParameter> onnxOutputs() { 14385 return onnxOutputs(SCHEMA); 14386 } 14387 14388 @Override 14389 public SequencedMap<OnnxParameter, Object> onnxInputs() { 14390 return onnxInputs(SCHEMA, List.of(input())); 14391 } 14392 14393 public Value input() { 14394 return operands().get(0); 14395 } 14396 14397 } 14398 14399 public static Log Log(TypeElement resultType, Value input) { 14400 return new Log(resultType, input); 14401 } 14402 14403 @OpFactory.OpDeclaration(LogSoftmax.NAME) 14404 public static final class LogSoftmax extends OnnxOp { 14405 public static final String NAME = "LogSoftmax"; 14406 14407 public enum Attribute implements OnnxAttribute { 14408 axis(Long.class, true, -1), 14409 ; 14410 14411 final Class<?> t; 14412 final boolean optional; 14413 final Object defaultValue; 14414 14415 Attribute(Class<?> type, boolean optional, Object defaultValue) { 14416 this.t = type; 14417 this.optional = optional; 14418 this.defaultValue = defaultValue; 14419 assert optional || defaultValue == null; 14420 } 14421 14422 public Class<?> type() { 14423 return t; 14424 } 14425 14426 public boolean isOptional() { 14427 return optional; 14428 } 14429 14430 public Object defaultValue() { 14431 return defaultValue; 14432 } 14433 } 14434 14435 public enum TypeConstraint implements OnnxTypeConstraint { 14436 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 14437 ; 14438 14439 final OnnxType.TypeVariable typeVariable; 14440 14441 TypeConstraint(OnnxType.TypeVariable typeVariable) { 14442 assert typeVariable.name().equals(name()); 14443 this.typeVariable = typeVariable; 14444 } 14445 14446 @Override 14447 public OnnxType.TypeVariable typeVariable() { 14448 return typeVariable; 14449 } 14450 } 14451 14452 public enum InputParameter implements OnnxParameter { 14453 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14454 ; 14455 14456 final OnnxType type; 14457 final Quantifier quantifier; 14458 14459 InputParameter(OnnxType type, Quantifier quantifier) { 14460 this.type = type; 14461 this.quantifier = quantifier; 14462 } 14463 14464 @Override 14465 public OnnxType type() { 14466 return type; 14467 } 14468 14469 @Override 14470 public Quantifier quantifier() { 14471 return quantifier; 14472 } 14473 } 14474 14475 public enum OutputParameter implements OnnxParameter { 14476 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14477 ; 14478 14479 final OnnxType type; 14480 final Quantifier quantifier; 14481 14482 OutputParameter(OnnxType type, Quantifier quantifier) { 14483 this.type = type; 14484 this.quantifier = quantifier; 14485 } 14486 14487 @Override 14488 public OnnxType type() { 14489 return type; 14490 } 14491 14492 @Override 14493 public Quantifier quantifier() { 14494 return quantifier; 14495 } 14496 } 14497 14498 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 14499 NAME, 14500 List.of(Attribute.values()), 14501 List.of(TypeConstraint.values()), 14502 List.of(InputParameter.values()), 14503 List.of(OutputParameter.values()) 14504 ); 14505 14506 public LogSoftmax(ExternalizedOp def) { 14507 super(SCHEMA, def); 14508 } 14509 14510 LogSoftmax(LogSoftmax that, CopyContext cc) { 14511 super(that, cc); 14512 } 14513 14514 @Override 14515 public LogSoftmax transform(CopyContext cc, OpTransformer ot) { 14516 return new LogSoftmax(this, cc); 14517 } 14518 14519 LogSoftmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) { 14520 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(axis)); 14521 } 14522 14523 @Override 14524 public SequencedSet<OnnxParameter> onnxOutputs() { 14525 return onnxOutputs(SCHEMA); 14526 } 14527 14528 @Override 14529 public SequencedMap<OnnxParameter, Object> onnxInputs() { 14530 return onnxInputs(SCHEMA, List.of(input())); 14531 } 14532 14533 public Value input() { 14534 return operands().get(0); 14535 } 14536 14537 public java.util.Optional<Long> axis() { 14538 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 14539 return java.util.Optional.ofNullable(axis); 14540 } 14541 14542 } 14543 14544 public static LogSoftmax LogSoftmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) { 14545 return new LogSoftmax(resultType, input, axis); 14546 } 14547 14548 @OpFactory.OpDeclaration(LpNormalization.NAME) 14549 public static final class LpNormalization extends OnnxOp { 14550 public static final String NAME = "LpNormalization"; 14551 14552 public enum Attribute implements OnnxAttribute { 14553 p(Long.class, true, 2), 14554 axis(Long.class, true, -1), 14555 ; 14556 14557 final Class<?> t; 14558 final boolean optional; 14559 final Object defaultValue; 14560 14561 Attribute(Class<?> type, boolean optional, Object defaultValue) { 14562 this.t = type; 14563 this.optional = optional; 14564 this.defaultValue = defaultValue; 14565 assert optional || defaultValue == null; 14566 } 14567 14568 public Class<?> type() { 14569 return t; 14570 } 14571 14572 public boolean isOptional() { 14573 return optional; 14574 } 14575 14576 public Object defaultValue() { 14577 return defaultValue; 14578 } 14579 } 14580 14581 public enum TypeConstraint implements OnnxTypeConstraint { 14582 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 14583 ; 14584 14585 final OnnxType.TypeVariable typeVariable; 14586 14587 TypeConstraint(OnnxType.TypeVariable typeVariable) { 14588 assert typeVariable.name().equals(name()); 14589 this.typeVariable = typeVariable; 14590 } 14591 14592 @Override 14593 public OnnxType.TypeVariable typeVariable() { 14594 return typeVariable; 14595 } 14596 } 14597 14598 public enum InputParameter implements OnnxParameter { 14599 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14600 ; 14601 14602 final OnnxType type; 14603 final Quantifier quantifier; 14604 14605 InputParameter(OnnxType type, Quantifier quantifier) { 14606 this.type = type; 14607 this.quantifier = quantifier; 14608 } 14609 14610 @Override 14611 public OnnxType type() { 14612 return type; 14613 } 14614 14615 @Override 14616 public Quantifier quantifier() { 14617 return quantifier; 14618 } 14619 } 14620 14621 public enum OutputParameter implements OnnxParameter { 14622 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14623 ; 14624 14625 final OnnxType type; 14626 final Quantifier quantifier; 14627 14628 OutputParameter(OnnxType type, Quantifier quantifier) { 14629 this.type = type; 14630 this.quantifier = quantifier; 14631 } 14632 14633 @Override 14634 public OnnxType type() { 14635 return type; 14636 } 14637 14638 @Override 14639 public Quantifier quantifier() { 14640 return quantifier; 14641 } 14642 } 14643 14644 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 14645 NAME, 14646 List.of(Attribute.values()), 14647 List.of(TypeConstraint.values()), 14648 List.of(InputParameter.values()), 14649 List.of(OutputParameter.values()) 14650 ); 14651 14652 public LpNormalization(ExternalizedOp def) { 14653 super(SCHEMA, def); 14654 } 14655 14656 LpNormalization(LpNormalization that, CopyContext cc) { 14657 super(that, cc); 14658 } 14659 14660 @Override 14661 public LpNormalization transform(CopyContext cc, OpTransformer ot) { 14662 return new LpNormalization(this, cc); 14663 } 14664 14665 LpNormalization(TypeElement resultType, Value input, java.util.Optional<Long> p, java.util.Optional<Long> axis) { 14666 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(p, axis)); 14667 } 14668 14669 @Override 14670 public SequencedSet<OnnxParameter> onnxOutputs() { 14671 return onnxOutputs(SCHEMA); 14672 } 14673 14674 @Override 14675 public SequencedMap<OnnxParameter, Object> onnxInputs() { 14676 return onnxInputs(SCHEMA, List.of(input())); 14677 } 14678 14679 public Value input() { 14680 return operands().get(0); 14681 } 14682 14683 public java.util.Optional<Long> p() { 14684 Long p = Attribute.p.access(Long.class, onnxAttributes); 14685 return java.util.Optional.ofNullable(p); 14686 } 14687 14688 public java.util.Optional<Long> axis() { 14689 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 14690 return java.util.Optional.ofNullable(axis); 14691 } 14692 14693 } 14694 14695 public static LpNormalization LpNormalization(TypeElement resultType, Value input, java.util.Optional<Long> p, java.util.Optional<Long> axis) { 14696 return new LpNormalization(resultType, input, p, axis); 14697 } 14698 14699 @OpFactory.OpDeclaration(LpPool.NAME) 14700 public static final class LpPool extends OnnxOp { 14701 public static final String NAME = "LpPool"; 14702 14703 public enum Attribute implements OnnxAttribute { 14704 p(Long.class, true, 2), 14705 pads(long[].class, true, null), 14706 dilations(long[].class, true, null), 14707 auto_pad(String.class, true, "NOTSET"), 14708 ceil_mode(Long.class, true, 0), 14709 strides(long[].class, true, null), 14710 kernel_shape(long[].class, false, null), 14711 ; 14712 14713 final Class<?> t; 14714 final boolean optional; 14715 final Object defaultValue; 14716 14717 Attribute(Class<?> type, boolean optional, Object defaultValue) { 14718 this.t = type; 14719 this.optional = optional; 14720 this.defaultValue = defaultValue; 14721 assert optional || defaultValue == null; 14722 } 14723 14724 public Class<?> type() { 14725 return t; 14726 } 14727 14728 public boolean isOptional() { 14729 return optional; 14730 } 14731 14732 public Object defaultValue() { 14733 return defaultValue; 14734 } 14735 } 14736 14737 public enum TypeConstraint implements OnnxTypeConstraint { 14738 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 14739 ; 14740 14741 final OnnxType.TypeVariable typeVariable; 14742 14743 TypeConstraint(OnnxType.TypeVariable typeVariable) { 14744 assert typeVariable.name().equals(name()); 14745 this.typeVariable = typeVariable; 14746 } 14747 14748 @Override 14749 public OnnxType.TypeVariable typeVariable() { 14750 return typeVariable; 14751 } 14752 } 14753 14754 public enum InputParameter implements OnnxParameter { 14755 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14756 ; 14757 14758 final OnnxType type; 14759 final Quantifier quantifier; 14760 14761 InputParameter(OnnxType type, Quantifier quantifier) { 14762 this.type = type; 14763 this.quantifier = quantifier; 14764 } 14765 14766 @Override 14767 public OnnxType type() { 14768 return type; 14769 } 14770 14771 @Override 14772 public Quantifier quantifier() { 14773 return quantifier; 14774 } 14775 } 14776 14777 public enum OutputParameter implements OnnxParameter { 14778 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14779 ; 14780 14781 final OnnxType type; 14782 final Quantifier quantifier; 14783 14784 OutputParameter(OnnxType type, Quantifier quantifier) { 14785 this.type = type; 14786 this.quantifier = quantifier; 14787 } 14788 14789 @Override 14790 public OnnxType type() { 14791 return type; 14792 } 14793 14794 @Override 14795 public Quantifier quantifier() { 14796 return quantifier; 14797 } 14798 } 14799 14800 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 14801 NAME, 14802 List.of(Attribute.values()), 14803 List.of(TypeConstraint.values()), 14804 List.of(InputParameter.values()), 14805 List.of(OutputParameter.values()) 14806 ); 14807 14808 public LpPool(ExternalizedOp def) { 14809 super(SCHEMA, def); 14810 } 14811 14812 LpPool(LpPool that, CopyContext cc) { 14813 super(that, cc); 14814 } 14815 14816 @Override 14817 public LpPool transform(CopyContext cc, OpTransformer ot) { 14818 return new LpPool(this, cc); 14819 } 14820 14821 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) { 14822 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(p, pads, dilations, auto_pad, ceil_mode, strides, kernel_shape)); 14823 } 14824 14825 @Override 14826 public SequencedSet<OnnxParameter> onnxOutputs() { 14827 return onnxOutputs(SCHEMA); 14828 } 14829 14830 @Override 14831 public SequencedMap<OnnxParameter, Object> onnxInputs() { 14832 return onnxInputs(SCHEMA, List.of(X())); 14833 } 14834 14835 public Value X() { 14836 return operands().get(0); 14837 } 14838 14839 public java.util.Optional<Long> p() { 14840 Long p = Attribute.p.access(Long.class, onnxAttributes); 14841 return java.util.Optional.ofNullable(p); 14842 } 14843 14844 public java.util.Optional<long[]> pads() { 14845 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 14846 return java.util.Optional.ofNullable(pads).map(long[]::clone); 14847 } 14848 14849 public java.util.Optional<long[]> dilations() { 14850 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 14851 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 14852 } 14853 14854 public java.util.Optional<String> auto_pad() { 14855 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes); 14856 return java.util.Optional.ofNullable(auto_pad); 14857 } 14858 14859 public java.util.Optional<Long> ceil_mode() { 14860 Long ceil_mode = Attribute.ceil_mode.access(Long.class, onnxAttributes); 14861 return java.util.Optional.ofNullable(ceil_mode); 14862 } 14863 14864 public java.util.Optional<long[]> strides() { 14865 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 14866 return java.util.Optional.ofNullable(strides).map(long[]::clone); 14867 } 14868 14869 public long[] kernel_shape() { 14870 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 14871 return kernel_shape.clone(); 14872 } 14873 14874 } 14875 14876 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) { 14877 return new LpPool(resultType, X, p, pads, dilations, auto_pad, ceil_mode, strides, kernel_shape); 14878 } 14879 14880 @OpFactory.OpDeclaration(MatMul.NAME) 14881 public static final class MatMul extends OnnxOp { 14882 public static final String NAME = "MatMul"; 14883 14884 public enum Attribute implements OnnxAttribute.None { } 14885 14886 public enum TypeConstraint implements OnnxTypeConstraint { 14887 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())))), 14888 ; 14889 14890 final OnnxType.TypeVariable typeVariable; 14891 14892 TypeConstraint(OnnxType.TypeVariable typeVariable) { 14893 assert typeVariable.name().equals(name()); 14894 this.typeVariable = typeVariable; 14895 } 14896 14897 @Override 14898 public OnnxType.TypeVariable typeVariable() { 14899 return typeVariable; 14900 } 14901 } 14902 14903 public enum InputParameter implements OnnxParameter { 14904 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14905 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14906 ; 14907 14908 final OnnxType type; 14909 final Quantifier quantifier; 14910 14911 InputParameter(OnnxType type, Quantifier quantifier) { 14912 this.type = type; 14913 this.quantifier = quantifier; 14914 } 14915 14916 @Override 14917 public OnnxType type() { 14918 return type; 14919 } 14920 14921 @Override 14922 public Quantifier quantifier() { 14923 return quantifier; 14924 } 14925 } 14926 14927 public enum OutputParameter implements OnnxParameter { 14928 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 14929 ; 14930 14931 final OnnxType type; 14932 final Quantifier quantifier; 14933 14934 OutputParameter(OnnxType type, Quantifier quantifier) { 14935 this.type = type; 14936 this.quantifier = quantifier; 14937 } 14938 14939 @Override 14940 public OnnxType type() { 14941 return type; 14942 } 14943 14944 @Override 14945 public Quantifier quantifier() { 14946 return quantifier; 14947 } 14948 } 14949 14950 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 14951 NAME, 14952 List.of(Attribute.values()), 14953 List.of(TypeConstraint.values()), 14954 List.of(InputParameter.values()), 14955 List.of(OutputParameter.values()) 14956 ); 14957 14958 public MatMul(ExternalizedOp def) { 14959 super(SCHEMA, def); 14960 } 14961 14962 MatMul(MatMul that, CopyContext cc) { 14963 super(that, cc); 14964 } 14965 14966 @Override 14967 public MatMul transform(CopyContext cc, OpTransformer ot) { 14968 return new MatMul(this, cc); 14969 } 14970 14971 MatMul(TypeElement resultType, Value A, Value B) { 14972 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 14973 } 14974 14975 @Override 14976 public SequencedSet<OnnxParameter> onnxOutputs() { 14977 return onnxOutputs(SCHEMA); 14978 } 14979 14980 @Override 14981 public SequencedMap<OnnxParameter, Object> onnxInputs() { 14982 return onnxInputs(SCHEMA, List.of(A(), B())); 14983 } 14984 14985 public Value A() { 14986 return operands().get(0); 14987 } 14988 14989 public Value B() { 14990 return operands().get(1); 14991 } 14992 14993 } 14994 14995 public static MatMul MatMul(TypeElement resultType, Value A, Value B) { 14996 return new MatMul(resultType, A, B); 14997 } 14998 14999 @OpFactory.OpDeclaration(MatMulInteger.NAME) 15000 public static final class MatMulInteger extends OnnxOp { 15001 public static final String NAME = "MatMulInteger"; 15002 15003 public enum Attribute implements OnnxAttribute.None { } 15004 15005 public enum TypeConstraint implements OnnxTypeConstraint { 15006 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))), 15007 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))), 15008 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int32())))), 15009 ; 15010 15011 final OnnxType.TypeVariable typeVariable; 15012 15013 TypeConstraint(OnnxType.TypeVariable typeVariable) { 15014 assert typeVariable.name().equals(name()); 15015 this.typeVariable = typeVariable; 15016 } 15017 15018 @Override 15019 public OnnxType.TypeVariable typeVariable() { 15020 return typeVariable; 15021 } 15022 } 15023 15024 public enum InputParameter implements OnnxParameter { 15025 A(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 15026 B(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 15027 a_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL), 15028 b_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 15029 ; 15030 15031 final OnnxType type; 15032 final Quantifier quantifier; 15033 15034 InputParameter(OnnxType type, Quantifier quantifier) { 15035 this.type = type; 15036 this.quantifier = quantifier; 15037 } 15038 15039 @Override 15040 public OnnxType type() { 15041 return type; 15042 } 15043 15044 @Override 15045 public Quantifier quantifier() { 15046 return quantifier; 15047 } 15048 } 15049 15050 public enum OutputParameter implements OnnxParameter { 15051 Y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 15052 ; 15053 15054 final OnnxType type; 15055 final Quantifier quantifier; 15056 15057 OutputParameter(OnnxType type, Quantifier quantifier) { 15058 this.type = type; 15059 this.quantifier = quantifier; 15060 } 15061 15062 @Override 15063 public OnnxType type() { 15064 return type; 15065 } 15066 15067 @Override 15068 public Quantifier quantifier() { 15069 return quantifier; 15070 } 15071 } 15072 15073 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 15074 NAME, 15075 List.of(Attribute.values()), 15076 List.of(TypeConstraint.values()), 15077 List.of(InputParameter.values()), 15078 List.of(OutputParameter.values()) 15079 ); 15080 15081 public MatMulInteger(ExternalizedOp def) { 15082 super(SCHEMA, def); 15083 } 15084 15085 MatMulInteger(MatMulInteger that, CopyContext cc) { 15086 super(that, cc); 15087 } 15088 15089 @Override 15090 public MatMulInteger transform(CopyContext cc, OpTransformer ot) { 15091 return new MatMulInteger(this, cc); 15092 } 15093 15094 MatMulInteger(TypeElement resultType, Value A, Value B, java.util.Optional<Value> a_zero_point, java.util.Optional<Value> b_zero_point) { 15095 super(SCHEMA, resultType, Set.of(), List.of(A, B, a_zero_point, b_zero_point), List.of()); 15096 } 15097 15098 @Override 15099 public SequencedSet<OnnxParameter> onnxOutputs() { 15100 return onnxOutputs(SCHEMA); 15101 } 15102 15103 @Override 15104 public SequencedMap<OnnxParameter, Object> onnxInputs() { 15105 return onnxInputs(SCHEMA, List.of(A(), B(), a_zero_point(), b_zero_point())); 15106 } 15107 15108 public Value A() { 15109 return operands().get(0); 15110 } 15111 15112 public Value B() { 15113 return operands().get(1); 15114 } 15115 15116 public java.util.Optional<Value> a_zero_point() { 15117 int i = optionalInputArguments.indexOf(InputParameter.a_zero_point); 15118 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 15119 } 15120 15121 public java.util.Optional<Value> b_zero_point() { 15122 int i = optionalInputArguments.indexOf(InputParameter.b_zero_point); 15123 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 15124 } 15125 15126 } 15127 15128 public static MatMulInteger MatMulInteger(TypeElement resultType, Value A, Value B, java.util.Optional<Value> a_zero_point, java.util.Optional<Value> b_zero_point) { 15129 return new MatMulInteger(resultType, A, B, a_zero_point, b_zero_point); 15130 } 15131 15132 @OpFactory.OpDeclaration(Max.NAME) 15133 public static final class Max extends OnnxOp { 15134 public static final String NAME = "Max"; 15135 15136 public enum Attribute implements OnnxAttribute.None { } 15137 15138 public enum TypeConstraint implements OnnxTypeConstraint { 15139 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())))), 15140 ; 15141 15142 final OnnxType.TypeVariable typeVariable; 15143 15144 TypeConstraint(OnnxType.TypeVariable typeVariable) { 15145 assert typeVariable.name().equals(name()); 15146 this.typeVariable = typeVariable; 15147 } 15148 15149 @Override 15150 public OnnxType.TypeVariable typeVariable() { 15151 return typeVariable; 15152 } 15153 } 15154 15155 public enum InputParameter implements OnnxParameter { 15156 data_0(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC), 15157 ; 15158 15159 final OnnxType type; 15160 final Quantifier quantifier; 15161 15162 InputParameter(OnnxType type, Quantifier quantifier) { 15163 this.type = type; 15164 this.quantifier = quantifier; 15165 } 15166 15167 @Override 15168 public OnnxType type() { 15169 return type; 15170 } 15171 15172 @Override 15173 public Quantifier quantifier() { 15174 return quantifier; 15175 } 15176 } 15177 15178 public enum OutputParameter implements OnnxParameter { 15179 max(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15180 ; 15181 15182 final OnnxType type; 15183 final Quantifier quantifier; 15184 15185 OutputParameter(OnnxType type, Quantifier quantifier) { 15186 this.type = type; 15187 this.quantifier = quantifier; 15188 } 15189 15190 @Override 15191 public OnnxType type() { 15192 return type; 15193 } 15194 15195 @Override 15196 public Quantifier quantifier() { 15197 return quantifier; 15198 } 15199 } 15200 15201 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 15202 NAME, 15203 List.of(Attribute.values()), 15204 List.of(TypeConstraint.values()), 15205 List.of(InputParameter.values()), 15206 List.of(OutputParameter.values()) 15207 ); 15208 15209 public Max(ExternalizedOp def) { 15210 super(SCHEMA, def); 15211 } 15212 15213 Max(Max that, CopyContext cc) { 15214 super(that, cc); 15215 } 15216 15217 @Override 15218 public Max transform(CopyContext cc, OpTransformer ot) { 15219 return new Max(this, cc); 15220 } 15221 15222 Max(TypeElement resultType, List<Value> data_0) { 15223 super(SCHEMA, resultType, Set.of(), List.of(data_0), List.of()); 15224 } 15225 15226 @Override 15227 public SequencedSet<OnnxParameter> onnxOutputs() { 15228 return onnxOutputs(SCHEMA); 15229 } 15230 15231 @Override 15232 public SequencedMap<OnnxParameter, Object> onnxInputs() { 15233 return onnxInputs(SCHEMA, List.of(data_0())); 15234 } 15235 15236 public List<Value> data_0() { 15237 return operands(); 15238 } 15239 15240 } 15241 15242 public static Max Max(TypeElement resultType, List<Value> data_0) { 15243 return new Max(resultType, data_0); 15244 } 15245 15246 @OpFactory.OpDeclaration(MaxPool.NAME) 15247 public static final class MaxPool extends OnnxOp { 15248 public static final String NAME = "MaxPool"; 15249 15250 public enum Attribute implements OnnxAttribute { 15251 pads(long[].class, true, null), 15252 dilations(long[].class, true, null), 15253 auto_pad(String.class, true, "NOTSET"), 15254 ceil_mode(Long.class, true, 0), 15255 storage_order(Long.class, true, 0), 15256 strides(long[].class, true, null), 15257 kernel_shape(long[].class, false, null), 15258 ; 15259 15260 final Class<?> t; 15261 final boolean optional; 15262 final Object defaultValue; 15263 15264 Attribute(Class<?> type, boolean optional, Object defaultValue) { 15265 this.t = type; 15266 this.optional = optional; 15267 this.defaultValue = defaultValue; 15268 assert optional || defaultValue == null; 15269 } 15270 15271 public Class<?> type() { 15272 return t; 15273 } 15274 15275 public boolean isOptional() { 15276 return optional; 15277 } 15278 15279 public Object defaultValue() { 15280 return defaultValue; 15281 } 15282 } 15283 15284 public enum TypeConstraint implements OnnxTypeConstraint { 15285 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())))), 15286 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int64())))), 15287 ; 15288 15289 final OnnxType.TypeVariable typeVariable; 15290 15291 TypeConstraint(OnnxType.TypeVariable typeVariable) { 15292 assert typeVariable.name().equals(name()); 15293 this.typeVariable = typeVariable; 15294 } 15295 15296 @Override 15297 public OnnxType.TypeVariable typeVariable() { 15298 return typeVariable; 15299 } 15300 } 15301 15302 public enum InputParameter implements OnnxParameter { 15303 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15304 ; 15305 15306 final OnnxType type; 15307 final Quantifier quantifier; 15308 15309 InputParameter(OnnxType type, Quantifier quantifier) { 15310 this.type = type; 15311 this.quantifier = quantifier; 15312 } 15313 15314 @Override 15315 public OnnxType type() { 15316 return type; 15317 } 15318 15319 @Override 15320 public Quantifier quantifier() { 15321 return quantifier; 15322 } 15323 } 15324 15325 public enum OutputParameter implements OnnxParameter { 15326 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15327 Indices(TypeConstraint.I.typeVariable(), Quantifier.OPTIONAL), 15328 ; 15329 15330 final OnnxType type; 15331 final Quantifier quantifier; 15332 15333 OutputParameter(OnnxType type, Quantifier quantifier) { 15334 this.type = type; 15335 this.quantifier = quantifier; 15336 } 15337 15338 @Override 15339 public OnnxType type() { 15340 return type; 15341 } 15342 15343 @Override 15344 public Quantifier quantifier() { 15345 return quantifier; 15346 } 15347 } 15348 15349 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 15350 NAME, 15351 List.of(Attribute.values()), 15352 List.of(TypeConstraint.values()), 15353 List.of(InputParameter.values()), 15354 List.of(OutputParameter.values()) 15355 ); 15356 15357 public MaxPool(ExternalizedOp def) { 15358 super(SCHEMA, def); 15359 } 15360 15361 MaxPool(MaxPool that, CopyContext cc) { 15362 super(that, cc); 15363 } 15364 15365 @Override 15366 public MaxPool transform(CopyContext cc, OpTransformer ot) { 15367 return new MaxPool(this, cc); 15368 } 15369 15370 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) { 15371 super(SCHEMA, resultType, optionalOutputs, List.of(X), List.of(pads, dilations, auto_pad, ceil_mode, storage_order, strides, kernel_shape)); 15372 } 15373 15374 @Override 15375 public SequencedSet<OnnxParameter> onnxOutputs() { 15376 return onnxOutputs(SCHEMA); 15377 } 15378 15379 @Override 15380 public SequencedMap<OnnxParameter, Object> onnxInputs() { 15381 return onnxInputs(SCHEMA, List.of(X())); 15382 } 15383 15384 public Value X() { 15385 return operands().get(0); 15386 } 15387 15388 public java.util.Optional<long[]> pads() { 15389 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 15390 return java.util.Optional.ofNullable(pads).map(long[]::clone); 15391 } 15392 15393 public java.util.Optional<long[]> dilations() { 15394 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 15395 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 15396 } 15397 15398 public java.util.Optional<String> auto_pad() { 15399 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes); 15400 return java.util.Optional.ofNullable(auto_pad); 15401 } 15402 15403 public java.util.Optional<Long> ceil_mode() { 15404 Long ceil_mode = Attribute.ceil_mode.access(Long.class, onnxAttributes); 15405 return java.util.Optional.ofNullable(ceil_mode); 15406 } 15407 15408 public java.util.Optional<Long> storage_order() { 15409 Long storage_order = Attribute.storage_order.access(Long.class, onnxAttributes); 15410 return java.util.Optional.ofNullable(storage_order); 15411 } 15412 15413 public java.util.Optional<long[]> strides() { 15414 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 15415 return java.util.Optional.ofNullable(strides).map(long[]::clone); 15416 } 15417 15418 public long[] kernel_shape() { 15419 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 15420 return kernel_shape.clone(); 15421 } 15422 15423 } 15424 15425 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) { 15426 return new MaxPool(resultType, optionalOutputs, X, pads, dilations, auto_pad, ceil_mode, storage_order, strides, kernel_shape); 15427 } 15428 15429 @OpFactory.OpDeclaration(MaxRoiPool.NAME) 15430 public static final class MaxRoiPool extends OnnxOp { 15431 public static final String NAME = "MaxRoiPool"; 15432 15433 public enum Attribute implements OnnxAttribute { 15434 spatial_scale(Float.class, true, 1.0f), 15435 pooled_shape(long[].class, false, null), 15436 ; 15437 15438 final Class<?> t; 15439 final boolean optional; 15440 final Object defaultValue; 15441 15442 Attribute(Class<?> type, boolean optional, Object defaultValue) { 15443 this.t = type; 15444 this.optional = optional; 15445 this.defaultValue = defaultValue; 15446 assert optional || defaultValue == null; 15447 } 15448 15449 public Class<?> type() { 15450 return t; 15451 } 15452 15453 public boolean isOptional() { 15454 return optional; 15455 } 15456 15457 public Object defaultValue() { 15458 return defaultValue; 15459 } 15460 } 15461 15462 public enum TypeConstraint implements OnnxTypeConstraint { 15463 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 15464 ; 15465 15466 final OnnxType.TypeVariable typeVariable; 15467 15468 TypeConstraint(OnnxType.TypeVariable typeVariable) { 15469 assert typeVariable.name().equals(name()); 15470 this.typeVariable = typeVariable; 15471 } 15472 15473 @Override 15474 public OnnxType.TypeVariable typeVariable() { 15475 return typeVariable; 15476 } 15477 } 15478 15479 public enum InputParameter implements OnnxParameter { 15480 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15481 rois(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15482 ; 15483 15484 final OnnxType type; 15485 final Quantifier quantifier; 15486 15487 InputParameter(OnnxType type, Quantifier quantifier) { 15488 this.type = type; 15489 this.quantifier = quantifier; 15490 } 15491 15492 @Override 15493 public OnnxType type() { 15494 return type; 15495 } 15496 15497 @Override 15498 public Quantifier quantifier() { 15499 return quantifier; 15500 } 15501 } 15502 15503 public enum OutputParameter implements OnnxParameter { 15504 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15505 ; 15506 15507 final OnnxType type; 15508 final Quantifier quantifier; 15509 15510 OutputParameter(OnnxType type, Quantifier quantifier) { 15511 this.type = type; 15512 this.quantifier = quantifier; 15513 } 15514 15515 @Override 15516 public OnnxType type() { 15517 return type; 15518 } 15519 15520 @Override 15521 public Quantifier quantifier() { 15522 return quantifier; 15523 } 15524 } 15525 15526 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 15527 NAME, 15528 List.of(Attribute.values()), 15529 List.of(TypeConstraint.values()), 15530 List.of(InputParameter.values()), 15531 List.of(OutputParameter.values()) 15532 ); 15533 15534 public MaxRoiPool(ExternalizedOp def) { 15535 super(SCHEMA, def); 15536 } 15537 15538 MaxRoiPool(MaxRoiPool that, CopyContext cc) { 15539 super(that, cc); 15540 } 15541 15542 @Override 15543 public MaxRoiPool transform(CopyContext cc, OpTransformer ot) { 15544 return new MaxRoiPool(this, cc); 15545 } 15546 15547 MaxRoiPool(TypeElement resultType, Value X, Value rois, java.util.Optional<Float> spatial_scale, long[] pooled_shape) { 15548 super(SCHEMA, resultType, Set.of(), List.of(X, rois), List.of(spatial_scale, pooled_shape)); 15549 } 15550 15551 @Override 15552 public SequencedSet<OnnxParameter> onnxOutputs() { 15553 return onnxOutputs(SCHEMA); 15554 } 15555 15556 @Override 15557 public SequencedMap<OnnxParameter, Object> onnxInputs() { 15558 return onnxInputs(SCHEMA, List.of(X(), rois())); 15559 } 15560 15561 public Value X() { 15562 return operands().get(0); 15563 } 15564 15565 public Value rois() { 15566 return operands().get(1); 15567 } 15568 15569 public java.util.Optional<Float> spatial_scale() { 15570 Float spatial_scale = Attribute.spatial_scale.access(Float.class, onnxAttributes); 15571 return java.util.Optional.ofNullable(spatial_scale); 15572 } 15573 15574 public long[] pooled_shape() { 15575 long[] pooled_shape = Attribute.pooled_shape.access(long[].class, onnxAttributes); 15576 return pooled_shape.clone(); 15577 } 15578 15579 } 15580 15581 public static MaxRoiPool MaxRoiPool(TypeElement resultType, Value X, Value rois, java.util.Optional<Float> spatial_scale, long[] pooled_shape) { 15582 return new MaxRoiPool(resultType, X, rois, spatial_scale, pooled_shape); 15583 } 15584 15585 @OpFactory.OpDeclaration(MaxUnpool.NAME) 15586 public static final class MaxUnpool extends OnnxOp { 15587 public static final String NAME = "MaxUnpool"; 15588 15589 public enum Attribute implements OnnxAttribute { 15590 pads(long[].class, true, null), 15591 strides(long[].class, true, null), 15592 kernel_shape(long[].class, false, null), 15593 ; 15594 15595 final Class<?> t; 15596 final boolean optional; 15597 final Object defaultValue; 15598 15599 Attribute(Class<?> type, boolean optional, Object defaultValue) { 15600 this.t = type; 15601 this.optional = optional; 15602 this.defaultValue = defaultValue; 15603 assert optional || defaultValue == null; 15604 } 15605 15606 public Class<?> type() { 15607 return t; 15608 } 15609 15610 public boolean isOptional() { 15611 return optional; 15612 } 15613 15614 public Object defaultValue() { 15615 return defaultValue; 15616 } 15617 } 15618 15619 public enum TypeConstraint implements OnnxTypeConstraint { 15620 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 15621 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))), 15622 ; 15623 15624 final OnnxType.TypeVariable typeVariable; 15625 15626 TypeConstraint(OnnxType.TypeVariable typeVariable) { 15627 assert typeVariable.name().equals(name()); 15628 this.typeVariable = typeVariable; 15629 } 15630 15631 @Override 15632 public OnnxType.TypeVariable typeVariable() { 15633 return typeVariable; 15634 } 15635 } 15636 15637 public enum InputParameter implements OnnxParameter { 15638 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 15639 I(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 15640 output_shape(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 15641 ; 15642 15643 final OnnxType type; 15644 final Quantifier quantifier; 15645 15646 InputParameter(OnnxType type, Quantifier quantifier) { 15647 this.type = type; 15648 this.quantifier = quantifier; 15649 } 15650 15651 @Override 15652 public OnnxType type() { 15653 return type; 15654 } 15655 15656 @Override 15657 public Quantifier quantifier() { 15658 return quantifier; 15659 } 15660 } 15661 15662 public enum OutputParameter implements OnnxParameter { 15663 output(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 15664 ; 15665 15666 final OnnxType type; 15667 final Quantifier quantifier; 15668 15669 OutputParameter(OnnxType type, Quantifier quantifier) { 15670 this.type = type; 15671 this.quantifier = quantifier; 15672 } 15673 15674 @Override 15675 public OnnxType type() { 15676 return type; 15677 } 15678 15679 @Override 15680 public Quantifier quantifier() { 15681 return quantifier; 15682 } 15683 } 15684 15685 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 15686 NAME, 15687 List.of(Attribute.values()), 15688 List.of(TypeConstraint.values()), 15689 List.of(InputParameter.values()), 15690 List.of(OutputParameter.values()) 15691 ); 15692 15693 public MaxUnpool(ExternalizedOp def) { 15694 super(SCHEMA, def); 15695 } 15696 15697 MaxUnpool(MaxUnpool that, CopyContext cc) { 15698 super(that, cc); 15699 } 15700 15701 @Override 15702 public MaxUnpool transform(CopyContext cc, OpTransformer ot) { 15703 return new MaxUnpool(this, cc); 15704 } 15705 15706 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) { 15707 super(SCHEMA, resultType, Set.of(), List.of(X, I, output_shape), List.of(pads, strides, kernel_shape)); 15708 } 15709 15710 @Override 15711 public SequencedSet<OnnxParameter> onnxOutputs() { 15712 return onnxOutputs(SCHEMA); 15713 } 15714 15715 @Override 15716 public SequencedMap<OnnxParameter, Object> onnxInputs() { 15717 return onnxInputs(SCHEMA, List.of(X(), I(), output_shape())); 15718 } 15719 15720 public Value X() { 15721 return operands().get(0); 15722 } 15723 15724 public Value I() { 15725 return operands().get(1); 15726 } 15727 15728 public java.util.Optional<Value> output_shape() { 15729 int i = optionalInputArguments.indexOf(InputParameter.output_shape); 15730 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 15731 } 15732 15733 public java.util.Optional<long[]> pads() { 15734 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 15735 return java.util.Optional.ofNullable(pads).map(long[]::clone); 15736 } 15737 15738 public java.util.Optional<long[]> strides() { 15739 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 15740 return java.util.Optional.ofNullable(strides).map(long[]::clone); 15741 } 15742 15743 public long[] kernel_shape() { 15744 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 15745 return kernel_shape.clone(); 15746 } 15747 15748 } 15749 15750 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) { 15751 return new MaxUnpool(resultType, X, I, output_shape, pads, strides, kernel_shape); 15752 } 15753 15754 @OpFactory.OpDeclaration(Mean.NAME) 15755 public static final class Mean extends OnnxOp { 15756 public static final String NAME = "Mean"; 15757 15758 public enum Attribute implements OnnxAttribute.None { } 15759 15760 public enum TypeConstraint implements OnnxTypeConstraint { 15761 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 15762 ; 15763 15764 final OnnxType.TypeVariable typeVariable; 15765 15766 TypeConstraint(OnnxType.TypeVariable typeVariable) { 15767 assert typeVariable.name().equals(name()); 15768 this.typeVariable = typeVariable; 15769 } 15770 15771 @Override 15772 public OnnxType.TypeVariable typeVariable() { 15773 return typeVariable; 15774 } 15775 } 15776 15777 public enum InputParameter implements OnnxParameter { 15778 data_0(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC), 15779 ; 15780 15781 final OnnxType type; 15782 final Quantifier quantifier; 15783 15784 InputParameter(OnnxType type, Quantifier quantifier) { 15785 this.type = type; 15786 this.quantifier = quantifier; 15787 } 15788 15789 @Override 15790 public OnnxType type() { 15791 return type; 15792 } 15793 15794 @Override 15795 public Quantifier quantifier() { 15796 return quantifier; 15797 } 15798 } 15799 15800 public enum OutputParameter implements OnnxParameter { 15801 mean(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15802 ; 15803 15804 final OnnxType type; 15805 final Quantifier quantifier; 15806 15807 OutputParameter(OnnxType type, Quantifier quantifier) { 15808 this.type = type; 15809 this.quantifier = quantifier; 15810 } 15811 15812 @Override 15813 public OnnxType type() { 15814 return type; 15815 } 15816 15817 @Override 15818 public Quantifier quantifier() { 15819 return quantifier; 15820 } 15821 } 15822 15823 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 15824 NAME, 15825 List.of(Attribute.values()), 15826 List.of(TypeConstraint.values()), 15827 List.of(InputParameter.values()), 15828 List.of(OutputParameter.values()) 15829 ); 15830 15831 public Mean(ExternalizedOp def) { 15832 super(SCHEMA, def); 15833 } 15834 15835 Mean(Mean that, CopyContext cc) { 15836 super(that, cc); 15837 } 15838 15839 @Override 15840 public Mean transform(CopyContext cc, OpTransformer ot) { 15841 return new Mean(this, cc); 15842 } 15843 15844 Mean(TypeElement resultType, List<Value> data_0) { 15845 super(SCHEMA, resultType, Set.of(), List.of(data_0), List.of()); 15846 } 15847 15848 @Override 15849 public SequencedSet<OnnxParameter> onnxOutputs() { 15850 return onnxOutputs(SCHEMA); 15851 } 15852 15853 @Override 15854 public SequencedMap<OnnxParameter, Object> onnxInputs() { 15855 return onnxInputs(SCHEMA, List.of(data_0())); 15856 } 15857 15858 public List<Value> data_0() { 15859 return operands(); 15860 } 15861 15862 } 15863 15864 public static Mean Mean(TypeElement resultType, List<Value> data_0) { 15865 return new Mean(resultType, data_0); 15866 } 15867 15868 @OpFactory.OpDeclaration(MeanVarianceNormalization.NAME) 15869 public static final class MeanVarianceNormalization extends OnnxOp { 15870 public static final String NAME = "MeanVarianceNormalization"; 15871 15872 public enum Attribute implements OnnxAttribute { 15873 axes(long[].class, true, null), 15874 ; 15875 15876 final Class<?> t; 15877 final boolean optional; 15878 final Object defaultValue; 15879 15880 Attribute(Class<?> type, boolean optional, Object defaultValue) { 15881 this.t = type; 15882 this.optional = optional; 15883 this.defaultValue = defaultValue; 15884 assert optional || defaultValue == null; 15885 } 15886 15887 public Class<?> type() { 15888 return t; 15889 } 15890 15891 public boolean isOptional() { 15892 return optional; 15893 } 15894 15895 public Object defaultValue() { 15896 return defaultValue; 15897 } 15898 } 15899 15900 public enum TypeConstraint implements OnnxTypeConstraint { 15901 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 15902 ; 15903 15904 final OnnxType.TypeVariable typeVariable; 15905 15906 TypeConstraint(OnnxType.TypeVariable typeVariable) { 15907 assert typeVariable.name().equals(name()); 15908 this.typeVariable = typeVariable; 15909 } 15910 15911 @Override 15912 public OnnxType.TypeVariable typeVariable() { 15913 return typeVariable; 15914 } 15915 } 15916 15917 public enum InputParameter implements OnnxParameter { 15918 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15919 ; 15920 15921 final OnnxType type; 15922 final Quantifier quantifier; 15923 15924 InputParameter(OnnxType type, Quantifier quantifier) { 15925 this.type = type; 15926 this.quantifier = quantifier; 15927 } 15928 15929 @Override 15930 public OnnxType type() { 15931 return type; 15932 } 15933 15934 @Override 15935 public Quantifier quantifier() { 15936 return quantifier; 15937 } 15938 } 15939 15940 public enum OutputParameter implements OnnxParameter { 15941 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 15942 ; 15943 15944 final OnnxType type; 15945 final Quantifier quantifier; 15946 15947 OutputParameter(OnnxType type, Quantifier quantifier) { 15948 this.type = type; 15949 this.quantifier = quantifier; 15950 } 15951 15952 @Override 15953 public OnnxType type() { 15954 return type; 15955 } 15956 15957 @Override 15958 public Quantifier quantifier() { 15959 return quantifier; 15960 } 15961 } 15962 15963 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 15964 NAME, 15965 List.of(Attribute.values()), 15966 List.of(TypeConstraint.values()), 15967 List.of(InputParameter.values()), 15968 List.of(OutputParameter.values()) 15969 ); 15970 15971 public MeanVarianceNormalization(ExternalizedOp def) { 15972 super(SCHEMA, def); 15973 } 15974 15975 MeanVarianceNormalization(MeanVarianceNormalization that, CopyContext cc) { 15976 super(that, cc); 15977 } 15978 15979 @Override 15980 public MeanVarianceNormalization transform(CopyContext cc, OpTransformer ot) { 15981 return new MeanVarianceNormalization(this, cc); 15982 } 15983 15984 MeanVarianceNormalization(TypeElement resultType, Value X, java.util.Optional<long[]> axes) { 15985 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(axes)); 15986 } 15987 15988 @Override 15989 public SequencedSet<OnnxParameter> onnxOutputs() { 15990 return onnxOutputs(SCHEMA); 15991 } 15992 15993 @Override 15994 public SequencedMap<OnnxParameter, Object> onnxInputs() { 15995 return onnxInputs(SCHEMA, List.of(X())); 15996 } 15997 15998 public Value X() { 15999 return operands().get(0); 16000 } 16001 16002 public java.util.Optional<long[]> axes() { 16003 long[] axes = Attribute.axes.access(long[].class, onnxAttributes); 16004 return java.util.Optional.ofNullable(axes).map(long[]::clone); 16005 } 16006 16007 } 16008 16009 public static MeanVarianceNormalization MeanVarianceNormalization(TypeElement resultType, Value X, java.util.Optional<long[]> axes) { 16010 return new MeanVarianceNormalization(resultType, X, axes); 16011 } 16012 16013 @OpFactory.OpDeclaration(MelWeightMatrix.NAME) 16014 public static final class MelWeightMatrix extends OnnxOp { 16015 public static final String NAME = "MelWeightMatrix"; 16016 16017 public enum Attribute implements OnnxAttribute { 16018 output_datatype(Long.class, true, 1), 16019 ; 16020 16021 final Class<?> t; 16022 final boolean optional; 16023 final Object defaultValue; 16024 16025 Attribute(Class<?> type, boolean optional, Object defaultValue) { 16026 this.t = type; 16027 this.optional = optional; 16028 this.defaultValue = defaultValue; 16029 assert optional || defaultValue == null; 16030 } 16031 16032 public Class<?> type() { 16033 return t; 16034 } 16035 16036 public boolean isOptional() { 16037 return optional; 16038 } 16039 16040 public Object defaultValue() { 16041 return defaultValue; 16042 } 16043 } 16044 16045 public enum TypeConstraint implements OnnxTypeConstraint { 16046 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 16047 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 16048 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())))), 16049 ; 16050 16051 final OnnxType.TypeVariable typeVariable; 16052 16053 TypeConstraint(OnnxType.TypeVariable typeVariable) { 16054 assert typeVariable.name().equals(name()); 16055 this.typeVariable = typeVariable; 16056 } 16057 16058 @Override 16059 public OnnxType.TypeVariable typeVariable() { 16060 return typeVariable; 16061 } 16062 } 16063 16064 public enum InputParameter implements OnnxParameter { 16065 num_mel_bins(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 16066 dft_length(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 16067 sample_rate(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 16068 lower_edge_hertz(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 16069 upper_edge_hertz(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 16070 ; 16071 16072 final OnnxType type; 16073 final Quantifier quantifier; 16074 16075 InputParameter(OnnxType type, Quantifier quantifier) { 16076 this.type = type; 16077 this.quantifier = quantifier; 16078 } 16079 16080 @Override 16081 public OnnxType type() { 16082 return type; 16083 } 16084 16085 @Override 16086 public Quantifier quantifier() { 16087 return quantifier; 16088 } 16089 } 16090 16091 public enum OutputParameter implements OnnxParameter { 16092 output(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 16093 ; 16094 16095 final OnnxType type; 16096 final Quantifier quantifier; 16097 16098 OutputParameter(OnnxType type, Quantifier quantifier) { 16099 this.type = type; 16100 this.quantifier = quantifier; 16101 } 16102 16103 @Override 16104 public OnnxType type() { 16105 return type; 16106 } 16107 16108 @Override 16109 public Quantifier quantifier() { 16110 return quantifier; 16111 } 16112 } 16113 16114 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 16115 NAME, 16116 List.of(Attribute.values()), 16117 List.of(TypeConstraint.values()), 16118 List.of(InputParameter.values()), 16119 List.of(OutputParameter.values()) 16120 ); 16121 16122 public MelWeightMatrix(ExternalizedOp def) { 16123 super(SCHEMA, def); 16124 } 16125 16126 MelWeightMatrix(MelWeightMatrix that, CopyContext cc) { 16127 super(that, cc); 16128 } 16129 16130 @Override 16131 public MelWeightMatrix transform(CopyContext cc, OpTransformer ot) { 16132 return new MelWeightMatrix(this, cc); 16133 } 16134 16135 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) { 16136 super(SCHEMA, resultType, Set.of(), List.of(num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz), List.of(output_datatype)); 16137 } 16138 16139 @Override 16140 public SequencedSet<OnnxParameter> onnxOutputs() { 16141 return onnxOutputs(SCHEMA); 16142 } 16143 16144 @Override 16145 public SequencedMap<OnnxParameter, Object> onnxInputs() { 16146 return onnxInputs(SCHEMA, List.of(num_mel_bins(), dft_length(), sample_rate(), lower_edge_hertz(), upper_edge_hertz())); 16147 } 16148 16149 public Value num_mel_bins() { 16150 return operands().get(0); 16151 } 16152 16153 public Value dft_length() { 16154 return operands().get(1); 16155 } 16156 16157 public Value sample_rate() { 16158 return operands().get(2); 16159 } 16160 16161 public Value lower_edge_hertz() { 16162 return operands().get(3); 16163 } 16164 16165 public Value upper_edge_hertz() { 16166 return operands().get(4); 16167 } 16168 16169 public java.util.Optional<Long> output_datatype() { 16170 Long output_datatype = Attribute.output_datatype.access(Long.class, onnxAttributes); 16171 return java.util.Optional.ofNullable(output_datatype); 16172 } 16173 16174 } 16175 16176 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) { 16177 return new MelWeightMatrix(resultType, num_mel_bins, dft_length, sample_rate, lower_edge_hertz, upper_edge_hertz, output_datatype); 16178 } 16179 16180 @OpFactory.OpDeclaration(Min.NAME) 16181 public static final class Min extends OnnxOp { 16182 public static final String NAME = "Min"; 16183 16184 public enum Attribute implements OnnxAttribute.None { } 16185 16186 public enum TypeConstraint implements OnnxTypeConstraint { 16187 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())))), 16188 ; 16189 16190 final OnnxType.TypeVariable typeVariable; 16191 16192 TypeConstraint(OnnxType.TypeVariable typeVariable) { 16193 assert typeVariable.name().equals(name()); 16194 this.typeVariable = typeVariable; 16195 } 16196 16197 @Override 16198 public OnnxType.TypeVariable typeVariable() { 16199 return typeVariable; 16200 } 16201 } 16202 16203 public enum InputParameter implements OnnxParameter { 16204 data_0(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC), 16205 ; 16206 16207 final OnnxType type; 16208 final Quantifier quantifier; 16209 16210 InputParameter(OnnxType type, Quantifier quantifier) { 16211 this.type = type; 16212 this.quantifier = quantifier; 16213 } 16214 16215 @Override 16216 public OnnxType type() { 16217 return type; 16218 } 16219 16220 @Override 16221 public Quantifier quantifier() { 16222 return quantifier; 16223 } 16224 } 16225 16226 public enum OutputParameter implements OnnxParameter { 16227 min(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16228 ; 16229 16230 final OnnxType type; 16231 final Quantifier quantifier; 16232 16233 OutputParameter(OnnxType type, Quantifier quantifier) { 16234 this.type = type; 16235 this.quantifier = quantifier; 16236 } 16237 16238 @Override 16239 public OnnxType type() { 16240 return type; 16241 } 16242 16243 @Override 16244 public Quantifier quantifier() { 16245 return quantifier; 16246 } 16247 } 16248 16249 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 16250 NAME, 16251 List.of(Attribute.values()), 16252 List.of(TypeConstraint.values()), 16253 List.of(InputParameter.values()), 16254 List.of(OutputParameter.values()) 16255 ); 16256 16257 public Min(ExternalizedOp def) { 16258 super(SCHEMA, def); 16259 } 16260 16261 Min(Min that, CopyContext cc) { 16262 super(that, cc); 16263 } 16264 16265 @Override 16266 public Min transform(CopyContext cc, OpTransformer ot) { 16267 return new Min(this, cc); 16268 } 16269 16270 Min(TypeElement resultType, List<Value> data_0) { 16271 super(SCHEMA, resultType, Set.of(), List.of(data_0), List.of()); 16272 } 16273 16274 @Override 16275 public SequencedSet<OnnxParameter> onnxOutputs() { 16276 return onnxOutputs(SCHEMA); 16277 } 16278 16279 @Override 16280 public SequencedMap<OnnxParameter, Object> onnxInputs() { 16281 return onnxInputs(SCHEMA, List.of(data_0())); 16282 } 16283 16284 public List<Value> data_0() { 16285 return operands(); 16286 } 16287 16288 } 16289 16290 public static Min Min(TypeElement resultType, List<Value> data_0) { 16291 return new Min(resultType, data_0); 16292 } 16293 16294 @OpFactory.OpDeclaration(Mish.NAME) 16295 public static final class Mish extends OnnxOp { 16296 public static final String NAME = "Mish"; 16297 16298 public enum Attribute implements OnnxAttribute.None { } 16299 16300 public enum TypeConstraint implements OnnxTypeConstraint { 16301 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 16302 ; 16303 16304 final OnnxType.TypeVariable typeVariable; 16305 16306 TypeConstraint(OnnxType.TypeVariable typeVariable) { 16307 assert typeVariable.name().equals(name()); 16308 this.typeVariable = typeVariable; 16309 } 16310 16311 @Override 16312 public OnnxType.TypeVariable typeVariable() { 16313 return typeVariable; 16314 } 16315 } 16316 16317 public enum InputParameter implements OnnxParameter { 16318 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16319 ; 16320 16321 final OnnxType type; 16322 final Quantifier quantifier; 16323 16324 InputParameter(OnnxType type, Quantifier quantifier) { 16325 this.type = type; 16326 this.quantifier = quantifier; 16327 } 16328 16329 @Override 16330 public OnnxType type() { 16331 return type; 16332 } 16333 16334 @Override 16335 public Quantifier quantifier() { 16336 return quantifier; 16337 } 16338 } 16339 16340 public enum OutputParameter implements OnnxParameter { 16341 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16342 ; 16343 16344 final OnnxType type; 16345 final Quantifier quantifier; 16346 16347 OutputParameter(OnnxType type, Quantifier quantifier) { 16348 this.type = type; 16349 this.quantifier = quantifier; 16350 } 16351 16352 @Override 16353 public OnnxType type() { 16354 return type; 16355 } 16356 16357 @Override 16358 public Quantifier quantifier() { 16359 return quantifier; 16360 } 16361 } 16362 16363 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 16364 NAME, 16365 List.of(Attribute.values()), 16366 List.of(TypeConstraint.values()), 16367 List.of(InputParameter.values()), 16368 List.of(OutputParameter.values()) 16369 ); 16370 16371 public Mish(ExternalizedOp def) { 16372 super(SCHEMA, def); 16373 } 16374 16375 Mish(Mish that, CopyContext cc) { 16376 super(that, cc); 16377 } 16378 16379 @Override 16380 public Mish transform(CopyContext cc, OpTransformer ot) { 16381 return new Mish(this, cc); 16382 } 16383 16384 Mish(TypeElement resultType, Value X) { 16385 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 16386 } 16387 16388 @Override 16389 public SequencedSet<OnnxParameter> onnxOutputs() { 16390 return onnxOutputs(SCHEMA); 16391 } 16392 16393 @Override 16394 public SequencedMap<OnnxParameter, Object> onnxInputs() { 16395 return onnxInputs(SCHEMA, List.of(X())); 16396 } 16397 16398 public Value X() { 16399 return operands().get(0); 16400 } 16401 16402 } 16403 16404 public static Mish Mish(TypeElement resultType, Value X) { 16405 return new Mish(resultType, X); 16406 } 16407 16408 @OpFactory.OpDeclaration(Mod.NAME) 16409 public static final class Mod extends OnnxOp { 16410 public static final String NAME = "Mod"; 16411 16412 public enum Attribute implements OnnxAttribute { 16413 fmod(Long.class, true, 0), 16414 ; 16415 16416 final Class<?> t; 16417 final boolean optional; 16418 final Object defaultValue; 16419 16420 Attribute(Class<?> type, boolean optional, Object defaultValue) { 16421 this.t = type; 16422 this.optional = optional; 16423 this.defaultValue = defaultValue; 16424 assert optional || defaultValue == null; 16425 } 16426 16427 public Class<?> type() { 16428 return t; 16429 } 16430 16431 public boolean isOptional() { 16432 return optional; 16433 } 16434 16435 public Object defaultValue() { 16436 return defaultValue; 16437 } 16438 } 16439 16440 public enum TypeConstraint implements OnnxTypeConstraint { 16441 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())))), 16442 ; 16443 16444 final OnnxType.TypeVariable typeVariable; 16445 16446 TypeConstraint(OnnxType.TypeVariable typeVariable) { 16447 assert typeVariable.name().equals(name()); 16448 this.typeVariable = typeVariable; 16449 } 16450 16451 @Override 16452 public OnnxType.TypeVariable typeVariable() { 16453 return typeVariable; 16454 } 16455 } 16456 16457 public enum InputParameter implements OnnxParameter { 16458 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16459 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16460 ; 16461 16462 final OnnxType type; 16463 final Quantifier quantifier; 16464 16465 InputParameter(OnnxType type, Quantifier quantifier) { 16466 this.type = type; 16467 this.quantifier = quantifier; 16468 } 16469 16470 @Override 16471 public OnnxType type() { 16472 return type; 16473 } 16474 16475 @Override 16476 public Quantifier quantifier() { 16477 return quantifier; 16478 } 16479 } 16480 16481 public enum OutputParameter implements OnnxParameter { 16482 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16483 ; 16484 16485 final OnnxType type; 16486 final Quantifier quantifier; 16487 16488 OutputParameter(OnnxType type, Quantifier quantifier) { 16489 this.type = type; 16490 this.quantifier = quantifier; 16491 } 16492 16493 @Override 16494 public OnnxType type() { 16495 return type; 16496 } 16497 16498 @Override 16499 public Quantifier quantifier() { 16500 return quantifier; 16501 } 16502 } 16503 16504 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 16505 NAME, 16506 List.of(Attribute.values()), 16507 List.of(TypeConstraint.values()), 16508 List.of(InputParameter.values()), 16509 List.of(OutputParameter.values()) 16510 ); 16511 16512 public Mod(ExternalizedOp def) { 16513 super(SCHEMA, def); 16514 } 16515 16516 Mod(Mod that, CopyContext cc) { 16517 super(that, cc); 16518 } 16519 16520 @Override 16521 public Mod transform(CopyContext cc, OpTransformer ot) { 16522 return new Mod(this, cc); 16523 } 16524 16525 Mod(TypeElement resultType, Value A, Value B, java.util.Optional<Long> fmod) { 16526 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of(fmod)); 16527 } 16528 16529 @Override 16530 public SequencedSet<OnnxParameter> onnxOutputs() { 16531 return onnxOutputs(SCHEMA); 16532 } 16533 16534 @Override 16535 public SequencedMap<OnnxParameter, Object> onnxInputs() { 16536 return onnxInputs(SCHEMA, List.of(A(), B())); 16537 } 16538 16539 public Value A() { 16540 return operands().get(0); 16541 } 16542 16543 public Value B() { 16544 return operands().get(1); 16545 } 16546 16547 public java.util.Optional<Long> fmod() { 16548 Long fmod = Attribute.fmod.access(Long.class, onnxAttributes); 16549 return java.util.Optional.ofNullable(fmod); 16550 } 16551 16552 } 16553 16554 public static Mod Mod(TypeElement resultType, Value A, Value B, java.util.Optional<Long> fmod) { 16555 return new Mod(resultType, A, B, fmod); 16556 } 16557 16558 @OpFactory.OpDeclaration(Momentum.NAME) 16559 public static final class Momentum extends OnnxOp { 16560 public static final String NAME = "Momentum"; 16561 16562 public enum Attribute implements OnnxAttribute { 16563 mode(String.class, false, null), 16564 norm_coefficient(Float.class, false, null), 16565 alpha(Float.class, false, null), 16566 beta(Float.class, false, null), 16567 ; 16568 16569 final Class<?> t; 16570 final boolean optional; 16571 final Object defaultValue; 16572 16573 Attribute(Class<?> type, boolean optional, Object defaultValue) { 16574 this.t = type; 16575 this.optional = optional; 16576 this.defaultValue = defaultValue; 16577 assert optional || defaultValue == null; 16578 } 16579 16580 public Class<?> type() { 16581 return t; 16582 } 16583 16584 public boolean isOptional() { 16585 return optional; 16586 } 16587 16588 public Object defaultValue() { 16589 return defaultValue; 16590 } 16591 } 16592 16593 public enum TypeConstraint implements OnnxTypeConstraint { 16594 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 16595 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))), 16596 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 16597 ; 16598 16599 final OnnxType.TypeVariable typeVariable; 16600 16601 TypeConstraint(OnnxType.TypeVariable typeVariable) { 16602 assert typeVariable.name().equals(name()); 16603 this.typeVariable = typeVariable; 16604 } 16605 16606 @Override 16607 public OnnxType.TypeVariable typeVariable() { 16608 return typeVariable; 16609 } 16610 } 16611 16612 public enum InputParameter implements OnnxParameter { 16613 R(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 16614 T(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 16615 inputs(TypeConstraint.T3.typeVariable(), Quantifier.VARIADIC), 16616 ; 16617 16618 final OnnxType type; 16619 final Quantifier quantifier; 16620 16621 InputParameter(OnnxType type, Quantifier quantifier) { 16622 this.type = type; 16623 this.quantifier = quantifier; 16624 } 16625 16626 @Override 16627 public OnnxType type() { 16628 return type; 16629 } 16630 16631 @Override 16632 public Quantifier quantifier() { 16633 return quantifier; 16634 } 16635 } 16636 16637 public enum OutputParameter implements OnnxParameter { 16638 outputs(TypeConstraint.T3.typeVariable(), Quantifier.VARIADIC), 16639 ; 16640 16641 final OnnxType type; 16642 final Quantifier quantifier; 16643 16644 OutputParameter(OnnxType type, Quantifier quantifier) { 16645 this.type = type; 16646 this.quantifier = quantifier; 16647 } 16648 16649 @Override 16650 public OnnxType type() { 16651 return type; 16652 } 16653 16654 @Override 16655 public Quantifier quantifier() { 16656 return quantifier; 16657 } 16658 } 16659 16660 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 16661 NAME, 16662 List.of(Attribute.values()), 16663 List.of(TypeConstraint.values()), 16664 List.of(InputParameter.values()), 16665 List.of(OutputParameter.values()) 16666 ); 16667 16668 public Momentum(ExternalizedOp def) { 16669 super(SCHEMA, def); 16670 } 16671 16672 Momentum(Momentum that, CopyContext cc) { 16673 super(that, cc); 16674 } 16675 16676 @Override 16677 public Momentum transform(CopyContext cc, OpTransformer ot) { 16678 return new Momentum(this, cc); 16679 } 16680 16681 Momentum(TypeElement resultType, Value R, Value T, List<Value> inputs, String mode, float norm_coefficient, float alpha, float beta) { 16682 super(SCHEMA, resultType, Set.of(), List.of(R, T, inputs), List.of(mode, norm_coefficient, alpha, beta)); 16683 } 16684 16685 @Override 16686 public SequencedSet<OnnxParameter> onnxOutputs() { 16687 return onnxOutputs(SCHEMA); 16688 } 16689 16690 @Override 16691 public SequencedMap<OnnxParameter, Object> onnxInputs() { 16692 return onnxInputs(SCHEMA, List.of(R(), T(), inputs())); 16693 } 16694 16695 public Value R() { 16696 return operands().get(0); 16697 } 16698 16699 public Value T() { 16700 return operands().get(1); 16701 } 16702 16703 public List<Value> inputs() { 16704 return operands().subList(2, operands().size()); 16705 } 16706 16707 public String mode() { 16708 String mode = Attribute.mode.access(String.class, onnxAttributes); 16709 return mode; 16710 } 16711 16712 public float norm_coefficient() { 16713 float norm_coefficient = Attribute.norm_coefficient.access(Float.class, onnxAttributes); 16714 return norm_coefficient; 16715 } 16716 16717 public float alpha() { 16718 float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 16719 return alpha; 16720 } 16721 16722 public float beta() { 16723 float beta = Attribute.beta.access(Float.class, onnxAttributes); 16724 return beta; 16725 } 16726 16727 } 16728 16729 public static Momentum Momentum(TypeElement resultType, Value R, Value T, List<Value> inputs, String mode, float norm_coefficient, float alpha, float beta) { 16730 return new Momentum(resultType, R, T, inputs, mode, norm_coefficient, alpha, beta); 16731 } 16732 16733 @OpFactory.OpDeclaration(Mul.NAME) 16734 public static final class Mul extends OnnxOp { 16735 public static final String NAME = "Mul"; 16736 16737 public enum Attribute implements OnnxAttribute.None { } 16738 16739 public enum TypeConstraint implements OnnxTypeConstraint { 16740 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())))), 16741 ; 16742 16743 final OnnxType.TypeVariable typeVariable; 16744 16745 TypeConstraint(OnnxType.TypeVariable typeVariable) { 16746 assert typeVariable.name().equals(name()); 16747 this.typeVariable = typeVariable; 16748 } 16749 16750 @Override 16751 public OnnxType.TypeVariable typeVariable() { 16752 return typeVariable; 16753 } 16754 } 16755 16756 public enum InputParameter implements OnnxParameter { 16757 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16758 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16759 ; 16760 16761 final OnnxType type; 16762 final Quantifier quantifier; 16763 16764 InputParameter(OnnxType type, Quantifier quantifier) { 16765 this.type = type; 16766 this.quantifier = quantifier; 16767 } 16768 16769 @Override 16770 public OnnxType type() { 16771 return type; 16772 } 16773 16774 @Override 16775 public Quantifier quantifier() { 16776 return quantifier; 16777 } 16778 } 16779 16780 public enum OutputParameter implements OnnxParameter { 16781 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 16782 ; 16783 16784 final OnnxType type; 16785 final Quantifier quantifier; 16786 16787 OutputParameter(OnnxType type, Quantifier quantifier) { 16788 this.type = type; 16789 this.quantifier = quantifier; 16790 } 16791 16792 @Override 16793 public OnnxType type() { 16794 return type; 16795 } 16796 16797 @Override 16798 public Quantifier quantifier() { 16799 return quantifier; 16800 } 16801 } 16802 16803 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 16804 NAME, 16805 List.of(Attribute.values()), 16806 List.of(TypeConstraint.values()), 16807 List.of(InputParameter.values()), 16808 List.of(OutputParameter.values()) 16809 ); 16810 16811 public Mul(ExternalizedOp def) { 16812 super(SCHEMA, def); 16813 } 16814 16815 Mul(Mul that, CopyContext cc) { 16816 super(that, cc); 16817 } 16818 16819 @Override 16820 public Mul transform(CopyContext cc, OpTransformer ot) { 16821 return new Mul(this, cc); 16822 } 16823 16824 Mul(TypeElement resultType, Value A, Value B) { 16825 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 16826 } 16827 16828 @Override 16829 public SequencedSet<OnnxParameter> onnxOutputs() { 16830 return onnxOutputs(SCHEMA); 16831 } 16832 16833 @Override 16834 public SequencedMap<OnnxParameter, Object> onnxInputs() { 16835 return onnxInputs(SCHEMA, List.of(A(), B())); 16836 } 16837 16838 public Value A() { 16839 return operands().get(0); 16840 } 16841 16842 public Value B() { 16843 return operands().get(1); 16844 } 16845 16846 } 16847 16848 public static Mul Mul(TypeElement resultType, Value A, Value B) { 16849 return new Mul(resultType, A, B); 16850 } 16851 16852 @OpFactory.OpDeclaration(Multinomial.NAME) 16853 public static final class Multinomial extends OnnxOp { 16854 public static final String NAME = "Multinomial"; 16855 16856 public enum Attribute implements OnnxAttribute { 16857 seed(Float.class, true, null), 16858 sample_size(Long.class, true, 1), 16859 dtype(Long.class, true, 6), 16860 ; 16861 16862 final Class<?> t; 16863 final boolean optional; 16864 final Object defaultValue; 16865 16866 Attribute(Class<?> type, boolean optional, Object defaultValue) { 16867 this.t = type; 16868 this.optional = optional; 16869 this.defaultValue = defaultValue; 16870 assert optional || defaultValue == null; 16871 } 16872 16873 public Class<?> type() { 16874 return t; 16875 } 16876 16877 public boolean isOptional() { 16878 return optional; 16879 } 16880 16881 public Object defaultValue() { 16882 return defaultValue; 16883 } 16884 } 16885 16886 public enum TypeConstraint implements OnnxTypeConstraint { 16887 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 16888 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 16889 ; 16890 16891 final OnnxType.TypeVariable typeVariable; 16892 16893 TypeConstraint(OnnxType.TypeVariable typeVariable) { 16894 assert typeVariable.name().equals(name()); 16895 this.typeVariable = typeVariable; 16896 } 16897 16898 @Override 16899 public OnnxType.TypeVariable typeVariable() { 16900 return typeVariable; 16901 } 16902 } 16903 16904 public enum InputParameter implements OnnxParameter { 16905 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 16906 ; 16907 16908 final OnnxType type; 16909 final Quantifier quantifier; 16910 16911 InputParameter(OnnxType type, Quantifier quantifier) { 16912 this.type = type; 16913 this.quantifier = quantifier; 16914 } 16915 16916 @Override 16917 public OnnxType type() { 16918 return type; 16919 } 16920 16921 @Override 16922 public Quantifier quantifier() { 16923 return quantifier; 16924 } 16925 } 16926 16927 public enum OutputParameter implements OnnxParameter { 16928 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 16929 ; 16930 16931 final OnnxType type; 16932 final Quantifier quantifier; 16933 16934 OutputParameter(OnnxType type, Quantifier quantifier) { 16935 this.type = type; 16936 this.quantifier = quantifier; 16937 } 16938 16939 @Override 16940 public OnnxType type() { 16941 return type; 16942 } 16943 16944 @Override 16945 public Quantifier quantifier() { 16946 return quantifier; 16947 } 16948 } 16949 16950 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 16951 NAME, 16952 List.of(Attribute.values()), 16953 List.of(TypeConstraint.values()), 16954 List.of(InputParameter.values()), 16955 List.of(OutputParameter.values()) 16956 ); 16957 16958 public Multinomial(ExternalizedOp def) { 16959 super(SCHEMA, def); 16960 } 16961 16962 Multinomial(Multinomial that, CopyContext cc) { 16963 super(that, cc); 16964 } 16965 16966 @Override 16967 public Multinomial transform(CopyContext cc, OpTransformer ot) { 16968 return new Multinomial(this, cc); 16969 } 16970 16971 Multinomial(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Long> sample_size, java.util.Optional<Long> dtype) { 16972 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(seed, sample_size, dtype)); 16973 } 16974 16975 @Override 16976 public SequencedSet<OnnxParameter> onnxOutputs() { 16977 return onnxOutputs(SCHEMA); 16978 } 16979 16980 @Override 16981 public SequencedMap<OnnxParameter, Object> onnxInputs() { 16982 return onnxInputs(SCHEMA, List.of(input())); 16983 } 16984 16985 public Value input() { 16986 return operands().get(0); 16987 } 16988 16989 public java.util.Optional<Float> seed() { 16990 Float seed = Attribute.seed.access(Float.class, onnxAttributes); 16991 return java.util.Optional.ofNullable(seed); 16992 } 16993 16994 public java.util.Optional<Long> sample_size() { 16995 Long sample_size = Attribute.sample_size.access(Long.class, onnxAttributes); 16996 return java.util.Optional.ofNullable(sample_size); 16997 } 16998 16999 public java.util.Optional<Long> dtype() { 17000 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes); 17001 return java.util.Optional.ofNullable(dtype); 17002 } 17003 17004 } 17005 17006 public static Multinomial Multinomial(TypeElement resultType, Value input, java.util.Optional<Float> seed, java.util.Optional<Long> sample_size, java.util.Optional<Long> dtype) { 17007 return new Multinomial(resultType, input, seed, sample_size, dtype); 17008 } 17009 17010 @OpFactory.OpDeclaration(Neg.NAME) 17011 public static final class Neg extends OnnxOp { 17012 public static final String NAME = "Neg"; 17013 17014 public enum Attribute implements OnnxAttribute.None { } 17015 17016 public enum TypeConstraint implements OnnxTypeConstraint { 17017 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())))), 17018 ; 17019 17020 final OnnxType.TypeVariable typeVariable; 17021 17022 TypeConstraint(OnnxType.TypeVariable typeVariable) { 17023 assert typeVariable.name().equals(name()); 17024 this.typeVariable = typeVariable; 17025 } 17026 17027 @Override 17028 public OnnxType.TypeVariable typeVariable() { 17029 return typeVariable; 17030 } 17031 } 17032 17033 public enum InputParameter implements OnnxParameter { 17034 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 17035 ; 17036 17037 final OnnxType type; 17038 final Quantifier quantifier; 17039 17040 InputParameter(OnnxType type, Quantifier quantifier) { 17041 this.type = type; 17042 this.quantifier = quantifier; 17043 } 17044 17045 @Override 17046 public OnnxType type() { 17047 return type; 17048 } 17049 17050 @Override 17051 public Quantifier quantifier() { 17052 return quantifier; 17053 } 17054 } 17055 17056 public enum OutputParameter implements OnnxParameter { 17057 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 17058 ; 17059 17060 final OnnxType type; 17061 final Quantifier quantifier; 17062 17063 OutputParameter(OnnxType type, Quantifier quantifier) { 17064 this.type = type; 17065 this.quantifier = quantifier; 17066 } 17067 17068 @Override 17069 public OnnxType type() { 17070 return type; 17071 } 17072 17073 @Override 17074 public Quantifier quantifier() { 17075 return quantifier; 17076 } 17077 } 17078 17079 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 17080 NAME, 17081 List.of(Attribute.values()), 17082 List.of(TypeConstraint.values()), 17083 List.of(InputParameter.values()), 17084 List.of(OutputParameter.values()) 17085 ); 17086 17087 public Neg(ExternalizedOp def) { 17088 super(SCHEMA, def); 17089 } 17090 17091 Neg(Neg that, CopyContext cc) { 17092 super(that, cc); 17093 } 17094 17095 @Override 17096 public Neg transform(CopyContext cc, OpTransformer ot) { 17097 return new Neg(this, cc); 17098 } 17099 17100 Neg(TypeElement resultType, Value X) { 17101 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 17102 } 17103 17104 @Override 17105 public SequencedSet<OnnxParameter> onnxOutputs() { 17106 return onnxOutputs(SCHEMA); 17107 } 17108 17109 @Override 17110 public SequencedMap<OnnxParameter, Object> onnxInputs() { 17111 return onnxInputs(SCHEMA, List.of(X())); 17112 } 17113 17114 public Value X() { 17115 return operands().get(0); 17116 } 17117 17118 } 17119 17120 public static Neg Neg(TypeElement resultType, Value X) { 17121 return new Neg(resultType, X); 17122 } 17123 17124 @OpFactory.OpDeclaration(NegativeLogLikelihoodLoss.NAME) 17125 public static final class NegativeLogLikelihoodLoss extends OnnxOp { 17126 public static final String NAME = "NegativeLogLikelihoodLoss"; 17127 17128 public enum Attribute implements OnnxAttribute { 17129 ignore_index(Long.class, true, null), 17130 reduction(String.class, true, "mean"), 17131 ; 17132 17133 final Class<?> t; 17134 final boolean optional; 17135 final Object defaultValue; 17136 17137 Attribute(Class<?> type, boolean optional, Object defaultValue) { 17138 this.t = type; 17139 this.optional = optional; 17140 this.defaultValue = defaultValue; 17141 assert optional || defaultValue == null; 17142 } 17143 17144 public Class<?> type() { 17145 return t; 17146 } 17147 17148 public boolean isOptional() { 17149 return optional; 17150 } 17151 17152 public Object defaultValue() { 17153 return defaultValue; 17154 } 17155 } 17156 17157 public enum TypeConstraint implements OnnxTypeConstraint { 17158 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 17159 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 17160 ; 17161 17162 final OnnxType.TypeVariable typeVariable; 17163 17164 TypeConstraint(OnnxType.TypeVariable typeVariable) { 17165 assert typeVariable.name().equals(name()); 17166 this.typeVariable = typeVariable; 17167 } 17168 17169 @Override 17170 public OnnxType.TypeVariable typeVariable() { 17171 return typeVariable; 17172 } 17173 } 17174 17175 public enum InputParameter implements OnnxParameter { 17176 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 17177 target(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 17178 weight(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 17179 ; 17180 17181 final OnnxType type; 17182 final Quantifier quantifier; 17183 17184 InputParameter(OnnxType type, Quantifier quantifier) { 17185 this.type = type; 17186 this.quantifier = quantifier; 17187 } 17188 17189 @Override 17190 public OnnxType type() { 17191 return type; 17192 } 17193 17194 @Override 17195 public Quantifier quantifier() { 17196 return quantifier; 17197 } 17198 } 17199 17200 public enum OutputParameter implements OnnxParameter { 17201 loss(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 17202 ; 17203 17204 final OnnxType type; 17205 final Quantifier quantifier; 17206 17207 OutputParameter(OnnxType type, Quantifier quantifier) { 17208 this.type = type; 17209 this.quantifier = quantifier; 17210 } 17211 17212 @Override 17213 public OnnxType type() { 17214 return type; 17215 } 17216 17217 @Override 17218 public Quantifier quantifier() { 17219 return quantifier; 17220 } 17221 } 17222 17223 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 17224 NAME, 17225 List.of(Attribute.values()), 17226 List.of(TypeConstraint.values()), 17227 List.of(InputParameter.values()), 17228 List.of(OutputParameter.values()) 17229 ); 17230 17231 public NegativeLogLikelihoodLoss(ExternalizedOp def) { 17232 super(SCHEMA, def); 17233 } 17234 17235 NegativeLogLikelihoodLoss(NegativeLogLikelihoodLoss that, CopyContext cc) { 17236 super(that, cc); 17237 } 17238 17239 @Override 17240 public NegativeLogLikelihoodLoss transform(CopyContext cc, OpTransformer ot) { 17241 return new NegativeLogLikelihoodLoss(this, cc); 17242 } 17243 17244 NegativeLogLikelihoodLoss(TypeElement resultType, Value input, Value target, java.util.Optional<Value> weight, java.util.Optional<Long> ignore_index, java.util.Optional<String> reduction) { 17245 super(SCHEMA, resultType, Set.of(), List.of(input, target, weight), List.of(ignore_index, reduction)); 17246 } 17247 17248 @Override 17249 public SequencedSet<OnnxParameter> onnxOutputs() { 17250 return onnxOutputs(SCHEMA); 17251 } 17252 17253 @Override 17254 public SequencedMap<OnnxParameter, Object> onnxInputs() { 17255 return onnxInputs(SCHEMA, List.of(input(), target(), weight())); 17256 } 17257 17258 public Value input() { 17259 return operands().get(0); 17260 } 17261 17262 public Value target() { 17263 return operands().get(1); 17264 } 17265 17266 public java.util.Optional<Value> weight() { 17267 int i = optionalInputArguments.indexOf(InputParameter.weight); 17268 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 17269 } 17270 17271 public java.util.Optional<Long> ignore_index() { 17272 Long ignore_index = Attribute.ignore_index.access(Long.class, onnxAttributes); 17273 return java.util.Optional.ofNullable(ignore_index); 17274 } 17275 17276 public java.util.Optional<String> reduction() { 17277 String reduction = Attribute.reduction.access(String.class, onnxAttributes); 17278 return java.util.Optional.ofNullable(reduction); 17279 } 17280 17281 } 17282 17283 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) { 17284 return new NegativeLogLikelihoodLoss(resultType, input, target, weight, ignore_index, reduction); 17285 } 17286 17287 @OpFactory.OpDeclaration(NonMaxSuppression.NAME) 17288 public static final class NonMaxSuppression extends OnnxOp { 17289 public static final String NAME = "NonMaxSuppression"; 17290 17291 public enum Attribute implements OnnxAttribute { 17292 center_point_box(Long.class, true, 0), 17293 ; 17294 17295 final Class<?> t; 17296 final boolean optional; 17297 final Object defaultValue; 17298 17299 Attribute(Class<?> type, boolean optional, Object defaultValue) { 17300 this.t = type; 17301 this.optional = optional; 17302 this.defaultValue = defaultValue; 17303 assert optional || defaultValue == null; 17304 } 17305 17306 public Class<?> type() { 17307 return t; 17308 } 17309 17310 public boolean isOptional() { 17311 return optional; 17312 } 17313 17314 public Object defaultValue() { 17315 return defaultValue; 17316 } 17317 } 17318 17319 public enum TypeConstraint implements OnnxTypeConstraint.None { } 17320 17321 public enum InputParameter implements OnnxParameter { 17322 boxes(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 17323 scores(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 17324 max_output_boxes_per_class(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 17325 iou_threshold(OnnxType.tensor(OnnxType.float32()), Quantifier.OPTIONAL), 17326 score_threshold(OnnxType.tensor(OnnxType.float32()), Quantifier.OPTIONAL), 17327 ; 17328 17329 final OnnxType type; 17330 final Quantifier quantifier; 17331 17332 InputParameter(OnnxType type, Quantifier quantifier) { 17333 this.type = type; 17334 this.quantifier = quantifier; 17335 } 17336 17337 @Override 17338 public OnnxType type() { 17339 return type; 17340 } 17341 17342 @Override 17343 public Quantifier quantifier() { 17344 return quantifier; 17345 } 17346 } 17347 17348 public enum OutputParameter implements OnnxParameter { 17349 selected_indices(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 17350 ; 17351 17352 final OnnxType type; 17353 final Quantifier quantifier; 17354 17355 OutputParameter(OnnxType type, Quantifier quantifier) { 17356 this.type = type; 17357 this.quantifier = quantifier; 17358 } 17359 17360 @Override 17361 public OnnxType type() { 17362 return type; 17363 } 17364 17365 @Override 17366 public Quantifier quantifier() { 17367 return quantifier; 17368 } 17369 } 17370 17371 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 17372 NAME, 17373 List.of(Attribute.values()), 17374 List.of(TypeConstraint.values()), 17375 List.of(InputParameter.values()), 17376 List.of(OutputParameter.values()) 17377 ); 17378 17379 public NonMaxSuppression(ExternalizedOp def) { 17380 super(SCHEMA, def); 17381 } 17382 17383 NonMaxSuppression(NonMaxSuppression that, CopyContext cc) { 17384 super(that, cc); 17385 } 17386 17387 @Override 17388 public NonMaxSuppression transform(CopyContext cc, OpTransformer ot) { 17389 return new NonMaxSuppression(this, cc); 17390 } 17391 17392 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) { 17393 super(SCHEMA, resultType, Set.of(), List.of(boxes, scores, max_output_boxes_per_class, iou_threshold, score_threshold), List.of(center_point_box)); 17394 } 17395 17396 @Override 17397 public SequencedSet<OnnxParameter> onnxOutputs() { 17398 return onnxOutputs(SCHEMA); 17399 } 17400 17401 @Override 17402 public SequencedMap<OnnxParameter, Object> onnxInputs() { 17403 return onnxInputs(SCHEMA, List.of(boxes(), scores(), max_output_boxes_per_class(), iou_threshold(), score_threshold())); 17404 } 17405 17406 public Value boxes() { 17407 return operands().get(0); 17408 } 17409 17410 public Value scores() { 17411 return operands().get(1); 17412 } 17413 17414 public java.util.Optional<Value> max_output_boxes_per_class() { 17415 int i = optionalInputArguments.indexOf(InputParameter.max_output_boxes_per_class); 17416 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 17417 } 17418 17419 public java.util.Optional<Value> iou_threshold() { 17420 int i = optionalInputArguments.indexOf(InputParameter.iou_threshold); 17421 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 17422 } 17423 17424 public java.util.Optional<Value> score_threshold() { 17425 int i = optionalInputArguments.indexOf(InputParameter.score_threshold); 17426 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 17427 } 17428 17429 public java.util.Optional<Long> center_point_box() { 17430 Long center_point_box = Attribute.center_point_box.access(Long.class, onnxAttributes); 17431 return java.util.Optional.ofNullable(center_point_box); 17432 } 17433 17434 } 17435 17436 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) { 17437 return new NonMaxSuppression(resultType, boxes, scores, max_output_boxes_per_class, iou_threshold, score_threshold, center_point_box); 17438 } 17439 17440 @OpFactory.OpDeclaration(NonZero.NAME) 17441 public static final class NonZero extends OnnxOp { 17442 public static final String NAME = "NonZero"; 17443 17444 public enum Attribute implements OnnxAttribute.None { } 17445 17446 public enum TypeConstraint implements OnnxTypeConstraint { 17447 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())))), 17448 ; 17449 17450 final OnnxType.TypeVariable typeVariable; 17451 17452 TypeConstraint(OnnxType.TypeVariable typeVariable) { 17453 assert typeVariable.name().equals(name()); 17454 this.typeVariable = typeVariable; 17455 } 17456 17457 @Override 17458 public OnnxType.TypeVariable typeVariable() { 17459 return typeVariable; 17460 } 17461 } 17462 17463 public enum InputParameter implements OnnxParameter { 17464 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 17465 ; 17466 17467 final OnnxType type; 17468 final Quantifier quantifier; 17469 17470 InputParameter(OnnxType type, Quantifier quantifier) { 17471 this.type = type; 17472 this.quantifier = quantifier; 17473 } 17474 17475 @Override 17476 public OnnxType type() { 17477 return type; 17478 } 17479 17480 @Override 17481 public Quantifier quantifier() { 17482 return quantifier; 17483 } 17484 } 17485 17486 public enum OutputParameter implements OnnxParameter { 17487 Y(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 17488 ; 17489 17490 final OnnxType type; 17491 final Quantifier quantifier; 17492 17493 OutputParameter(OnnxType type, Quantifier quantifier) { 17494 this.type = type; 17495 this.quantifier = quantifier; 17496 } 17497 17498 @Override 17499 public OnnxType type() { 17500 return type; 17501 } 17502 17503 @Override 17504 public Quantifier quantifier() { 17505 return quantifier; 17506 } 17507 } 17508 17509 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 17510 NAME, 17511 List.of(Attribute.values()), 17512 List.of(TypeConstraint.values()), 17513 List.of(InputParameter.values()), 17514 List.of(OutputParameter.values()) 17515 ); 17516 17517 public NonZero(ExternalizedOp def) { 17518 super(SCHEMA, def); 17519 } 17520 17521 NonZero(NonZero that, CopyContext cc) { 17522 super(that, cc); 17523 } 17524 17525 @Override 17526 public NonZero transform(CopyContext cc, OpTransformer ot) { 17527 return new NonZero(this, cc); 17528 } 17529 17530 NonZero(TypeElement resultType, Value X) { 17531 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 17532 } 17533 17534 @Override 17535 public SequencedSet<OnnxParameter> onnxOutputs() { 17536 return onnxOutputs(SCHEMA); 17537 } 17538 17539 @Override 17540 public SequencedMap<OnnxParameter, Object> onnxInputs() { 17541 return onnxInputs(SCHEMA, List.of(X())); 17542 } 17543 17544 public Value X() { 17545 return operands().get(0); 17546 } 17547 17548 } 17549 17550 public static NonZero NonZero(TypeElement resultType, Value X) { 17551 return new NonZero(resultType, X); 17552 } 17553 17554 @OpFactory.OpDeclaration(Normalizer.NAME) 17555 public static final class Normalizer extends OnnxOp { 17556 public static final String NAME = "Normalizer"; 17557 17558 public enum Attribute implements OnnxAttribute { 17559 norm(String.class, true, "MAX"), 17560 ; 17561 17562 final Class<?> t; 17563 final boolean optional; 17564 final Object defaultValue; 17565 17566 Attribute(Class<?> type, boolean optional, Object defaultValue) { 17567 this.t = type; 17568 this.optional = optional; 17569 this.defaultValue = defaultValue; 17570 assert optional || defaultValue == null; 17571 } 17572 17573 public Class<?> type() { 17574 return t; 17575 } 17576 17577 public boolean isOptional() { 17578 return optional; 17579 } 17580 17581 public Object defaultValue() { 17582 return defaultValue; 17583 } 17584 } 17585 17586 public enum TypeConstraint implements OnnxTypeConstraint { 17587 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 17588 ; 17589 17590 final OnnxType.TypeVariable typeVariable; 17591 17592 TypeConstraint(OnnxType.TypeVariable typeVariable) { 17593 assert typeVariable.name().equals(name()); 17594 this.typeVariable = typeVariable; 17595 } 17596 17597 @Override 17598 public OnnxType.TypeVariable typeVariable() { 17599 return typeVariable; 17600 } 17601 } 17602 17603 public enum InputParameter implements OnnxParameter { 17604 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 17605 ; 17606 17607 final OnnxType type; 17608 final Quantifier quantifier; 17609 17610 InputParameter(OnnxType type, Quantifier quantifier) { 17611 this.type = type; 17612 this.quantifier = quantifier; 17613 } 17614 17615 @Override 17616 public OnnxType type() { 17617 return type; 17618 } 17619 17620 @Override 17621 public Quantifier quantifier() { 17622 return quantifier; 17623 } 17624 } 17625 17626 public enum OutputParameter implements OnnxParameter { 17627 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 17628 ; 17629 17630 final OnnxType type; 17631 final Quantifier quantifier; 17632 17633 OutputParameter(OnnxType type, Quantifier quantifier) { 17634 this.type = type; 17635 this.quantifier = quantifier; 17636 } 17637 17638 @Override 17639 public OnnxType type() { 17640 return type; 17641 } 17642 17643 @Override 17644 public Quantifier quantifier() { 17645 return quantifier; 17646 } 17647 } 17648 17649 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 17650 NAME, 17651 List.of(Attribute.values()), 17652 List.of(TypeConstraint.values()), 17653 List.of(InputParameter.values()), 17654 List.of(OutputParameter.values()) 17655 ); 17656 17657 public Normalizer(ExternalizedOp def) { 17658 super(SCHEMA, def); 17659 } 17660 17661 Normalizer(Normalizer that, CopyContext cc) { 17662 super(that, cc); 17663 } 17664 17665 @Override 17666 public Normalizer transform(CopyContext cc, OpTransformer ot) { 17667 return new Normalizer(this, cc); 17668 } 17669 17670 Normalizer(TypeElement resultType, Value X, java.util.Optional<String> norm) { 17671 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(norm)); 17672 } 17673 17674 @Override 17675 public SequencedSet<OnnxParameter> onnxOutputs() { 17676 return onnxOutputs(SCHEMA); 17677 } 17678 17679 @Override 17680 public SequencedMap<OnnxParameter, Object> onnxInputs() { 17681 return onnxInputs(SCHEMA, List.of(X())); 17682 } 17683 17684 public Value X() { 17685 return operands().get(0); 17686 } 17687 17688 public java.util.Optional<String> norm() { 17689 String norm = Attribute.norm.access(String.class, onnxAttributes); 17690 return java.util.Optional.ofNullable(norm); 17691 } 17692 17693 } 17694 17695 public static Normalizer Normalizer(TypeElement resultType, Value X, java.util.Optional<String> norm) { 17696 return new Normalizer(resultType, X, norm); 17697 } 17698 17699 @OpFactory.OpDeclaration(Not.NAME) 17700 public static final class Not extends OnnxOp { 17701 public static final String NAME = "Not"; 17702 17703 public enum Attribute implements OnnxAttribute.None { } 17704 17705 public enum TypeConstraint implements OnnxTypeConstraint { 17706 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bool())))), 17707 ; 17708 17709 final OnnxType.TypeVariable typeVariable; 17710 17711 TypeConstraint(OnnxType.TypeVariable typeVariable) { 17712 assert typeVariable.name().equals(name()); 17713 this.typeVariable = typeVariable; 17714 } 17715 17716 @Override 17717 public OnnxType.TypeVariable typeVariable() { 17718 return typeVariable; 17719 } 17720 } 17721 17722 public enum InputParameter implements OnnxParameter { 17723 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 17724 ; 17725 17726 final OnnxType type; 17727 final Quantifier quantifier; 17728 17729 InputParameter(OnnxType type, Quantifier quantifier) { 17730 this.type = type; 17731 this.quantifier = quantifier; 17732 } 17733 17734 @Override 17735 public OnnxType type() { 17736 return type; 17737 } 17738 17739 @Override 17740 public Quantifier quantifier() { 17741 return quantifier; 17742 } 17743 } 17744 17745 public enum OutputParameter implements OnnxParameter { 17746 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 17747 ; 17748 17749 final OnnxType type; 17750 final Quantifier quantifier; 17751 17752 OutputParameter(OnnxType type, Quantifier quantifier) { 17753 this.type = type; 17754 this.quantifier = quantifier; 17755 } 17756 17757 @Override 17758 public OnnxType type() { 17759 return type; 17760 } 17761 17762 @Override 17763 public Quantifier quantifier() { 17764 return quantifier; 17765 } 17766 } 17767 17768 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 17769 NAME, 17770 List.of(Attribute.values()), 17771 List.of(TypeConstraint.values()), 17772 List.of(InputParameter.values()), 17773 List.of(OutputParameter.values()) 17774 ); 17775 17776 public Not(ExternalizedOp def) { 17777 super(SCHEMA, def); 17778 } 17779 17780 Not(Not that, CopyContext cc) { 17781 super(that, cc); 17782 } 17783 17784 @Override 17785 public Not transform(CopyContext cc, OpTransformer ot) { 17786 return new Not(this, cc); 17787 } 17788 17789 Not(TypeElement resultType, Value X) { 17790 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 17791 } 17792 17793 @Override 17794 public SequencedSet<OnnxParameter> onnxOutputs() { 17795 return onnxOutputs(SCHEMA); 17796 } 17797 17798 @Override 17799 public SequencedMap<OnnxParameter, Object> onnxInputs() { 17800 return onnxInputs(SCHEMA, List.of(X())); 17801 } 17802 17803 public Value X() { 17804 return operands().get(0); 17805 } 17806 17807 } 17808 17809 public static Not Not(TypeElement resultType, Value X) { 17810 return new Not(resultType, X); 17811 } 17812 17813 @OpFactory.OpDeclaration(OneHot.NAME) 17814 public static final class OneHot extends OnnxOp { 17815 public static final String NAME = "OneHot"; 17816 17817 public enum Attribute implements OnnxAttribute { 17818 axis(Long.class, true, -1), 17819 ; 17820 17821 final Class<?> t; 17822 final boolean optional; 17823 final Object defaultValue; 17824 17825 Attribute(Class<?> type, boolean optional, Object defaultValue) { 17826 this.t = type; 17827 this.optional = optional; 17828 this.defaultValue = defaultValue; 17829 assert optional || defaultValue == null; 17830 } 17831 17832 public Class<?> type() { 17833 return t; 17834 } 17835 17836 public boolean isOptional() { 17837 return optional; 17838 } 17839 17840 public Object defaultValue() { 17841 return defaultValue; 17842 } 17843 } 17844 17845 public enum TypeConstraint implements OnnxTypeConstraint { 17846 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())))), 17847 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())))), 17848 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())))), 17849 ; 17850 17851 final OnnxType.TypeVariable typeVariable; 17852 17853 TypeConstraint(OnnxType.TypeVariable typeVariable) { 17854 assert typeVariable.name().equals(name()); 17855 this.typeVariable = typeVariable; 17856 } 17857 17858 @Override 17859 public OnnxType.TypeVariable typeVariable() { 17860 return typeVariable; 17861 } 17862 } 17863 17864 public enum InputParameter implements OnnxParameter { 17865 indices(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 17866 depth(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 17867 values(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 17868 ; 17869 17870 final OnnxType type; 17871 final Quantifier quantifier; 17872 17873 InputParameter(OnnxType type, Quantifier quantifier) { 17874 this.type = type; 17875 this.quantifier = quantifier; 17876 } 17877 17878 @Override 17879 public OnnxType type() { 17880 return type; 17881 } 17882 17883 @Override 17884 public Quantifier quantifier() { 17885 return quantifier; 17886 } 17887 } 17888 17889 public enum OutputParameter implements OnnxParameter { 17890 output(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 17891 ; 17892 17893 final OnnxType type; 17894 final Quantifier quantifier; 17895 17896 OutputParameter(OnnxType type, Quantifier quantifier) { 17897 this.type = type; 17898 this.quantifier = quantifier; 17899 } 17900 17901 @Override 17902 public OnnxType type() { 17903 return type; 17904 } 17905 17906 @Override 17907 public Quantifier quantifier() { 17908 return quantifier; 17909 } 17910 } 17911 17912 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 17913 NAME, 17914 List.of(Attribute.values()), 17915 List.of(TypeConstraint.values()), 17916 List.of(InputParameter.values()), 17917 List.of(OutputParameter.values()) 17918 ); 17919 17920 public OneHot(ExternalizedOp def) { 17921 super(SCHEMA, def); 17922 } 17923 17924 OneHot(OneHot that, CopyContext cc) { 17925 super(that, cc); 17926 } 17927 17928 @Override 17929 public OneHot transform(CopyContext cc, OpTransformer ot) { 17930 return new OneHot(this, cc); 17931 } 17932 17933 OneHot(TypeElement resultType, Value indices, Value depth, Value values, java.util.Optional<Long> axis) { 17934 super(SCHEMA, resultType, Set.of(), List.of(indices, depth, values), List.of(axis)); 17935 } 17936 17937 @Override 17938 public SequencedSet<OnnxParameter> onnxOutputs() { 17939 return onnxOutputs(SCHEMA); 17940 } 17941 17942 @Override 17943 public SequencedMap<OnnxParameter, Object> onnxInputs() { 17944 return onnxInputs(SCHEMA, List.of(indices(), depth(), values())); 17945 } 17946 17947 public Value indices() { 17948 return operands().get(0); 17949 } 17950 17951 public Value depth() { 17952 return operands().get(1); 17953 } 17954 17955 public Value values() { 17956 return operands().get(2); 17957 } 17958 17959 public java.util.Optional<Long> axis() { 17960 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 17961 return java.util.Optional.ofNullable(axis); 17962 } 17963 17964 } 17965 17966 public static OneHot OneHot(TypeElement resultType, Value indices, Value depth, Value values, java.util.Optional<Long> axis) { 17967 return new OneHot(resultType, indices, depth, values, axis); 17968 } 17969 17970 @OpFactory.OpDeclaration(OneHotEncoder.NAME) 17971 public static final class OneHotEncoder extends OnnxOp { 17972 public static final String NAME = "OneHotEncoder"; 17973 17974 public enum Attribute implements OnnxAttribute { 17975 cats_strings(String[].class, true, null), 17976 cats_int64s(long[].class, true, null), 17977 zeros(Long.class, true, 1), 17978 ; 17979 17980 final Class<?> t; 17981 final boolean optional; 17982 final Object defaultValue; 17983 17984 Attribute(Class<?> type, boolean optional, Object defaultValue) { 17985 this.t = type; 17986 this.optional = optional; 17987 this.defaultValue = defaultValue; 17988 assert optional || defaultValue == null; 17989 } 17990 17991 public Class<?> type() { 17992 return t; 17993 } 17994 17995 public boolean isOptional() { 17996 return optional; 17997 } 17998 17999 public Object defaultValue() { 18000 return defaultValue; 18001 } 18002 } 18003 18004 public enum TypeConstraint implements OnnxTypeConstraint { 18005 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())))), 18006 ; 18007 18008 final OnnxType.TypeVariable typeVariable; 18009 18010 TypeConstraint(OnnxType.TypeVariable typeVariable) { 18011 assert typeVariable.name().equals(name()); 18012 this.typeVariable = typeVariable; 18013 } 18014 18015 @Override 18016 public OnnxType.TypeVariable typeVariable() { 18017 return typeVariable; 18018 } 18019 } 18020 18021 public enum InputParameter implements OnnxParameter { 18022 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18023 ; 18024 18025 final OnnxType type; 18026 final Quantifier quantifier; 18027 18028 InputParameter(OnnxType type, Quantifier quantifier) { 18029 this.type = type; 18030 this.quantifier = quantifier; 18031 } 18032 18033 @Override 18034 public OnnxType type() { 18035 return type; 18036 } 18037 18038 @Override 18039 public Quantifier quantifier() { 18040 return quantifier; 18041 } 18042 } 18043 18044 public enum OutputParameter implements OnnxParameter { 18045 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 18046 ; 18047 18048 final OnnxType type; 18049 final Quantifier quantifier; 18050 18051 OutputParameter(OnnxType type, Quantifier quantifier) { 18052 this.type = type; 18053 this.quantifier = quantifier; 18054 } 18055 18056 @Override 18057 public OnnxType type() { 18058 return type; 18059 } 18060 18061 @Override 18062 public Quantifier quantifier() { 18063 return quantifier; 18064 } 18065 } 18066 18067 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 18068 NAME, 18069 List.of(Attribute.values()), 18070 List.of(TypeConstraint.values()), 18071 List.of(InputParameter.values()), 18072 List.of(OutputParameter.values()) 18073 ); 18074 18075 public OneHotEncoder(ExternalizedOp def) { 18076 super(SCHEMA, def); 18077 } 18078 18079 OneHotEncoder(OneHotEncoder that, CopyContext cc) { 18080 super(that, cc); 18081 } 18082 18083 @Override 18084 public OneHotEncoder transform(CopyContext cc, OpTransformer ot) { 18085 return new OneHotEncoder(this, cc); 18086 } 18087 18088 OneHotEncoder(TypeElement resultType, Value X, java.util.Optional<String[]> cats_strings, java.util.Optional<long[]> cats_int64s, java.util.Optional<Long> zeros) { 18089 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(cats_strings, cats_int64s, zeros)); 18090 } 18091 18092 @Override 18093 public SequencedSet<OnnxParameter> onnxOutputs() { 18094 return onnxOutputs(SCHEMA); 18095 } 18096 18097 @Override 18098 public SequencedMap<OnnxParameter, Object> onnxInputs() { 18099 return onnxInputs(SCHEMA, List.of(X())); 18100 } 18101 18102 public Value X() { 18103 return operands().get(0); 18104 } 18105 18106 public java.util.Optional<String[]> cats_strings() { 18107 String[] cats_strings = Attribute.cats_strings.access(String[].class, onnxAttributes); 18108 return java.util.Optional.ofNullable(cats_strings).map(String[]::clone); 18109 } 18110 18111 public java.util.Optional<long[]> cats_int64s() { 18112 long[] cats_int64s = Attribute.cats_int64s.access(long[].class, onnxAttributes); 18113 return java.util.Optional.ofNullable(cats_int64s).map(long[]::clone); 18114 } 18115 18116 public java.util.Optional<Long> zeros() { 18117 Long zeros = Attribute.zeros.access(Long.class, onnxAttributes); 18118 return java.util.Optional.ofNullable(zeros); 18119 } 18120 18121 } 18122 18123 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) { 18124 return new OneHotEncoder(resultType, X, cats_strings, cats_int64s, zeros); 18125 } 18126 18127 @OpFactory.OpDeclaration(Optional.NAME) 18128 public static final class Optional extends OnnxOp { 18129 public static final String NAME = "Optional"; 18130 18131 public enum Attribute implements OnnxAttribute { 18132 type(Object.class, true, null), 18133 ; 18134 18135 final Class<?> t; 18136 final boolean optional; 18137 final Object defaultValue; 18138 18139 Attribute(Class<?> type, boolean optional, Object defaultValue) { 18140 this.t = type; 18141 this.optional = optional; 18142 this.defaultValue = defaultValue; 18143 assert optional || defaultValue == null; 18144 } 18145 18146 public Class<?> type() { 18147 return t; 18148 } 18149 18150 public boolean isOptional() { 18151 return optional; 18152 } 18153 18154 public Object defaultValue() { 18155 return defaultValue; 18156 } 18157 } 18158 18159 public enum TypeConstraint implements OnnxTypeConstraint { 18160 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()))))), 18161 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()))))), 18162 ; 18163 18164 final OnnxType.TypeVariable typeVariable; 18165 18166 TypeConstraint(OnnxType.TypeVariable typeVariable) { 18167 assert typeVariable.name().equals(name()); 18168 this.typeVariable = typeVariable; 18169 } 18170 18171 @Override 18172 public OnnxType.TypeVariable typeVariable() { 18173 return typeVariable; 18174 } 18175 } 18176 18177 public enum InputParameter implements OnnxParameter { 18178 input(TypeConstraint.V.typeVariable(), Quantifier.OPTIONAL), 18179 ; 18180 18181 final OnnxType type; 18182 final Quantifier quantifier; 18183 18184 InputParameter(OnnxType type, Quantifier quantifier) { 18185 this.type = type; 18186 this.quantifier = quantifier; 18187 } 18188 18189 @Override 18190 public OnnxType type() { 18191 return type; 18192 } 18193 18194 @Override 18195 public Quantifier quantifier() { 18196 return quantifier; 18197 } 18198 } 18199 18200 public enum OutputParameter implements OnnxParameter { 18201 output(TypeConstraint.O.typeVariable(), Quantifier.REQUIRED), 18202 ; 18203 18204 final OnnxType type; 18205 final Quantifier quantifier; 18206 18207 OutputParameter(OnnxType type, Quantifier quantifier) { 18208 this.type = type; 18209 this.quantifier = quantifier; 18210 } 18211 18212 @Override 18213 public OnnxType type() { 18214 return type; 18215 } 18216 18217 @Override 18218 public Quantifier quantifier() { 18219 return quantifier; 18220 } 18221 } 18222 18223 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 18224 NAME, 18225 List.of(Attribute.values()), 18226 List.of(TypeConstraint.values()), 18227 List.of(InputParameter.values()), 18228 List.of(OutputParameter.values()) 18229 ); 18230 18231 public Optional(ExternalizedOp def) { 18232 super(SCHEMA, def); 18233 } 18234 18235 Optional(Optional that, CopyContext cc) { 18236 super(that, cc); 18237 } 18238 18239 @Override 18240 public Optional transform(CopyContext cc, OpTransformer ot) { 18241 return new Optional(this, cc); 18242 } 18243 18244 Optional(TypeElement resultType, java.util.Optional<Value> input, java.util.Optional<Object> type) { 18245 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(type)); 18246 } 18247 18248 @Override 18249 public SequencedSet<OnnxParameter> onnxOutputs() { 18250 return onnxOutputs(SCHEMA); 18251 } 18252 18253 @Override 18254 public SequencedMap<OnnxParameter, Object> onnxInputs() { 18255 return onnxInputs(SCHEMA, List.of(input())); 18256 } 18257 18258 public java.util.Optional<Value> input() { 18259 int i = optionalInputArguments.indexOf(InputParameter.input); 18260 return i != -1 ? java.util.Optional.of(operands().get(0 + i)) : java.util.Optional.empty(); 18261 } 18262 18263 public java.util.Optional<Object> type() { 18264 Object type = Attribute.type.access(Object.class, onnxAttributes); 18265 return java.util.Optional.ofNullable(type); 18266 } 18267 18268 } 18269 18270 public static Optional Optional(TypeElement resultType, java.util.Optional<Value> input, java.util.Optional<Object> type) { 18271 return new Optional(resultType, input, type); 18272 } 18273 18274 @OpFactory.OpDeclaration(OptionalGetElement.NAME) 18275 public static final class OptionalGetElement extends OnnxOp { 18276 public static final String NAME = "OptionalGetElement"; 18277 18278 public enum Attribute implements OnnxAttribute.None { } 18279 18280 public enum TypeConstraint implements OnnxTypeConstraint { 18281 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()))))), 18282 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()))))), 18283 ; 18284 18285 final OnnxType.TypeVariable typeVariable; 18286 18287 TypeConstraint(OnnxType.TypeVariable typeVariable) { 18288 assert typeVariable.name().equals(name()); 18289 this.typeVariable = typeVariable; 18290 } 18291 18292 @Override 18293 public OnnxType.TypeVariable typeVariable() { 18294 return typeVariable; 18295 } 18296 } 18297 18298 public enum InputParameter implements OnnxParameter { 18299 input(TypeConstraint.O.typeVariable(), Quantifier.REQUIRED), 18300 ; 18301 18302 final OnnxType type; 18303 final Quantifier quantifier; 18304 18305 InputParameter(OnnxType type, Quantifier quantifier) { 18306 this.type = type; 18307 this.quantifier = quantifier; 18308 } 18309 18310 @Override 18311 public OnnxType type() { 18312 return type; 18313 } 18314 18315 @Override 18316 public Quantifier quantifier() { 18317 return quantifier; 18318 } 18319 } 18320 18321 public enum OutputParameter implements OnnxParameter { 18322 output(TypeConstraint.V.typeVariable(), Quantifier.REQUIRED), 18323 ; 18324 18325 final OnnxType type; 18326 final Quantifier quantifier; 18327 18328 OutputParameter(OnnxType type, Quantifier quantifier) { 18329 this.type = type; 18330 this.quantifier = quantifier; 18331 } 18332 18333 @Override 18334 public OnnxType type() { 18335 return type; 18336 } 18337 18338 @Override 18339 public Quantifier quantifier() { 18340 return quantifier; 18341 } 18342 } 18343 18344 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 18345 NAME, 18346 List.of(Attribute.values()), 18347 List.of(TypeConstraint.values()), 18348 List.of(InputParameter.values()), 18349 List.of(OutputParameter.values()) 18350 ); 18351 18352 public OptionalGetElement(ExternalizedOp def) { 18353 super(SCHEMA, def); 18354 } 18355 18356 OptionalGetElement(OptionalGetElement that, CopyContext cc) { 18357 super(that, cc); 18358 } 18359 18360 @Override 18361 public OptionalGetElement transform(CopyContext cc, OpTransformer ot) { 18362 return new OptionalGetElement(this, cc); 18363 } 18364 18365 OptionalGetElement(TypeElement resultType, Value input) { 18366 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 18367 } 18368 18369 @Override 18370 public SequencedSet<OnnxParameter> onnxOutputs() { 18371 return onnxOutputs(SCHEMA); 18372 } 18373 18374 @Override 18375 public SequencedMap<OnnxParameter, Object> onnxInputs() { 18376 return onnxInputs(SCHEMA, List.of(input())); 18377 } 18378 18379 public Value input() { 18380 return operands().get(0); 18381 } 18382 18383 } 18384 18385 public static OptionalGetElement OptionalGetElement(TypeElement resultType, Value input) { 18386 return new OptionalGetElement(resultType, input); 18387 } 18388 18389 @OpFactory.OpDeclaration(OptionalHasElement.NAME) 18390 public static final class OptionalHasElement extends OnnxOp { 18391 public static final String NAME = "OptionalHasElement"; 18392 18393 public enum Attribute implements OnnxAttribute.None { } 18394 18395 public enum TypeConstraint implements OnnxTypeConstraint { 18396 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()))))), 18397 B(new OnnxType.TypeVariable("B", List.of(OnnxType.tensor(OnnxType.bool())))), 18398 ; 18399 18400 final OnnxType.TypeVariable typeVariable; 18401 18402 TypeConstraint(OnnxType.TypeVariable typeVariable) { 18403 assert typeVariable.name().equals(name()); 18404 this.typeVariable = typeVariable; 18405 } 18406 18407 @Override 18408 public OnnxType.TypeVariable typeVariable() { 18409 return typeVariable; 18410 } 18411 } 18412 18413 public enum InputParameter implements OnnxParameter { 18414 input(TypeConstraint.O.typeVariable(), Quantifier.OPTIONAL), 18415 ; 18416 18417 final OnnxType type; 18418 final Quantifier quantifier; 18419 18420 InputParameter(OnnxType type, Quantifier quantifier) { 18421 this.type = type; 18422 this.quantifier = quantifier; 18423 } 18424 18425 @Override 18426 public OnnxType type() { 18427 return type; 18428 } 18429 18430 @Override 18431 public Quantifier quantifier() { 18432 return quantifier; 18433 } 18434 } 18435 18436 public enum OutputParameter implements OnnxParameter { 18437 output(TypeConstraint.B.typeVariable(), Quantifier.REQUIRED), 18438 ; 18439 18440 final OnnxType type; 18441 final Quantifier quantifier; 18442 18443 OutputParameter(OnnxType type, Quantifier quantifier) { 18444 this.type = type; 18445 this.quantifier = quantifier; 18446 } 18447 18448 @Override 18449 public OnnxType type() { 18450 return type; 18451 } 18452 18453 @Override 18454 public Quantifier quantifier() { 18455 return quantifier; 18456 } 18457 } 18458 18459 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 18460 NAME, 18461 List.of(Attribute.values()), 18462 List.of(TypeConstraint.values()), 18463 List.of(InputParameter.values()), 18464 List.of(OutputParameter.values()) 18465 ); 18466 18467 public OptionalHasElement(ExternalizedOp def) { 18468 super(SCHEMA, def); 18469 } 18470 18471 OptionalHasElement(OptionalHasElement that, CopyContext cc) { 18472 super(that, cc); 18473 } 18474 18475 @Override 18476 public OptionalHasElement transform(CopyContext cc, OpTransformer ot) { 18477 return new OptionalHasElement(this, cc); 18478 } 18479 18480 OptionalHasElement(TypeElement resultType, java.util.Optional<Value> input) { 18481 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 18482 } 18483 18484 @Override 18485 public SequencedSet<OnnxParameter> onnxOutputs() { 18486 return onnxOutputs(SCHEMA); 18487 } 18488 18489 @Override 18490 public SequencedMap<OnnxParameter, Object> onnxInputs() { 18491 return onnxInputs(SCHEMA, List.of(input())); 18492 } 18493 18494 public java.util.Optional<Value> input() { 18495 int i = optionalInputArguments.indexOf(InputParameter.input); 18496 return i != -1 ? java.util.Optional.of(operands().get(0 + i)) : java.util.Optional.empty(); 18497 } 18498 18499 } 18500 18501 public static OptionalHasElement OptionalHasElement(TypeElement resultType, java.util.Optional<Value> input) { 18502 return new OptionalHasElement(resultType, input); 18503 } 18504 18505 @OpFactory.OpDeclaration(Or.NAME) 18506 public static final class Or extends OnnxOp { 18507 public static final String NAME = "Or"; 18508 18509 public enum Attribute implements OnnxAttribute.None { } 18510 18511 public enum TypeConstraint implements OnnxTypeConstraint { 18512 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bool())))), 18513 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))), 18514 ; 18515 18516 final OnnxType.TypeVariable typeVariable; 18517 18518 TypeConstraint(OnnxType.TypeVariable typeVariable) { 18519 assert typeVariable.name().equals(name()); 18520 this.typeVariable = typeVariable; 18521 } 18522 18523 @Override 18524 public OnnxType.TypeVariable typeVariable() { 18525 return typeVariable; 18526 } 18527 } 18528 18529 public enum InputParameter implements OnnxParameter { 18530 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18531 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18532 ; 18533 18534 final OnnxType type; 18535 final Quantifier quantifier; 18536 18537 InputParameter(OnnxType type, Quantifier quantifier) { 18538 this.type = type; 18539 this.quantifier = quantifier; 18540 } 18541 18542 @Override 18543 public OnnxType type() { 18544 return type; 18545 } 18546 18547 @Override 18548 public Quantifier quantifier() { 18549 return quantifier; 18550 } 18551 } 18552 18553 public enum OutputParameter implements OnnxParameter { 18554 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 18555 ; 18556 18557 final OnnxType type; 18558 final Quantifier quantifier; 18559 18560 OutputParameter(OnnxType type, Quantifier quantifier) { 18561 this.type = type; 18562 this.quantifier = quantifier; 18563 } 18564 18565 @Override 18566 public OnnxType type() { 18567 return type; 18568 } 18569 18570 @Override 18571 public Quantifier quantifier() { 18572 return quantifier; 18573 } 18574 } 18575 18576 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 18577 NAME, 18578 List.of(Attribute.values()), 18579 List.of(TypeConstraint.values()), 18580 List.of(InputParameter.values()), 18581 List.of(OutputParameter.values()) 18582 ); 18583 18584 public Or(ExternalizedOp def) { 18585 super(SCHEMA, def); 18586 } 18587 18588 Or(Or that, CopyContext cc) { 18589 super(that, cc); 18590 } 18591 18592 @Override 18593 public Or transform(CopyContext cc, OpTransformer ot) { 18594 return new Or(this, cc); 18595 } 18596 18597 Or(TypeElement resultType, Value A, Value B) { 18598 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 18599 } 18600 18601 @Override 18602 public SequencedSet<OnnxParameter> onnxOutputs() { 18603 return onnxOutputs(SCHEMA); 18604 } 18605 18606 @Override 18607 public SequencedMap<OnnxParameter, Object> onnxInputs() { 18608 return onnxInputs(SCHEMA, List.of(A(), B())); 18609 } 18610 18611 public Value A() { 18612 return operands().get(0); 18613 } 18614 18615 public Value B() { 18616 return operands().get(1); 18617 } 18618 18619 } 18620 18621 public static Or Or(TypeElement resultType, Value A, Value B) { 18622 return new Or(resultType, A, B); 18623 } 18624 18625 @OpFactory.OpDeclaration(PRelu.NAME) 18626 public static final class PRelu extends OnnxOp { 18627 public static final String NAME = "PRelu"; 18628 18629 public enum Attribute implements OnnxAttribute.None { } 18630 18631 public enum TypeConstraint implements OnnxTypeConstraint { 18632 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())))), 18633 ; 18634 18635 final OnnxType.TypeVariable typeVariable; 18636 18637 TypeConstraint(OnnxType.TypeVariable typeVariable) { 18638 assert typeVariable.name().equals(name()); 18639 this.typeVariable = typeVariable; 18640 } 18641 18642 @Override 18643 public OnnxType.TypeVariable typeVariable() { 18644 return typeVariable; 18645 } 18646 } 18647 18648 public enum InputParameter implements OnnxParameter { 18649 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18650 slope(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18651 ; 18652 18653 final OnnxType type; 18654 final Quantifier quantifier; 18655 18656 InputParameter(OnnxType type, Quantifier quantifier) { 18657 this.type = type; 18658 this.quantifier = quantifier; 18659 } 18660 18661 @Override 18662 public OnnxType type() { 18663 return type; 18664 } 18665 18666 @Override 18667 public Quantifier quantifier() { 18668 return quantifier; 18669 } 18670 } 18671 18672 public enum OutputParameter implements OnnxParameter { 18673 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18674 ; 18675 18676 final OnnxType type; 18677 final Quantifier quantifier; 18678 18679 OutputParameter(OnnxType type, Quantifier quantifier) { 18680 this.type = type; 18681 this.quantifier = quantifier; 18682 } 18683 18684 @Override 18685 public OnnxType type() { 18686 return type; 18687 } 18688 18689 @Override 18690 public Quantifier quantifier() { 18691 return quantifier; 18692 } 18693 } 18694 18695 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 18696 NAME, 18697 List.of(Attribute.values()), 18698 List.of(TypeConstraint.values()), 18699 List.of(InputParameter.values()), 18700 List.of(OutputParameter.values()) 18701 ); 18702 18703 public PRelu(ExternalizedOp def) { 18704 super(SCHEMA, def); 18705 } 18706 18707 PRelu(PRelu that, CopyContext cc) { 18708 super(that, cc); 18709 } 18710 18711 @Override 18712 public PRelu transform(CopyContext cc, OpTransformer ot) { 18713 return new PRelu(this, cc); 18714 } 18715 18716 PRelu(TypeElement resultType, Value X, Value slope) { 18717 super(SCHEMA, resultType, Set.of(), List.of(X, slope), List.of()); 18718 } 18719 18720 @Override 18721 public SequencedSet<OnnxParameter> onnxOutputs() { 18722 return onnxOutputs(SCHEMA); 18723 } 18724 18725 @Override 18726 public SequencedMap<OnnxParameter, Object> onnxInputs() { 18727 return onnxInputs(SCHEMA, List.of(X(), slope())); 18728 } 18729 18730 public Value X() { 18731 return operands().get(0); 18732 } 18733 18734 public Value slope() { 18735 return operands().get(1); 18736 } 18737 18738 } 18739 18740 public static PRelu PRelu(TypeElement resultType, Value X, Value slope) { 18741 return new PRelu(resultType, X, slope); 18742 } 18743 18744 @OpFactory.OpDeclaration(Pad.NAME) 18745 public static final class Pad extends OnnxOp { 18746 public static final String NAME = "Pad"; 18747 18748 public enum Attribute implements OnnxAttribute { 18749 mode(String.class, true, "constant"), 18750 ; 18751 18752 final Class<?> t; 18753 final boolean optional; 18754 final Object defaultValue; 18755 18756 Attribute(Class<?> type, boolean optional, Object defaultValue) { 18757 this.t = type; 18758 this.optional = optional; 18759 this.defaultValue = defaultValue; 18760 assert optional || defaultValue == null; 18761 } 18762 18763 public Class<?> type() { 18764 return t; 18765 } 18766 18767 public boolean isOptional() { 18768 return optional; 18769 } 18770 18771 public Object defaultValue() { 18772 return defaultValue; 18773 } 18774 } 18775 18776 public enum TypeConstraint implements OnnxTypeConstraint { 18777 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())))), 18778 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 18779 ; 18780 18781 final OnnxType.TypeVariable typeVariable; 18782 18783 TypeConstraint(OnnxType.TypeVariable typeVariable) { 18784 assert typeVariable.name().equals(name()); 18785 this.typeVariable = typeVariable; 18786 } 18787 18788 @Override 18789 public OnnxType.TypeVariable typeVariable() { 18790 return typeVariable; 18791 } 18792 } 18793 18794 public enum InputParameter implements OnnxParameter { 18795 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18796 pads(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 18797 constant_value(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 18798 axes(TypeConstraint.Tind.typeVariable(), Quantifier.OPTIONAL), 18799 ; 18800 18801 final OnnxType type; 18802 final Quantifier quantifier; 18803 18804 InputParameter(OnnxType type, Quantifier quantifier) { 18805 this.type = type; 18806 this.quantifier = quantifier; 18807 } 18808 18809 @Override 18810 public OnnxType type() { 18811 return type; 18812 } 18813 18814 @Override 18815 public Quantifier quantifier() { 18816 return quantifier; 18817 } 18818 } 18819 18820 public enum OutputParameter implements OnnxParameter { 18821 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18822 ; 18823 18824 final OnnxType type; 18825 final Quantifier quantifier; 18826 18827 OutputParameter(OnnxType type, Quantifier quantifier) { 18828 this.type = type; 18829 this.quantifier = quantifier; 18830 } 18831 18832 @Override 18833 public OnnxType type() { 18834 return type; 18835 } 18836 18837 @Override 18838 public Quantifier quantifier() { 18839 return quantifier; 18840 } 18841 } 18842 18843 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 18844 NAME, 18845 List.of(Attribute.values()), 18846 List.of(TypeConstraint.values()), 18847 List.of(InputParameter.values()), 18848 List.of(OutputParameter.values()) 18849 ); 18850 18851 public Pad(ExternalizedOp def) { 18852 super(SCHEMA, def); 18853 } 18854 18855 Pad(Pad that, CopyContext cc) { 18856 super(that, cc); 18857 } 18858 18859 @Override 18860 public Pad transform(CopyContext cc, OpTransformer ot) { 18861 return new Pad(this, cc); 18862 } 18863 18864 Pad(TypeElement resultType, Value data, Value pads, java.util.Optional<Value> constant_value, java.util.Optional<Value> axes, java.util.Optional<String> mode) { 18865 super(SCHEMA, resultType, Set.of(), List.of(data, pads, constant_value, axes), List.of(mode)); 18866 } 18867 18868 @Override 18869 public SequencedSet<OnnxParameter> onnxOutputs() { 18870 return onnxOutputs(SCHEMA); 18871 } 18872 18873 @Override 18874 public SequencedMap<OnnxParameter, Object> onnxInputs() { 18875 return onnxInputs(SCHEMA, List.of(data(), pads(), constant_value(), axes())); 18876 } 18877 18878 public Value data() { 18879 return operands().get(0); 18880 } 18881 18882 public Value pads() { 18883 return operands().get(1); 18884 } 18885 18886 public java.util.Optional<Value> constant_value() { 18887 int i = optionalInputArguments.indexOf(InputParameter.constant_value); 18888 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 18889 } 18890 18891 public java.util.Optional<Value> axes() { 18892 int i = optionalInputArguments.indexOf(InputParameter.axes); 18893 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 18894 } 18895 18896 public java.util.Optional<String> mode() { 18897 String mode = Attribute.mode.access(String.class, onnxAttributes); 18898 return java.util.Optional.ofNullable(mode); 18899 } 18900 18901 } 18902 18903 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) { 18904 return new Pad(resultType, data, pads, constant_value, axes, mode); 18905 } 18906 18907 @OpFactory.OpDeclaration(Pow.NAME) 18908 public static final class Pow extends OnnxOp { 18909 public static final String NAME = "Pow"; 18910 18911 public enum Attribute implements OnnxAttribute.None { } 18912 18913 public enum TypeConstraint implements OnnxTypeConstraint { 18914 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())))), 18915 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())))), 18916 ; 18917 18918 final OnnxType.TypeVariable typeVariable; 18919 18920 TypeConstraint(OnnxType.TypeVariable typeVariable) { 18921 assert typeVariable.name().equals(name()); 18922 this.typeVariable = typeVariable; 18923 } 18924 18925 @Override 18926 public OnnxType.TypeVariable typeVariable() { 18927 return typeVariable; 18928 } 18929 } 18930 18931 public enum InputParameter implements OnnxParameter { 18932 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18933 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 18934 ; 18935 18936 final OnnxType type; 18937 final Quantifier quantifier; 18938 18939 InputParameter(OnnxType type, Quantifier quantifier) { 18940 this.type = type; 18941 this.quantifier = quantifier; 18942 } 18943 18944 @Override 18945 public OnnxType type() { 18946 return type; 18947 } 18948 18949 @Override 18950 public Quantifier quantifier() { 18951 return quantifier; 18952 } 18953 } 18954 18955 public enum OutputParameter implements OnnxParameter { 18956 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 18957 ; 18958 18959 final OnnxType type; 18960 final Quantifier quantifier; 18961 18962 OutputParameter(OnnxType type, Quantifier quantifier) { 18963 this.type = type; 18964 this.quantifier = quantifier; 18965 } 18966 18967 @Override 18968 public OnnxType type() { 18969 return type; 18970 } 18971 18972 @Override 18973 public Quantifier quantifier() { 18974 return quantifier; 18975 } 18976 } 18977 18978 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 18979 NAME, 18980 List.of(Attribute.values()), 18981 List.of(TypeConstraint.values()), 18982 List.of(InputParameter.values()), 18983 List.of(OutputParameter.values()) 18984 ); 18985 18986 public Pow(ExternalizedOp def) { 18987 super(SCHEMA, def); 18988 } 18989 18990 Pow(Pow that, CopyContext cc) { 18991 super(that, cc); 18992 } 18993 18994 @Override 18995 public Pow transform(CopyContext cc, OpTransformer ot) { 18996 return new Pow(this, cc); 18997 } 18998 18999 Pow(TypeElement resultType, Value X, Value Y) { 19000 super(SCHEMA, resultType, Set.of(), List.of(X, Y), List.of()); 19001 } 19002 19003 @Override 19004 public SequencedSet<OnnxParameter> onnxOutputs() { 19005 return onnxOutputs(SCHEMA); 19006 } 19007 19008 @Override 19009 public SequencedMap<OnnxParameter, Object> onnxInputs() { 19010 return onnxInputs(SCHEMA, List.of(X(), Y())); 19011 } 19012 19013 public Value X() { 19014 return operands().get(0); 19015 } 19016 19017 public Value Y() { 19018 return operands().get(1); 19019 } 19020 19021 } 19022 19023 public static Pow Pow(TypeElement resultType, Value X, Value Y) { 19024 return new Pow(resultType, X, Y); 19025 } 19026 19027 @OpFactory.OpDeclaration(QLinearConv.NAME) 19028 public static final class QLinearConv extends OnnxOp { 19029 public static final String NAME = "QLinearConv"; 19030 19031 public enum Attribute implements OnnxAttribute { 19032 pads(long[].class, true, null), 19033 dilations(long[].class, true, null), 19034 auto_pad(String.class, true, "NOTSET"), 19035 strides(long[].class, true, null), 19036 group(Long.class, true, 1), 19037 kernel_shape(long[].class, true, null), 19038 ; 19039 19040 final Class<?> t; 19041 final boolean optional; 19042 final Object defaultValue; 19043 19044 Attribute(Class<?> type, boolean optional, Object defaultValue) { 19045 this.t = type; 19046 this.optional = optional; 19047 this.defaultValue = defaultValue; 19048 assert optional || defaultValue == null; 19049 } 19050 19051 public Class<?> type() { 19052 return t; 19053 } 19054 19055 public boolean isOptional() { 19056 return optional; 19057 } 19058 19059 public Object defaultValue() { 19060 return defaultValue; 19061 } 19062 } 19063 19064 public enum TypeConstraint implements OnnxTypeConstraint { 19065 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))), 19066 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))), 19067 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int8()), OnnxType.tensor(OnnxType.uint8())))), 19068 T4(new OnnxType.TypeVariable("T4", List.of(OnnxType.tensor(OnnxType.int32())))), 19069 ; 19070 19071 final OnnxType.TypeVariable typeVariable; 19072 19073 TypeConstraint(OnnxType.TypeVariable typeVariable) { 19074 assert typeVariable.name().equals(name()); 19075 this.typeVariable = typeVariable; 19076 } 19077 19078 @Override 19079 public OnnxType.TypeVariable typeVariable() { 19080 return typeVariable; 19081 } 19082 } 19083 19084 public enum InputParameter implements OnnxParameter { 19085 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 19086 x_scale(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 19087 x_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 19088 w(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 19089 w_scale(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 19090 w_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 19091 y_scale(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 19092 y_zero_point(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 19093 B(TypeConstraint.T4.typeVariable(), Quantifier.OPTIONAL), 19094 ; 19095 19096 final OnnxType type; 19097 final Quantifier quantifier; 19098 19099 InputParameter(OnnxType type, Quantifier quantifier) { 19100 this.type = type; 19101 this.quantifier = quantifier; 19102 } 19103 19104 @Override 19105 public OnnxType type() { 19106 return type; 19107 } 19108 19109 @Override 19110 public Quantifier quantifier() { 19111 return quantifier; 19112 } 19113 } 19114 19115 public enum OutputParameter implements OnnxParameter { 19116 y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 19117 ; 19118 19119 final OnnxType type; 19120 final Quantifier quantifier; 19121 19122 OutputParameter(OnnxType type, Quantifier quantifier) { 19123 this.type = type; 19124 this.quantifier = quantifier; 19125 } 19126 19127 @Override 19128 public OnnxType type() { 19129 return type; 19130 } 19131 19132 @Override 19133 public Quantifier quantifier() { 19134 return quantifier; 19135 } 19136 } 19137 19138 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 19139 NAME, 19140 List.of(Attribute.values()), 19141 List.of(TypeConstraint.values()), 19142 List.of(InputParameter.values()), 19143 List.of(OutputParameter.values()) 19144 ); 19145 19146 public QLinearConv(ExternalizedOp def) { 19147 super(SCHEMA, def); 19148 } 19149 19150 QLinearConv(QLinearConv that, CopyContext cc) { 19151 super(that, cc); 19152 } 19153 19154 @Override 19155 public QLinearConv transform(CopyContext cc, OpTransformer ot) { 19156 return new QLinearConv(this, cc); 19157 } 19158 19159 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) { 19160 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)); 19161 } 19162 19163 @Override 19164 public SequencedSet<OnnxParameter> onnxOutputs() { 19165 return onnxOutputs(SCHEMA); 19166 } 19167 19168 @Override 19169 public SequencedMap<OnnxParameter, Object> onnxInputs() { 19170 return onnxInputs(SCHEMA, List.of(x(), x_scale(), x_zero_point(), w(), w_scale(), w_zero_point(), y_scale(), y_zero_point(), B())); 19171 } 19172 19173 public Value x() { 19174 return operands().get(0); 19175 } 19176 19177 public Value x_scale() { 19178 return operands().get(1); 19179 } 19180 19181 public Value x_zero_point() { 19182 return operands().get(2); 19183 } 19184 19185 public Value w() { 19186 return operands().get(3); 19187 } 19188 19189 public Value w_scale() { 19190 return operands().get(4); 19191 } 19192 19193 public Value w_zero_point() { 19194 return operands().get(5); 19195 } 19196 19197 public Value y_scale() { 19198 return operands().get(6); 19199 } 19200 19201 public Value y_zero_point() { 19202 return operands().get(7); 19203 } 19204 19205 public java.util.Optional<Value> B() { 19206 int i = optionalInputArguments.indexOf(InputParameter.B); 19207 return i != -1 ? java.util.Optional.of(operands().get(8 + i)) : java.util.Optional.empty(); 19208 } 19209 19210 public java.util.Optional<long[]> pads() { 19211 long[] pads = Attribute.pads.access(long[].class, onnxAttributes); 19212 return java.util.Optional.ofNullable(pads).map(long[]::clone); 19213 } 19214 19215 public java.util.Optional<long[]> dilations() { 19216 long[] dilations = Attribute.dilations.access(long[].class, onnxAttributes); 19217 return java.util.Optional.ofNullable(dilations).map(long[]::clone); 19218 } 19219 19220 public java.util.Optional<String> auto_pad() { 19221 String auto_pad = Attribute.auto_pad.access(String.class, onnxAttributes); 19222 return java.util.Optional.ofNullable(auto_pad); 19223 } 19224 19225 public java.util.Optional<long[]> strides() { 19226 long[] strides = Attribute.strides.access(long[].class, onnxAttributes); 19227 return java.util.Optional.ofNullable(strides).map(long[]::clone); 19228 } 19229 19230 public java.util.Optional<Long> group() { 19231 Long group = Attribute.group.access(Long.class, onnxAttributes); 19232 return java.util.Optional.ofNullable(group); 19233 } 19234 19235 public java.util.Optional<long[]> kernel_shape() { 19236 long[] kernel_shape = Attribute.kernel_shape.access(long[].class, onnxAttributes); 19237 return java.util.Optional.ofNullable(kernel_shape).map(long[]::clone); 19238 } 19239 19240 } 19241 19242 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) { 19243 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); 19244 } 19245 19246 @OpFactory.OpDeclaration(QLinearMatMul.NAME) 19247 public static final class QLinearMatMul extends OnnxOp { 19248 public static final String NAME = "QLinearMatMul"; 19249 19250 public enum Attribute implements OnnxAttribute.None { } 19251 19252 public enum TypeConstraint implements OnnxTypeConstraint { 19253 TS(new OnnxType.TypeVariable("TS", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16())))), 19254 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())))), 19255 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())))), 19256 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())))), 19257 ; 19258 19259 final OnnxType.TypeVariable typeVariable; 19260 19261 TypeConstraint(OnnxType.TypeVariable typeVariable) { 19262 assert typeVariable.name().equals(name()); 19263 this.typeVariable = typeVariable; 19264 } 19265 19266 @Override 19267 public OnnxType.TypeVariable typeVariable() { 19268 return typeVariable; 19269 } 19270 } 19271 19272 public enum InputParameter implements OnnxParameter { 19273 a(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 19274 a_scale(TypeConstraint.TS.typeVariable(), Quantifier.REQUIRED), 19275 a_zero_point(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 19276 b(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 19277 b_scale(TypeConstraint.TS.typeVariable(), Quantifier.REQUIRED), 19278 b_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 19279 y_scale(TypeConstraint.TS.typeVariable(), Quantifier.REQUIRED), 19280 y_zero_point(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 19281 ; 19282 19283 final OnnxType type; 19284 final Quantifier quantifier; 19285 19286 InputParameter(OnnxType type, Quantifier quantifier) { 19287 this.type = type; 19288 this.quantifier = quantifier; 19289 } 19290 19291 @Override 19292 public OnnxType type() { 19293 return type; 19294 } 19295 19296 @Override 19297 public Quantifier quantifier() { 19298 return quantifier; 19299 } 19300 } 19301 19302 public enum OutputParameter implements OnnxParameter { 19303 y(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 19304 ; 19305 19306 final OnnxType type; 19307 final Quantifier quantifier; 19308 19309 OutputParameter(OnnxType type, Quantifier quantifier) { 19310 this.type = type; 19311 this.quantifier = quantifier; 19312 } 19313 19314 @Override 19315 public OnnxType type() { 19316 return type; 19317 } 19318 19319 @Override 19320 public Quantifier quantifier() { 19321 return quantifier; 19322 } 19323 } 19324 19325 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 19326 NAME, 19327 List.of(Attribute.values()), 19328 List.of(TypeConstraint.values()), 19329 List.of(InputParameter.values()), 19330 List.of(OutputParameter.values()) 19331 ); 19332 19333 public QLinearMatMul(ExternalizedOp def) { 19334 super(SCHEMA, def); 19335 } 19336 19337 QLinearMatMul(QLinearMatMul that, CopyContext cc) { 19338 super(that, cc); 19339 } 19340 19341 @Override 19342 public QLinearMatMul transform(CopyContext cc, OpTransformer ot) { 19343 return new QLinearMatMul(this, cc); 19344 } 19345 19346 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) { 19347 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()); 19348 } 19349 19350 @Override 19351 public SequencedSet<OnnxParameter> onnxOutputs() { 19352 return onnxOutputs(SCHEMA); 19353 } 19354 19355 @Override 19356 public SequencedMap<OnnxParameter, Object> onnxInputs() { 19357 return onnxInputs(SCHEMA, List.of(a(), a_scale(), a_zero_point(), b(), b_scale(), b_zero_point(), y_scale(), y_zero_point())); 19358 } 19359 19360 public Value a() { 19361 return operands().get(0); 19362 } 19363 19364 public Value a_scale() { 19365 return operands().get(1); 19366 } 19367 19368 public Value a_zero_point() { 19369 return operands().get(2); 19370 } 19371 19372 public Value b() { 19373 return operands().get(3); 19374 } 19375 19376 public Value b_scale() { 19377 return operands().get(4); 19378 } 19379 19380 public Value b_zero_point() { 19381 return operands().get(5); 19382 } 19383 19384 public Value y_scale() { 19385 return operands().get(6); 19386 } 19387 19388 public Value y_zero_point() { 19389 return operands().get(7); 19390 } 19391 19392 } 19393 19394 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) { 19395 return new QLinearMatMul(resultType, a, a_scale, a_zero_point, b, b_scale, b_zero_point, y_scale, y_zero_point); 19396 } 19397 19398 @OpFactory.OpDeclaration(QuantizeLinear.NAME) 19399 public static final class QuantizeLinear extends OnnxOp { 19400 public static final String NAME = "QuantizeLinear"; 19401 19402 public enum Attribute implements OnnxAttribute { 19403 output_dtype(Long.class, true, 0), 19404 saturate(Long.class, true, 1), 19405 axis(Long.class, true, 1), 19406 block_size(Long.class, true, 0), 19407 ; 19408 19409 final Class<?> t; 19410 final boolean optional; 19411 final Object defaultValue; 19412 19413 Attribute(Class<?> type, boolean optional, Object defaultValue) { 19414 this.t = type; 19415 this.optional = optional; 19416 this.defaultValue = defaultValue; 19417 assert optional || defaultValue == null; 19418 } 19419 19420 public Class<?> type() { 19421 return t; 19422 } 19423 19424 public boolean isOptional() { 19425 return optional; 19426 } 19427 19428 public Object defaultValue() { 19429 return defaultValue; 19430 } 19431 } 19432 19433 public enum TypeConstraint implements OnnxTypeConstraint { 19434 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.int32())))), 19435 T2(new OnnxType.TypeVariable("T2", 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())))), 19436 ; 19437 19438 final OnnxType.TypeVariable typeVariable; 19439 19440 TypeConstraint(OnnxType.TypeVariable typeVariable) { 19441 assert typeVariable.name().equals(name()); 19442 this.typeVariable = typeVariable; 19443 } 19444 19445 @Override 19446 public OnnxType.TypeVariable typeVariable() { 19447 return typeVariable; 19448 } 19449 } 19450 19451 public enum InputParameter implements OnnxParameter { 19452 x(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 19453 y_scale(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 19454 y_zero_point(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 19455 ; 19456 19457 final OnnxType type; 19458 final Quantifier quantifier; 19459 19460 InputParameter(OnnxType type, Quantifier quantifier) { 19461 this.type = type; 19462 this.quantifier = quantifier; 19463 } 19464 19465 @Override 19466 public OnnxType type() { 19467 return type; 19468 } 19469 19470 @Override 19471 public Quantifier quantifier() { 19472 return quantifier; 19473 } 19474 } 19475 19476 public enum OutputParameter implements OnnxParameter { 19477 y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 19478 ; 19479 19480 final OnnxType type; 19481 final Quantifier quantifier; 19482 19483 OutputParameter(OnnxType type, Quantifier quantifier) { 19484 this.type = type; 19485 this.quantifier = quantifier; 19486 } 19487 19488 @Override 19489 public OnnxType type() { 19490 return type; 19491 } 19492 19493 @Override 19494 public Quantifier quantifier() { 19495 return quantifier; 19496 } 19497 } 19498 19499 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 19500 NAME, 19501 List.of(Attribute.values()), 19502 List.of(TypeConstraint.values()), 19503 List.of(InputParameter.values()), 19504 List.of(OutputParameter.values()) 19505 ); 19506 19507 public QuantizeLinear(ExternalizedOp def) { 19508 super(SCHEMA, def); 19509 } 19510 19511 QuantizeLinear(QuantizeLinear that, CopyContext cc) { 19512 super(that, cc); 19513 } 19514 19515 @Override 19516 public QuantizeLinear transform(CopyContext cc, OpTransformer ot) { 19517 return new QuantizeLinear(this, cc); 19518 } 19519 19520 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> axis, java.util.Optional<Long> block_size) { 19521 super(SCHEMA, resultType, Set.of(), List.of(x, y_scale, y_zero_point), List.of(output_dtype, saturate, axis, block_size)); 19522 } 19523 19524 @Override 19525 public SequencedSet<OnnxParameter> onnxOutputs() { 19526 return onnxOutputs(SCHEMA); 19527 } 19528 19529 @Override 19530 public SequencedMap<OnnxParameter, Object> onnxInputs() { 19531 return onnxInputs(SCHEMA, List.of(x(), y_scale(), y_zero_point())); 19532 } 19533 19534 public Value x() { 19535 return operands().get(0); 19536 } 19537 19538 public Value y_scale() { 19539 return operands().get(1); 19540 } 19541 19542 public java.util.Optional<Value> y_zero_point() { 19543 int i = optionalInputArguments.indexOf(InputParameter.y_zero_point); 19544 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 19545 } 19546 19547 public java.util.Optional<Long> output_dtype() { 19548 Long output_dtype = Attribute.output_dtype.access(Long.class, onnxAttributes); 19549 return java.util.Optional.ofNullable(output_dtype); 19550 } 19551 19552 public java.util.Optional<Long> saturate() { 19553 Long saturate = Attribute.saturate.access(Long.class, onnxAttributes); 19554 return java.util.Optional.ofNullable(saturate); 19555 } 19556 19557 public java.util.Optional<Long> axis() { 19558 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 19559 return java.util.Optional.ofNullable(axis); 19560 } 19561 19562 public java.util.Optional<Long> block_size() { 19563 Long block_size = Attribute.block_size.access(Long.class, onnxAttributes); 19564 return java.util.Optional.ofNullable(block_size); 19565 } 19566 19567 } 19568 19569 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> axis, java.util.Optional<Long> block_size) { 19570 return new QuantizeLinear(resultType, x, y_scale, y_zero_point, output_dtype, saturate, axis, block_size); 19571 } 19572 19573 @OpFactory.OpDeclaration(RNN.NAME) 19574 public static final class RNN extends OnnxOp { 19575 public static final String NAME = "RNN"; 19576 19577 public enum Attribute implements OnnxAttribute { 19578 layout(Long.class, true, 0), 19579 activation_alpha(float[].class, true, null), 19580 hidden_size(Long.class, true, null), 19581 activation_beta(float[].class, true, null), 19582 activations(String[].class, true, null), 19583 clip(Float.class, true, null), 19584 direction(String.class, true, "forward"), 19585 ; 19586 19587 final Class<?> t; 19588 final boolean optional; 19589 final Object defaultValue; 19590 19591 Attribute(Class<?> type, boolean optional, Object defaultValue) { 19592 this.t = type; 19593 this.optional = optional; 19594 this.defaultValue = defaultValue; 19595 assert optional || defaultValue == null; 19596 } 19597 19598 public Class<?> type() { 19599 return t; 19600 } 19601 19602 public boolean isOptional() { 19603 return optional; 19604 } 19605 19606 public Object defaultValue() { 19607 return defaultValue; 19608 } 19609 } 19610 19611 public enum TypeConstraint implements OnnxTypeConstraint { 19612 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 19613 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int32())))), 19614 ; 19615 19616 final OnnxType.TypeVariable typeVariable; 19617 19618 TypeConstraint(OnnxType.TypeVariable typeVariable) { 19619 assert typeVariable.name().equals(name()); 19620 this.typeVariable = typeVariable; 19621 } 19622 19623 @Override 19624 public OnnxType.TypeVariable typeVariable() { 19625 return typeVariable; 19626 } 19627 } 19628 19629 public enum InputParameter implements OnnxParameter { 19630 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 19631 W(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 19632 R(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 19633 B(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 19634 sequence_lens(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL), 19635 initial_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 19636 ; 19637 19638 final OnnxType type; 19639 final Quantifier quantifier; 19640 19641 InputParameter(OnnxType type, Quantifier quantifier) { 19642 this.type = type; 19643 this.quantifier = quantifier; 19644 } 19645 19646 @Override 19647 public OnnxType type() { 19648 return type; 19649 } 19650 19651 @Override 19652 public Quantifier quantifier() { 19653 return quantifier; 19654 } 19655 } 19656 19657 public enum OutputParameter implements OnnxParameter { 19658 Y(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 19659 Y_h(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 19660 ; 19661 19662 final OnnxType type; 19663 final Quantifier quantifier; 19664 19665 OutputParameter(OnnxType type, Quantifier quantifier) { 19666 this.type = type; 19667 this.quantifier = quantifier; 19668 } 19669 19670 @Override 19671 public OnnxType type() { 19672 return type; 19673 } 19674 19675 @Override 19676 public Quantifier quantifier() { 19677 return quantifier; 19678 } 19679 } 19680 19681 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 19682 NAME, 19683 List.of(Attribute.values()), 19684 List.of(TypeConstraint.values()), 19685 List.of(InputParameter.values()), 19686 List.of(OutputParameter.values()) 19687 ); 19688 19689 public RNN(ExternalizedOp def) { 19690 super(SCHEMA, def); 19691 } 19692 19693 RNN(RNN that, CopyContext cc) { 19694 super(that, cc); 19695 } 19696 19697 @Override 19698 public RNN transform(CopyContext cc, OpTransformer ot) { 19699 return new RNN(this, cc); 19700 } 19701 19702 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) { 19703 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)); 19704 } 19705 19706 @Override 19707 public SequencedSet<OnnxParameter> onnxOutputs() { 19708 return onnxOutputs(SCHEMA); 19709 } 19710 19711 @Override 19712 public SequencedMap<OnnxParameter, Object> onnxInputs() { 19713 return onnxInputs(SCHEMA, List.of(X(), W(), R(), B(), sequence_lens(), initial_h())); 19714 } 19715 19716 public Value X() { 19717 return operands().get(0); 19718 } 19719 19720 public Value W() { 19721 return operands().get(1); 19722 } 19723 19724 public Value R() { 19725 return operands().get(2); 19726 } 19727 19728 public java.util.Optional<Value> B() { 19729 int i = optionalInputArguments.indexOf(InputParameter.B); 19730 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 19731 } 19732 19733 public java.util.Optional<Value> sequence_lens() { 19734 int i = optionalInputArguments.indexOf(InputParameter.sequence_lens); 19735 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 19736 } 19737 19738 public java.util.Optional<Value> initial_h() { 19739 int i = optionalInputArguments.indexOf(InputParameter.initial_h); 19740 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 19741 } 19742 19743 public java.util.Optional<Long> layout() { 19744 Long layout = Attribute.layout.access(Long.class, onnxAttributes); 19745 return java.util.Optional.ofNullable(layout); 19746 } 19747 19748 public java.util.Optional<float[]> activation_alpha() { 19749 float[] activation_alpha = Attribute.activation_alpha.access(float[].class, onnxAttributes); 19750 return java.util.Optional.ofNullable(activation_alpha).map(float[]::clone); 19751 } 19752 19753 public java.util.Optional<Long> hidden_size() { 19754 Long hidden_size = Attribute.hidden_size.access(Long.class, onnxAttributes); 19755 return java.util.Optional.ofNullable(hidden_size); 19756 } 19757 19758 public java.util.Optional<float[]> activation_beta() { 19759 float[] activation_beta = Attribute.activation_beta.access(float[].class, onnxAttributes); 19760 return java.util.Optional.ofNullable(activation_beta).map(float[]::clone); 19761 } 19762 19763 public java.util.Optional<String[]> activations() { 19764 String[] activations = Attribute.activations.access(String[].class, onnxAttributes); 19765 return java.util.Optional.ofNullable(activations).map(String[]::clone); 19766 } 19767 19768 public java.util.Optional<Float> clip() { 19769 Float clip = Attribute.clip.access(Float.class, onnxAttributes); 19770 return java.util.Optional.ofNullable(clip); 19771 } 19772 19773 public java.util.Optional<String> direction() { 19774 String direction = Attribute.direction.access(String.class, onnxAttributes); 19775 return java.util.Optional.ofNullable(direction); 19776 } 19777 19778 } 19779 19780 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) { 19781 return new RNN(resultType, optionalOutputs, X, W, R, B, sequence_lens, initial_h, layout, activation_alpha, hidden_size, activation_beta, activations, clip, direction); 19782 } 19783 19784 @OpFactory.OpDeclaration(RandomNormal.NAME) 19785 public static final class RandomNormal extends OnnxOp { 19786 public static final String NAME = "RandomNormal"; 19787 19788 public enum Attribute implements OnnxAttribute { 19789 shape(long[].class, false, null), 19790 seed(Float.class, true, null), 19791 mean(Float.class, true, 0.0f), 19792 scale(Float.class, true, 1.0f), 19793 dtype(Long.class, true, 1), 19794 ; 19795 19796 final Class<?> t; 19797 final boolean optional; 19798 final Object defaultValue; 19799 19800 Attribute(Class<?> type, boolean optional, Object defaultValue) { 19801 this.t = type; 19802 this.optional = optional; 19803 this.defaultValue = defaultValue; 19804 assert optional || defaultValue == null; 19805 } 19806 19807 public Class<?> type() { 19808 return t; 19809 } 19810 19811 public boolean isOptional() { 19812 return optional; 19813 } 19814 19815 public Object defaultValue() { 19816 return defaultValue; 19817 } 19818 } 19819 19820 public enum TypeConstraint implements OnnxTypeConstraint { 19821 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 19822 ; 19823 19824 final OnnxType.TypeVariable typeVariable; 19825 19826 TypeConstraint(OnnxType.TypeVariable typeVariable) { 19827 assert typeVariable.name().equals(name()); 19828 this.typeVariable = typeVariable; 19829 } 19830 19831 @Override 19832 public OnnxType.TypeVariable typeVariable() { 19833 return typeVariable; 19834 } 19835 } 19836 19837 public enum InputParameter implements OnnxParameter.None { } 19838 19839 public enum OutputParameter implements OnnxParameter { 19840 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 19841 ; 19842 19843 final OnnxType type; 19844 final Quantifier quantifier; 19845 19846 OutputParameter(OnnxType type, Quantifier quantifier) { 19847 this.type = type; 19848 this.quantifier = quantifier; 19849 } 19850 19851 @Override 19852 public OnnxType type() { 19853 return type; 19854 } 19855 19856 @Override 19857 public Quantifier quantifier() { 19858 return quantifier; 19859 } 19860 } 19861 19862 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 19863 NAME, 19864 List.of(Attribute.values()), 19865 List.of(TypeConstraint.values()), 19866 List.of(InputParameter.values()), 19867 List.of(OutputParameter.values()) 19868 ); 19869 19870 public RandomNormal(ExternalizedOp def) { 19871 super(SCHEMA, def); 19872 } 19873 19874 RandomNormal(RandomNormal that, CopyContext cc) { 19875 super(that, cc); 19876 } 19877 19878 @Override 19879 public RandomNormal transform(CopyContext cc, OpTransformer ot) { 19880 return new RandomNormal(this, cc); 19881 } 19882 19883 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) { 19884 super(SCHEMA, resultType, Set.of(), List.of(), List.of(shape, seed, mean, scale, dtype)); 19885 } 19886 19887 @Override 19888 public SequencedSet<OnnxParameter> onnxOutputs() { 19889 return onnxOutputs(SCHEMA); 19890 } 19891 19892 @Override 19893 public SequencedMap<OnnxParameter, Object> onnxInputs() { 19894 return onnxInputs(SCHEMA, List.of()); 19895 } 19896 19897 public long[] shape() { 19898 long[] shape = Attribute.shape.access(long[].class, onnxAttributes); 19899 return shape.clone(); 19900 } 19901 19902 public java.util.Optional<Float> seed() { 19903 Float seed = Attribute.seed.access(Float.class, onnxAttributes); 19904 return java.util.Optional.ofNullable(seed); 19905 } 19906 19907 public java.util.Optional<Float> mean() { 19908 Float mean = Attribute.mean.access(Float.class, onnxAttributes); 19909 return java.util.Optional.ofNullable(mean); 19910 } 19911 19912 public java.util.Optional<Float> scale() { 19913 Float scale = Attribute.scale.access(Float.class, onnxAttributes); 19914 return java.util.Optional.ofNullable(scale); 19915 } 19916 19917 public java.util.Optional<Long> dtype() { 19918 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes); 19919 return java.util.Optional.ofNullable(dtype); 19920 } 19921 19922 } 19923 19924 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) { 19925 return new RandomNormal(resultType, shape, seed, mean, scale, dtype); 19926 } 19927 19928 @OpFactory.OpDeclaration(RandomNormalLike.NAME) 19929 public static final class RandomNormalLike extends OnnxOp { 19930 public static final String NAME = "RandomNormalLike"; 19931 19932 public enum Attribute implements OnnxAttribute { 19933 seed(Float.class, true, null), 19934 mean(Float.class, true, 0.0f), 19935 scale(Float.class, true, 1.0f), 19936 dtype(Long.class, true, null), 19937 ; 19938 19939 final Class<?> t; 19940 final boolean optional; 19941 final Object defaultValue; 19942 19943 Attribute(Class<?> type, boolean optional, Object defaultValue) { 19944 this.t = type; 19945 this.optional = optional; 19946 this.defaultValue = defaultValue; 19947 assert optional || defaultValue == null; 19948 } 19949 19950 public Class<?> type() { 19951 return t; 19952 } 19953 19954 public boolean isOptional() { 19955 return optional; 19956 } 19957 19958 public Object defaultValue() { 19959 return defaultValue; 19960 } 19961 } 19962 19963 public enum TypeConstraint implements OnnxTypeConstraint { 19964 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())))), 19965 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 19966 ; 19967 19968 final OnnxType.TypeVariable typeVariable; 19969 19970 TypeConstraint(OnnxType.TypeVariable typeVariable) { 19971 assert typeVariable.name().equals(name()); 19972 this.typeVariable = typeVariable; 19973 } 19974 19975 @Override 19976 public OnnxType.TypeVariable typeVariable() { 19977 return typeVariable; 19978 } 19979 } 19980 19981 public enum InputParameter implements OnnxParameter { 19982 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 19983 ; 19984 19985 final OnnxType type; 19986 final Quantifier quantifier; 19987 19988 InputParameter(OnnxType type, Quantifier quantifier) { 19989 this.type = type; 19990 this.quantifier = quantifier; 19991 } 19992 19993 @Override 19994 public OnnxType type() { 19995 return type; 19996 } 19997 19998 @Override 19999 public Quantifier quantifier() { 20000 return quantifier; 20001 } 20002 } 20003 20004 public enum OutputParameter implements OnnxParameter { 20005 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 20006 ; 20007 20008 final OnnxType type; 20009 final Quantifier quantifier; 20010 20011 OutputParameter(OnnxType type, Quantifier quantifier) { 20012 this.type = type; 20013 this.quantifier = quantifier; 20014 } 20015 20016 @Override 20017 public OnnxType type() { 20018 return type; 20019 } 20020 20021 @Override 20022 public Quantifier quantifier() { 20023 return quantifier; 20024 } 20025 } 20026 20027 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 20028 NAME, 20029 List.of(Attribute.values()), 20030 List.of(TypeConstraint.values()), 20031 List.of(InputParameter.values()), 20032 List.of(OutputParameter.values()) 20033 ); 20034 20035 public RandomNormalLike(ExternalizedOp def) { 20036 super(SCHEMA, def); 20037 } 20038 20039 RandomNormalLike(RandomNormalLike that, CopyContext cc) { 20040 super(that, cc); 20041 } 20042 20043 @Override 20044 public RandomNormalLike transform(CopyContext cc, OpTransformer ot) { 20045 return new RandomNormalLike(this, cc); 20046 } 20047 20048 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) { 20049 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(seed, mean, scale, dtype)); 20050 } 20051 20052 @Override 20053 public SequencedSet<OnnxParameter> onnxOutputs() { 20054 return onnxOutputs(SCHEMA); 20055 } 20056 20057 @Override 20058 public SequencedMap<OnnxParameter, Object> onnxInputs() { 20059 return onnxInputs(SCHEMA, List.of(input())); 20060 } 20061 20062 public Value input() { 20063 return operands().get(0); 20064 } 20065 20066 public java.util.Optional<Float> seed() { 20067 Float seed = Attribute.seed.access(Float.class, onnxAttributes); 20068 return java.util.Optional.ofNullable(seed); 20069 } 20070 20071 public java.util.Optional<Float> mean() { 20072 Float mean = Attribute.mean.access(Float.class, onnxAttributes); 20073 return java.util.Optional.ofNullable(mean); 20074 } 20075 20076 public java.util.Optional<Float> scale() { 20077 Float scale = Attribute.scale.access(Float.class, onnxAttributes); 20078 return java.util.Optional.ofNullable(scale); 20079 } 20080 20081 public java.util.Optional<Long> dtype() { 20082 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes); 20083 return java.util.Optional.ofNullable(dtype); 20084 } 20085 20086 } 20087 20088 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) { 20089 return new RandomNormalLike(resultType, input, seed, mean, scale, dtype); 20090 } 20091 20092 @OpFactory.OpDeclaration(RandomUniform.NAME) 20093 public static final class RandomUniform extends OnnxOp { 20094 public static final String NAME = "RandomUniform"; 20095 20096 public enum Attribute implements OnnxAttribute { 20097 high(Float.class, true, 1.0f), 20098 shape(long[].class, false, null), 20099 seed(Float.class, true, null), 20100 low(Float.class, true, 0.0f), 20101 dtype(Long.class, true, 1), 20102 ; 20103 20104 final Class<?> t; 20105 final boolean optional; 20106 final Object defaultValue; 20107 20108 Attribute(Class<?> type, boolean optional, Object defaultValue) { 20109 this.t = type; 20110 this.optional = optional; 20111 this.defaultValue = defaultValue; 20112 assert optional || defaultValue == null; 20113 } 20114 20115 public Class<?> type() { 20116 return t; 20117 } 20118 20119 public boolean isOptional() { 20120 return optional; 20121 } 20122 20123 public Object defaultValue() { 20124 return defaultValue; 20125 } 20126 } 20127 20128 public enum TypeConstraint implements OnnxTypeConstraint { 20129 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 20130 ; 20131 20132 final OnnxType.TypeVariable typeVariable; 20133 20134 TypeConstraint(OnnxType.TypeVariable typeVariable) { 20135 assert typeVariable.name().equals(name()); 20136 this.typeVariable = typeVariable; 20137 } 20138 20139 @Override 20140 public OnnxType.TypeVariable typeVariable() { 20141 return typeVariable; 20142 } 20143 } 20144 20145 public enum InputParameter implements OnnxParameter.None { } 20146 20147 public enum OutputParameter implements OnnxParameter { 20148 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20149 ; 20150 20151 final OnnxType type; 20152 final Quantifier quantifier; 20153 20154 OutputParameter(OnnxType type, Quantifier quantifier) { 20155 this.type = type; 20156 this.quantifier = quantifier; 20157 } 20158 20159 @Override 20160 public OnnxType type() { 20161 return type; 20162 } 20163 20164 @Override 20165 public Quantifier quantifier() { 20166 return quantifier; 20167 } 20168 } 20169 20170 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 20171 NAME, 20172 List.of(Attribute.values()), 20173 List.of(TypeConstraint.values()), 20174 List.of(InputParameter.values()), 20175 List.of(OutputParameter.values()) 20176 ); 20177 20178 public RandomUniform(ExternalizedOp def) { 20179 super(SCHEMA, def); 20180 } 20181 20182 RandomUniform(RandomUniform that, CopyContext cc) { 20183 super(that, cc); 20184 } 20185 20186 @Override 20187 public RandomUniform transform(CopyContext cc, OpTransformer ot) { 20188 return new RandomUniform(this, cc); 20189 } 20190 20191 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) { 20192 super(SCHEMA, resultType, Set.of(), List.of(), List.of(high, shape, seed, low, dtype)); 20193 } 20194 20195 @Override 20196 public SequencedSet<OnnxParameter> onnxOutputs() { 20197 return onnxOutputs(SCHEMA); 20198 } 20199 20200 @Override 20201 public SequencedMap<OnnxParameter, Object> onnxInputs() { 20202 return onnxInputs(SCHEMA, List.of()); 20203 } 20204 20205 public java.util.Optional<Float> high() { 20206 Float high = Attribute.high.access(Float.class, onnxAttributes); 20207 return java.util.Optional.ofNullable(high); 20208 } 20209 20210 public long[] shape() { 20211 long[] shape = Attribute.shape.access(long[].class, onnxAttributes); 20212 return shape.clone(); 20213 } 20214 20215 public java.util.Optional<Float> seed() { 20216 Float seed = Attribute.seed.access(Float.class, onnxAttributes); 20217 return java.util.Optional.ofNullable(seed); 20218 } 20219 20220 public java.util.Optional<Float> low() { 20221 Float low = Attribute.low.access(Float.class, onnxAttributes); 20222 return java.util.Optional.ofNullable(low); 20223 } 20224 20225 public java.util.Optional<Long> dtype() { 20226 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes); 20227 return java.util.Optional.ofNullable(dtype); 20228 } 20229 20230 } 20231 20232 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) { 20233 return new RandomUniform(resultType, high, shape, seed, low, dtype); 20234 } 20235 20236 @OpFactory.OpDeclaration(RandomUniformLike.NAME) 20237 public static final class RandomUniformLike extends OnnxOp { 20238 public static final String NAME = "RandomUniformLike"; 20239 20240 public enum Attribute implements OnnxAttribute { 20241 high(Float.class, true, 1.0f), 20242 seed(Float.class, true, null), 20243 low(Float.class, true, 0.0f), 20244 dtype(Long.class, true, null), 20245 ; 20246 20247 final Class<?> t; 20248 final boolean optional; 20249 final Object defaultValue; 20250 20251 Attribute(Class<?> type, boolean optional, Object defaultValue) { 20252 this.t = type; 20253 this.optional = optional; 20254 this.defaultValue = defaultValue; 20255 assert optional || defaultValue == null; 20256 } 20257 20258 public Class<?> type() { 20259 return t; 20260 } 20261 20262 public boolean isOptional() { 20263 return optional; 20264 } 20265 20266 public Object defaultValue() { 20267 return defaultValue; 20268 } 20269 } 20270 20271 public enum TypeConstraint implements OnnxTypeConstraint { 20272 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())))), 20273 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 20274 ; 20275 20276 final OnnxType.TypeVariable typeVariable; 20277 20278 TypeConstraint(OnnxType.TypeVariable typeVariable) { 20279 assert typeVariable.name().equals(name()); 20280 this.typeVariable = typeVariable; 20281 } 20282 20283 @Override 20284 public OnnxType.TypeVariable typeVariable() { 20285 return typeVariable; 20286 } 20287 } 20288 20289 public enum InputParameter implements OnnxParameter { 20290 input(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 20291 ; 20292 20293 final OnnxType type; 20294 final Quantifier quantifier; 20295 20296 InputParameter(OnnxType type, Quantifier quantifier) { 20297 this.type = type; 20298 this.quantifier = quantifier; 20299 } 20300 20301 @Override 20302 public OnnxType type() { 20303 return type; 20304 } 20305 20306 @Override 20307 public Quantifier quantifier() { 20308 return quantifier; 20309 } 20310 } 20311 20312 public enum OutputParameter implements OnnxParameter { 20313 output(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 20314 ; 20315 20316 final OnnxType type; 20317 final Quantifier quantifier; 20318 20319 OutputParameter(OnnxType type, Quantifier quantifier) { 20320 this.type = type; 20321 this.quantifier = quantifier; 20322 } 20323 20324 @Override 20325 public OnnxType type() { 20326 return type; 20327 } 20328 20329 @Override 20330 public Quantifier quantifier() { 20331 return quantifier; 20332 } 20333 } 20334 20335 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 20336 NAME, 20337 List.of(Attribute.values()), 20338 List.of(TypeConstraint.values()), 20339 List.of(InputParameter.values()), 20340 List.of(OutputParameter.values()) 20341 ); 20342 20343 public RandomUniformLike(ExternalizedOp def) { 20344 super(SCHEMA, def); 20345 } 20346 20347 RandomUniformLike(RandomUniformLike that, CopyContext cc) { 20348 super(that, cc); 20349 } 20350 20351 @Override 20352 public RandomUniformLike transform(CopyContext cc, OpTransformer ot) { 20353 return new RandomUniformLike(this, cc); 20354 } 20355 20356 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) { 20357 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(high, seed, low, dtype)); 20358 } 20359 20360 @Override 20361 public SequencedSet<OnnxParameter> onnxOutputs() { 20362 return onnxOutputs(SCHEMA); 20363 } 20364 20365 @Override 20366 public SequencedMap<OnnxParameter, Object> onnxInputs() { 20367 return onnxInputs(SCHEMA, List.of(input())); 20368 } 20369 20370 public Value input() { 20371 return operands().get(0); 20372 } 20373 20374 public java.util.Optional<Float> high() { 20375 Float high = Attribute.high.access(Float.class, onnxAttributes); 20376 return java.util.Optional.ofNullable(high); 20377 } 20378 20379 public java.util.Optional<Float> seed() { 20380 Float seed = Attribute.seed.access(Float.class, onnxAttributes); 20381 return java.util.Optional.ofNullable(seed); 20382 } 20383 20384 public java.util.Optional<Float> low() { 20385 Float low = Attribute.low.access(Float.class, onnxAttributes); 20386 return java.util.Optional.ofNullable(low); 20387 } 20388 20389 public java.util.Optional<Long> dtype() { 20390 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes); 20391 return java.util.Optional.ofNullable(dtype); 20392 } 20393 20394 } 20395 20396 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) { 20397 return new RandomUniformLike(resultType, input, high, seed, low, dtype); 20398 } 20399 20400 @OpFactory.OpDeclaration(Range.NAME) 20401 public static final class Range extends OnnxOp { 20402 public static final String NAME = "Range"; 20403 20404 public enum Attribute implements OnnxAttribute.None { } 20405 20406 public enum TypeConstraint implements OnnxTypeConstraint { 20407 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())))), 20408 ; 20409 20410 final OnnxType.TypeVariable typeVariable; 20411 20412 TypeConstraint(OnnxType.TypeVariable typeVariable) { 20413 assert typeVariable.name().equals(name()); 20414 this.typeVariable = typeVariable; 20415 } 20416 20417 @Override 20418 public OnnxType.TypeVariable typeVariable() { 20419 return typeVariable; 20420 } 20421 } 20422 20423 public enum InputParameter implements OnnxParameter { 20424 start(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20425 limit(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20426 delta(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20427 ; 20428 20429 final OnnxType type; 20430 final Quantifier quantifier; 20431 20432 InputParameter(OnnxType type, Quantifier quantifier) { 20433 this.type = type; 20434 this.quantifier = quantifier; 20435 } 20436 20437 @Override 20438 public OnnxType type() { 20439 return type; 20440 } 20441 20442 @Override 20443 public Quantifier quantifier() { 20444 return quantifier; 20445 } 20446 } 20447 20448 public enum OutputParameter implements OnnxParameter { 20449 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20450 ; 20451 20452 final OnnxType type; 20453 final Quantifier quantifier; 20454 20455 OutputParameter(OnnxType type, Quantifier quantifier) { 20456 this.type = type; 20457 this.quantifier = quantifier; 20458 } 20459 20460 @Override 20461 public OnnxType type() { 20462 return type; 20463 } 20464 20465 @Override 20466 public Quantifier quantifier() { 20467 return quantifier; 20468 } 20469 } 20470 20471 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 20472 NAME, 20473 List.of(Attribute.values()), 20474 List.of(TypeConstraint.values()), 20475 List.of(InputParameter.values()), 20476 List.of(OutputParameter.values()) 20477 ); 20478 20479 public Range(ExternalizedOp def) { 20480 super(SCHEMA, def); 20481 } 20482 20483 Range(Range that, CopyContext cc) { 20484 super(that, cc); 20485 } 20486 20487 @Override 20488 public Range transform(CopyContext cc, OpTransformer ot) { 20489 return new Range(this, cc); 20490 } 20491 20492 Range(TypeElement resultType, Value start, Value limit, Value delta) { 20493 super(SCHEMA, resultType, Set.of(), List.of(start, limit, delta), List.of()); 20494 } 20495 20496 @Override 20497 public SequencedSet<OnnxParameter> onnxOutputs() { 20498 return onnxOutputs(SCHEMA); 20499 } 20500 20501 @Override 20502 public SequencedMap<OnnxParameter, Object> onnxInputs() { 20503 return onnxInputs(SCHEMA, List.of(start(), limit(), delta())); 20504 } 20505 20506 public Value start() { 20507 return operands().get(0); 20508 } 20509 20510 public Value limit() { 20511 return operands().get(1); 20512 } 20513 20514 public Value delta() { 20515 return operands().get(2); 20516 } 20517 20518 } 20519 20520 public static Range Range(TypeElement resultType, Value start, Value limit, Value delta) { 20521 return new Range(resultType, start, limit, delta); 20522 } 20523 20524 @OpFactory.OpDeclaration(Reciprocal.NAME) 20525 public static final class Reciprocal extends OnnxOp { 20526 public static final String NAME = "Reciprocal"; 20527 20528 public enum Attribute implements OnnxAttribute.None { } 20529 20530 public enum TypeConstraint implements OnnxTypeConstraint { 20531 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 20532 ; 20533 20534 final OnnxType.TypeVariable typeVariable; 20535 20536 TypeConstraint(OnnxType.TypeVariable typeVariable) { 20537 assert typeVariable.name().equals(name()); 20538 this.typeVariable = typeVariable; 20539 } 20540 20541 @Override 20542 public OnnxType.TypeVariable typeVariable() { 20543 return typeVariable; 20544 } 20545 } 20546 20547 public enum InputParameter implements OnnxParameter { 20548 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20549 ; 20550 20551 final OnnxType type; 20552 final Quantifier quantifier; 20553 20554 InputParameter(OnnxType type, Quantifier quantifier) { 20555 this.type = type; 20556 this.quantifier = quantifier; 20557 } 20558 20559 @Override 20560 public OnnxType type() { 20561 return type; 20562 } 20563 20564 @Override 20565 public Quantifier quantifier() { 20566 return quantifier; 20567 } 20568 } 20569 20570 public enum OutputParameter implements OnnxParameter { 20571 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20572 ; 20573 20574 final OnnxType type; 20575 final Quantifier quantifier; 20576 20577 OutputParameter(OnnxType type, Quantifier quantifier) { 20578 this.type = type; 20579 this.quantifier = quantifier; 20580 } 20581 20582 @Override 20583 public OnnxType type() { 20584 return type; 20585 } 20586 20587 @Override 20588 public Quantifier quantifier() { 20589 return quantifier; 20590 } 20591 } 20592 20593 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 20594 NAME, 20595 List.of(Attribute.values()), 20596 List.of(TypeConstraint.values()), 20597 List.of(InputParameter.values()), 20598 List.of(OutputParameter.values()) 20599 ); 20600 20601 public Reciprocal(ExternalizedOp def) { 20602 super(SCHEMA, def); 20603 } 20604 20605 Reciprocal(Reciprocal that, CopyContext cc) { 20606 super(that, cc); 20607 } 20608 20609 @Override 20610 public Reciprocal transform(CopyContext cc, OpTransformer ot) { 20611 return new Reciprocal(this, cc); 20612 } 20613 20614 Reciprocal(TypeElement resultType, Value X) { 20615 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 20616 } 20617 20618 @Override 20619 public SequencedSet<OnnxParameter> onnxOutputs() { 20620 return onnxOutputs(SCHEMA); 20621 } 20622 20623 @Override 20624 public SequencedMap<OnnxParameter, Object> onnxInputs() { 20625 return onnxInputs(SCHEMA, List.of(X())); 20626 } 20627 20628 public Value X() { 20629 return operands().get(0); 20630 } 20631 20632 } 20633 20634 public static Reciprocal Reciprocal(TypeElement resultType, Value X) { 20635 return new Reciprocal(resultType, X); 20636 } 20637 20638 @OpFactory.OpDeclaration(ReduceL1.NAME) 20639 public static final class ReduceL1 extends OnnxOp { 20640 public static final String NAME = "ReduceL1"; 20641 20642 public enum Attribute implements OnnxAttribute { 20643 noop_with_empty_axes(Long.class, true, 0), 20644 keepdims(Long.class, true, 1), 20645 ; 20646 20647 final Class<?> t; 20648 final boolean optional; 20649 final Object defaultValue; 20650 20651 Attribute(Class<?> type, boolean optional, Object defaultValue) { 20652 this.t = type; 20653 this.optional = optional; 20654 this.defaultValue = defaultValue; 20655 assert optional || defaultValue == null; 20656 } 20657 20658 public Class<?> type() { 20659 return t; 20660 } 20661 20662 public boolean isOptional() { 20663 return optional; 20664 } 20665 20666 public Object defaultValue() { 20667 return defaultValue; 20668 } 20669 } 20670 20671 public enum TypeConstraint implements OnnxTypeConstraint { 20672 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())))), 20673 ; 20674 20675 final OnnxType.TypeVariable typeVariable; 20676 20677 TypeConstraint(OnnxType.TypeVariable typeVariable) { 20678 assert typeVariable.name().equals(name()); 20679 this.typeVariable = typeVariable; 20680 } 20681 20682 @Override 20683 public OnnxType.TypeVariable typeVariable() { 20684 return typeVariable; 20685 } 20686 } 20687 20688 public enum InputParameter implements OnnxParameter { 20689 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20690 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 20691 ; 20692 20693 final OnnxType type; 20694 final Quantifier quantifier; 20695 20696 InputParameter(OnnxType type, Quantifier quantifier) { 20697 this.type = type; 20698 this.quantifier = quantifier; 20699 } 20700 20701 @Override 20702 public OnnxType type() { 20703 return type; 20704 } 20705 20706 @Override 20707 public Quantifier quantifier() { 20708 return quantifier; 20709 } 20710 } 20711 20712 public enum OutputParameter implements OnnxParameter { 20713 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20714 ; 20715 20716 final OnnxType type; 20717 final Quantifier quantifier; 20718 20719 OutputParameter(OnnxType type, Quantifier quantifier) { 20720 this.type = type; 20721 this.quantifier = quantifier; 20722 } 20723 20724 @Override 20725 public OnnxType type() { 20726 return type; 20727 } 20728 20729 @Override 20730 public Quantifier quantifier() { 20731 return quantifier; 20732 } 20733 } 20734 20735 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 20736 NAME, 20737 List.of(Attribute.values()), 20738 List.of(TypeConstraint.values()), 20739 List.of(InputParameter.values()), 20740 List.of(OutputParameter.values()) 20741 ); 20742 20743 public ReduceL1(ExternalizedOp def) { 20744 super(SCHEMA, def); 20745 } 20746 20747 ReduceL1(ReduceL1 that, CopyContext cc) { 20748 super(that, cc); 20749 } 20750 20751 @Override 20752 public ReduceL1 transform(CopyContext cc, OpTransformer ot) { 20753 return new ReduceL1(this, cc); 20754 } 20755 20756 ReduceL1(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 20757 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 20758 } 20759 20760 @Override 20761 public SequencedSet<OnnxParameter> onnxOutputs() { 20762 return onnxOutputs(SCHEMA); 20763 } 20764 20765 @Override 20766 public SequencedMap<OnnxParameter, Object> onnxInputs() { 20767 return onnxInputs(SCHEMA, List.of(data(), axes())); 20768 } 20769 20770 public Value data() { 20771 return operands().get(0); 20772 } 20773 20774 public java.util.Optional<Value> axes() { 20775 int i = optionalInputArguments.indexOf(InputParameter.axes); 20776 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 20777 } 20778 20779 public java.util.Optional<Long> noop_with_empty_axes() { 20780 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 20781 return java.util.Optional.ofNullable(noop_with_empty_axes); 20782 } 20783 20784 public java.util.Optional<Long> keepdims() { 20785 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 20786 return java.util.Optional.ofNullable(keepdims); 20787 } 20788 20789 } 20790 20791 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) { 20792 return new ReduceL1(resultType, data, axes, noop_with_empty_axes, keepdims); 20793 } 20794 20795 @OpFactory.OpDeclaration(ReduceL2.NAME) 20796 public static final class ReduceL2 extends OnnxOp { 20797 public static final String NAME = "ReduceL2"; 20798 20799 public enum Attribute implements OnnxAttribute { 20800 noop_with_empty_axes(Long.class, true, 0), 20801 keepdims(Long.class, true, 1), 20802 ; 20803 20804 final Class<?> t; 20805 final boolean optional; 20806 final Object defaultValue; 20807 20808 Attribute(Class<?> type, boolean optional, Object defaultValue) { 20809 this.t = type; 20810 this.optional = optional; 20811 this.defaultValue = defaultValue; 20812 assert optional || defaultValue == null; 20813 } 20814 20815 public Class<?> type() { 20816 return t; 20817 } 20818 20819 public boolean isOptional() { 20820 return optional; 20821 } 20822 20823 public Object defaultValue() { 20824 return defaultValue; 20825 } 20826 } 20827 20828 public enum TypeConstraint implements OnnxTypeConstraint { 20829 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())))), 20830 ; 20831 20832 final OnnxType.TypeVariable typeVariable; 20833 20834 TypeConstraint(OnnxType.TypeVariable typeVariable) { 20835 assert typeVariable.name().equals(name()); 20836 this.typeVariable = typeVariable; 20837 } 20838 20839 @Override 20840 public OnnxType.TypeVariable typeVariable() { 20841 return typeVariable; 20842 } 20843 } 20844 20845 public enum InputParameter implements OnnxParameter { 20846 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20847 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 20848 ; 20849 20850 final OnnxType type; 20851 final Quantifier quantifier; 20852 20853 InputParameter(OnnxType type, Quantifier quantifier) { 20854 this.type = type; 20855 this.quantifier = quantifier; 20856 } 20857 20858 @Override 20859 public OnnxType type() { 20860 return type; 20861 } 20862 20863 @Override 20864 public Quantifier quantifier() { 20865 return quantifier; 20866 } 20867 } 20868 20869 public enum OutputParameter implements OnnxParameter { 20870 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 20871 ; 20872 20873 final OnnxType type; 20874 final Quantifier quantifier; 20875 20876 OutputParameter(OnnxType type, Quantifier quantifier) { 20877 this.type = type; 20878 this.quantifier = quantifier; 20879 } 20880 20881 @Override 20882 public OnnxType type() { 20883 return type; 20884 } 20885 20886 @Override 20887 public Quantifier quantifier() { 20888 return quantifier; 20889 } 20890 } 20891 20892 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 20893 NAME, 20894 List.of(Attribute.values()), 20895 List.of(TypeConstraint.values()), 20896 List.of(InputParameter.values()), 20897 List.of(OutputParameter.values()) 20898 ); 20899 20900 public ReduceL2(ExternalizedOp def) { 20901 super(SCHEMA, def); 20902 } 20903 20904 ReduceL2(ReduceL2 that, CopyContext cc) { 20905 super(that, cc); 20906 } 20907 20908 @Override 20909 public ReduceL2 transform(CopyContext cc, OpTransformer ot) { 20910 return new ReduceL2(this, cc); 20911 } 20912 20913 ReduceL2(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 20914 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 20915 } 20916 20917 @Override 20918 public SequencedSet<OnnxParameter> onnxOutputs() { 20919 return onnxOutputs(SCHEMA); 20920 } 20921 20922 @Override 20923 public SequencedMap<OnnxParameter, Object> onnxInputs() { 20924 return onnxInputs(SCHEMA, List.of(data(), axes())); 20925 } 20926 20927 public Value data() { 20928 return operands().get(0); 20929 } 20930 20931 public java.util.Optional<Value> axes() { 20932 int i = optionalInputArguments.indexOf(InputParameter.axes); 20933 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 20934 } 20935 20936 public java.util.Optional<Long> noop_with_empty_axes() { 20937 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 20938 return java.util.Optional.ofNullable(noop_with_empty_axes); 20939 } 20940 20941 public java.util.Optional<Long> keepdims() { 20942 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 20943 return java.util.Optional.ofNullable(keepdims); 20944 } 20945 20946 } 20947 20948 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) { 20949 return new ReduceL2(resultType, data, axes, noop_with_empty_axes, keepdims); 20950 } 20951 20952 @OpFactory.OpDeclaration(ReduceLogSum.NAME) 20953 public static final class ReduceLogSum extends OnnxOp { 20954 public static final String NAME = "ReduceLogSum"; 20955 20956 public enum Attribute implements OnnxAttribute { 20957 noop_with_empty_axes(Long.class, true, 0), 20958 keepdims(Long.class, true, 1), 20959 ; 20960 20961 final Class<?> t; 20962 final boolean optional; 20963 final Object defaultValue; 20964 20965 Attribute(Class<?> type, boolean optional, Object defaultValue) { 20966 this.t = type; 20967 this.optional = optional; 20968 this.defaultValue = defaultValue; 20969 assert optional || defaultValue == null; 20970 } 20971 20972 public Class<?> type() { 20973 return t; 20974 } 20975 20976 public boolean isOptional() { 20977 return optional; 20978 } 20979 20980 public Object defaultValue() { 20981 return defaultValue; 20982 } 20983 } 20984 20985 public enum TypeConstraint implements OnnxTypeConstraint { 20986 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())))), 20987 ; 20988 20989 final OnnxType.TypeVariable typeVariable; 20990 20991 TypeConstraint(OnnxType.TypeVariable typeVariable) { 20992 assert typeVariable.name().equals(name()); 20993 this.typeVariable = typeVariable; 20994 } 20995 20996 @Override 20997 public OnnxType.TypeVariable typeVariable() { 20998 return typeVariable; 20999 } 21000 } 21001 21002 public enum InputParameter implements OnnxParameter { 21003 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21004 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 21005 ; 21006 21007 final OnnxType type; 21008 final Quantifier quantifier; 21009 21010 InputParameter(OnnxType type, Quantifier quantifier) { 21011 this.type = type; 21012 this.quantifier = quantifier; 21013 } 21014 21015 @Override 21016 public OnnxType type() { 21017 return type; 21018 } 21019 21020 @Override 21021 public Quantifier quantifier() { 21022 return quantifier; 21023 } 21024 } 21025 21026 public enum OutputParameter implements OnnxParameter { 21027 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21028 ; 21029 21030 final OnnxType type; 21031 final Quantifier quantifier; 21032 21033 OutputParameter(OnnxType type, Quantifier quantifier) { 21034 this.type = type; 21035 this.quantifier = quantifier; 21036 } 21037 21038 @Override 21039 public OnnxType type() { 21040 return type; 21041 } 21042 21043 @Override 21044 public Quantifier quantifier() { 21045 return quantifier; 21046 } 21047 } 21048 21049 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 21050 NAME, 21051 List.of(Attribute.values()), 21052 List.of(TypeConstraint.values()), 21053 List.of(InputParameter.values()), 21054 List.of(OutputParameter.values()) 21055 ); 21056 21057 public ReduceLogSum(ExternalizedOp def) { 21058 super(SCHEMA, def); 21059 } 21060 21061 ReduceLogSum(ReduceLogSum that, CopyContext cc) { 21062 super(that, cc); 21063 } 21064 21065 @Override 21066 public ReduceLogSum transform(CopyContext cc, OpTransformer ot) { 21067 return new ReduceLogSum(this, cc); 21068 } 21069 21070 ReduceLogSum(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 21071 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 21072 } 21073 21074 @Override 21075 public SequencedSet<OnnxParameter> onnxOutputs() { 21076 return onnxOutputs(SCHEMA); 21077 } 21078 21079 @Override 21080 public SequencedMap<OnnxParameter, Object> onnxInputs() { 21081 return onnxInputs(SCHEMA, List.of(data(), axes())); 21082 } 21083 21084 public Value data() { 21085 return operands().get(0); 21086 } 21087 21088 public java.util.Optional<Value> axes() { 21089 int i = optionalInputArguments.indexOf(InputParameter.axes); 21090 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 21091 } 21092 21093 public java.util.Optional<Long> noop_with_empty_axes() { 21094 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 21095 return java.util.Optional.ofNullable(noop_with_empty_axes); 21096 } 21097 21098 public java.util.Optional<Long> keepdims() { 21099 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 21100 return java.util.Optional.ofNullable(keepdims); 21101 } 21102 21103 } 21104 21105 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) { 21106 return new ReduceLogSum(resultType, data, axes, noop_with_empty_axes, keepdims); 21107 } 21108 21109 @OpFactory.OpDeclaration(ReduceLogSumExp.NAME) 21110 public static final class ReduceLogSumExp extends OnnxOp { 21111 public static final String NAME = "ReduceLogSumExp"; 21112 21113 public enum Attribute implements OnnxAttribute { 21114 noop_with_empty_axes(Long.class, true, 0), 21115 keepdims(Long.class, true, 1), 21116 ; 21117 21118 final Class<?> t; 21119 final boolean optional; 21120 final Object defaultValue; 21121 21122 Attribute(Class<?> type, boolean optional, Object defaultValue) { 21123 this.t = type; 21124 this.optional = optional; 21125 this.defaultValue = defaultValue; 21126 assert optional || defaultValue == null; 21127 } 21128 21129 public Class<?> type() { 21130 return t; 21131 } 21132 21133 public boolean isOptional() { 21134 return optional; 21135 } 21136 21137 public Object defaultValue() { 21138 return defaultValue; 21139 } 21140 } 21141 21142 public enum TypeConstraint implements OnnxTypeConstraint { 21143 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())))), 21144 ; 21145 21146 final OnnxType.TypeVariable typeVariable; 21147 21148 TypeConstraint(OnnxType.TypeVariable typeVariable) { 21149 assert typeVariable.name().equals(name()); 21150 this.typeVariable = typeVariable; 21151 } 21152 21153 @Override 21154 public OnnxType.TypeVariable typeVariable() { 21155 return typeVariable; 21156 } 21157 } 21158 21159 public enum InputParameter implements OnnxParameter { 21160 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21161 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 21162 ; 21163 21164 final OnnxType type; 21165 final Quantifier quantifier; 21166 21167 InputParameter(OnnxType type, Quantifier quantifier) { 21168 this.type = type; 21169 this.quantifier = quantifier; 21170 } 21171 21172 @Override 21173 public OnnxType type() { 21174 return type; 21175 } 21176 21177 @Override 21178 public Quantifier quantifier() { 21179 return quantifier; 21180 } 21181 } 21182 21183 public enum OutputParameter implements OnnxParameter { 21184 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21185 ; 21186 21187 final OnnxType type; 21188 final Quantifier quantifier; 21189 21190 OutputParameter(OnnxType type, Quantifier quantifier) { 21191 this.type = type; 21192 this.quantifier = quantifier; 21193 } 21194 21195 @Override 21196 public OnnxType type() { 21197 return type; 21198 } 21199 21200 @Override 21201 public Quantifier quantifier() { 21202 return quantifier; 21203 } 21204 } 21205 21206 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 21207 NAME, 21208 List.of(Attribute.values()), 21209 List.of(TypeConstraint.values()), 21210 List.of(InputParameter.values()), 21211 List.of(OutputParameter.values()) 21212 ); 21213 21214 public ReduceLogSumExp(ExternalizedOp def) { 21215 super(SCHEMA, def); 21216 } 21217 21218 ReduceLogSumExp(ReduceLogSumExp that, CopyContext cc) { 21219 super(that, cc); 21220 } 21221 21222 @Override 21223 public ReduceLogSumExp transform(CopyContext cc, OpTransformer ot) { 21224 return new ReduceLogSumExp(this, cc); 21225 } 21226 21227 ReduceLogSumExp(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 21228 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 21229 } 21230 21231 @Override 21232 public SequencedSet<OnnxParameter> onnxOutputs() { 21233 return onnxOutputs(SCHEMA); 21234 } 21235 21236 @Override 21237 public SequencedMap<OnnxParameter, Object> onnxInputs() { 21238 return onnxInputs(SCHEMA, List.of(data(), axes())); 21239 } 21240 21241 public Value data() { 21242 return operands().get(0); 21243 } 21244 21245 public java.util.Optional<Value> axes() { 21246 int i = optionalInputArguments.indexOf(InputParameter.axes); 21247 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 21248 } 21249 21250 public java.util.Optional<Long> noop_with_empty_axes() { 21251 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 21252 return java.util.Optional.ofNullable(noop_with_empty_axes); 21253 } 21254 21255 public java.util.Optional<Long> keepdims() { 21256 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 21257 return java.util.Optional.ofNullable(keepdims); 21258 } 21259 21260 } 21261 21262 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) { 21263 return new ReduceLogSumExp(resultType, data, axes, noop_with_empty_axes, keepdims); 21264 } 21265 21266 @OpFactory.OpDeclaration(ReduceMax.NAME) 21267 public static final class ReduceMax extends OnnxOp { 21268 public static final String NAME = "ReduceMax"; 21269 21270 public enum Attribute implements OnnxAttribute { 21271 noop_with_empty_axes(Long.class, true, 0), 21272 keepdims(Long.class, true, 1), 21273 ; 21274 21275 final Class<?> t; 21276 final boolean optional; 21277 final Object defaultValue; 21278 21279 Attribute(Class<?> type, boolean optional, Object defaultValue) { 21280 this.t = type; 21281 this.optional = optional; 21282 this.defaultValue = defaultValue; 21283 assert optional || defaultValue == null; 21284 } 21285 21286 public Class<?> type() { 21287 return t; 21288 } 21289 21290 public boolean isOptional() { 21291 return optional; 21292 } 21293 21294 public Object defaultValue() { 21295 return defaultValue; 21296 } 21297 } 21298 21299 public enum TypeConstraint implements OnnxTypeConstraint { 21300 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())))), 21301 ; 21302 21303 final OnnxType.TypeVariable typeVariable; 21304 21305 TypeConstraint(OnnxType.TypeVariable typeVariable) { 21306 assert typeVariable.name().equals(name()); 21307 this.typeVariable = typeVariable; 21308 } 21309 21310 @Override 21311 public OnnxType.TypeVariable typeVariable() { 21312 return typeVariable; 21313 } 21314 } 21315 21316 public enum InputParameter implements OnnxParameter { 21317 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21318 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 21319 ; 21320 21321 final OnnxType type; 21322 final Quantifier quantifier; 21323 21324 InputParameter(OnnxType type, Quantifier quantifier) { 21325 this.type = type; 21326 this.quantifier = quantifier; 21327 } 21328 21329 @Override 21330 public OnnxType type() { 21331 return type; 21332 } 21333 21334 @Override 21335 public Quantifier quantifier() { 21336 return quantifier; 21337 } 21338 } 21339 21340 public enum OutputParameter implements OnnxParameter { 21341 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21342 ; 21343 21344 final OnnxType type; 21345 final Quantifier quantifier; 21346 21347 OutputParameter(OnnxType type, Quantifier quantifier) { 21348 this.type = type; 21349 this.quantifier = quantifier; 21350 } 21351 21352 @Override 21353 public OnnxType type() { 21354 return type; 21355 } 21356 21357 @Override 21358 public Quantifier quantifier() { 21359 return quantifier; 21360 } 21361 } 21362 21363 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 21364 NAME, 21365 List.of(Attribute.values()), 21366 List.of(TypeConstraint.values()), 21367 List.of(InputParameter.values()), 21368 List.of(OutputParameter.values()) 21369 ); 21370 21371 public ReduceMax(ExternalizedOp def) { 21372 super(SCHEMA, def); 21373 } 21374 21375 ReduceMax(ReduceMax that, CopyContext cc) { 21376 super(that, cc); 21377 } 21378 21379 @Override 21380 public ReduceMax transform(CopyContext cc, OpTransformer ot) { 21381 return new ReduceMax(this, cc); 21382 } 21383 21384 ReduceMax(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 21385 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 21386 } 21387 21388 @Override 21389 public SequencedSet<OnnxParameter> onnxOutputs() { 21390 return onnxOutputs(SCHEMA); 21391 } 21392 21393 @Override 21394 public SequencedMap<OnnxParameter, Object> onnxInputs() { 21395 return onnxInputs(SCHEMA, List.of(data(), axes())); 21396 } 21397 21398 public Value data() { 21399 return operands().get(0); 21400 } 21401 21402 public java.util.Optional<Value> axes() { 21403 int i = optionalInputArguments.indexOf(InputParameter.axes); 21404 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 21405 } 21406 21407 public java.util.Optional<Long> noop_with_empty_axes() { 21408 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 21409 return java.util.Optional.ofNullable(noop_with_empty_axes); 21410 } 21411 21412 public java.util.Optional<Long> keepdims() { 21413 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 21414 return java.util.Optional.ofNullable(keepdims); 21415 } 21416 21417 } 21418 21419 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) { 21420 return new ReduceMax(resultType, data, axes, noop_with_empty_axes, keepdims); 21421 } 21422 21423 @OpFactory.OpDeclaration(ReduceMean.NAME) 21424 public static final class ReduceMean extends OnnxOp { 21425 public static final String NAME = "ReduceMean"; 21426 21427 public enum Attribute implements OnnxAttribute { 21428 noop_with_empty_axes(Long.class, true, 0), 21429 keepdims(Long.class, true, 1), 21430 ; 21431 21432 final Class<?> t; 21433 final boolean optional; 21434 final Object defaultValue; 21435 21436 Attribute(Class<?> type, boolean optional, Object defaultValue) { 21437 this.t = type; 21438 this.optional = optional; 21439 this.defaultValue = defaultValue; 21440 assert optional || defaultValue == null; 21441 } 21442 21443 public Class<?> type() { 21444 return t; 21445 } 21446 21447 public boolean isOptional() { 21448 return optional; 21449 } 21450 21451 public Object defaultValue() { 21452 return defaultValue; 21453 } 21454 } 21455 21456 public enum TypeConstraint implements OnnxTypeConstraint { 21457 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())))), 21458 ; 21459 21460 final OnnxType.TypeVariable typeVariable; 21461 21462 TypeConstraint(OnnxType.TypeVariable typeVariable) { 21463 assert typeVariable.name().equals(name()); 21464 this.typeVariable = typeVariable; 21465 } 21466 21467 @Override 21468 public OnnxType.TypeVariable typeVariable() { 21469 return typeVariable; 21470 } 21471 } 21472 21473 public enum InputParameter implements OnnxParameter { 21474 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21475 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 21476 ; 21477 21478 final OnnxType type; 21479 final Quantifier quantifier; 21480 21481 InputParameter(OnnxType type, Quantifier quantifier) { 21482 this.type = type; 21483 this.quantifier = quantifier; 21484 } 21485 21486 @Override 21487 public OnnxType type() { 21488 return type; 21489 } 21490 21491 @Override 21492 public Quantifier quantifier() { 21493 return quantifier; 21494 } 21495 } 21496 21497 public enum OutputParameter implements OnnxParameter { 21498 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21499 ; 21500 21501 final OnnxType type; 21502 final Quantifier quantifier; 21503 21504 OutputParameter(OnnxType type, Quantifier quantifier) { 21505 this.type = type; 21506 this.quantifier = quantifier; 21507 } 21508 21509 @Override 21510 public OnnxType type() { 21511 return type; 21512 } 21513 21514 @Override 21515 public Quantifier quantifier() { 21516 return quantifier; 21517 } 21518 } 21519 21520 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 21521 NAME, 21522 List.of(Attribute.values()), 21523 List.of(TypeConstraint.values()), 21524 List.of(InputParameter.values()), 21525 List.of(OutputParameter.values()) 21526 ); 21527 21528 public ReduceMean(ExternalizedOp def) { 21529 super(SCHEMA, def); 21530 } 21531 21532 ReduceMean(ReduceMean that, CopyContext cc) { 21533 super(that, cc); 21534 } 21535 21536 @Override 21537 public ReduceMean transform(CopyContext cc, OpTransformer ot) { 21538 return new ReduceMean(this, cc); 21539 } 21540 21541 ReduceMean(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 21542 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 21543 } 21544 21545 @Override 21546 public SequencedSet<OnnxParameter> onnxOutputs() { 21547 return onnxOutputs(SCHEMA); 21548 } 21549 21550 @Override 21551 public SequencedMap<OnnxParameter, Object> onnxInputs() { 21552 return onnxInputs(SCHEMA, List.of(data(), axes())); 21553 } 21554 21555 public Value data() { 21556 return operands().get(0); 21557 } 21558 21559 public java.util.Optional<Value> axes() { 21560 int i = optionalInputArguments.indexOf(InputParameter.axes); 21561 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 21562 } 21563 21564 public java.util.Optional<Long> noop_with_empty_axes() { 21565 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 21566 return java.util.Optional.ofNullable(noop_with_empty_axes); 21567 } 21568 21569 public java.util.Optional<Long> keepdims() { 21570 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 21571 return java.util.Optional.ofNullable(keepdims); 21572 } 21573 21574 } 21575 21576 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) { 21577 return new ReduceMean(resultType, data, axes, noop_with_empty_axes, keepdims); 21578 } 21579 21580 @OpFactory.OpDeclaration(ReduceMin.NAME) 21581 public static final class ReduceMin extends OnnxOp { 21582 public static final String NAME = "ReduceMin"; 21583 21584 public enum Attribute implements OnnxAttribute { 21585 noop_with_empty_axes(Long.class, true, 0), 21586 keepdims(Long.class, true, 1), 21587 ; 21588 21589 final Class<?> t; 21590 final boolean optional; 21591 final Object defaultValue; 21592 21593 Attribute(Class<?> type, boolean optional, Object defaultValue) { 21594 this.t = type; 21595 this.optional = optional; 21596 this.defaultValue = defaultValue; 21597 assert optional || defaultValue == null; 21598 } 21599 21600 public Class<?> type() { 21601 return t; 21602 } 21603 21604 public boolean isOptional() { 21605 return optional; 21606 } 21607 21608 public Object defaultValue() { 21609 return defaultValue; 21610 } 21611 } 21612 21613 public enum TypeConstraint implements OnnxTypeConstraint { 21614 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())))), 21615 ; 21616 21617 final OnnxType.TypeVariable typeVariable; 21618 21619 TypeConstraint(OnnxType.TypeVariable typeVariable) { 21620 assert typeVariable.name().equals(name()); 21621 this.typeVariable = typeVariable; 21622 } 21623 21624 @Override 21625 public OnnxType.TypeVariable typeVariable() { 21626 return typeVariable; 21627 } 21628 } 21629 21630 public enum InputParameter implements OnnxParameter { 21631 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21632 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 21633 ; 21634 21635 final OnnxType type; 21636 final Quantifier quantifier; 21637 21638 InputParameter(OnnxType type, Quantifier quantifier) { 21639 this.type = type; 21640 this.quantifier = quantifier; 21641 } 21642 21643 @Override 21644 public OnnxType type() { 21645 return type; 21646 } 21647 21648 @Override 21649 public Quantifier quantifier() { 21650 return quantifier; 21651 } 21652 } 21653 21654 public enum OutputParameter implements OnnxParameter { 21655 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21656 ; 21657 21658 final OnnxType type; 21659 final Quantifier quantifier; 21660 21661 OutputParameter(OnnxType type, Quantifier quantifier) { 21662 this.type = type; 21663 this.quantifier = quantifier; 21664 } 21665 21666 @Override 21667 public OnnxType type() { 21668 return type; 21669 } 21670 21671 @Override 21672 public Quantifier quantifier() { 21673 return quantifier; 21674 } 21675 } 21676 21677 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 21678 NAME, 21679 List.of(Attribute.values()), 21680 List.of(TypeConstraint.values()), 21681 List.of(InputParameter.values()), 21682 List.of(OutputParameter.values()) 21683 ); 21684 21685 public ReduceMin(ExternalizedOp def) { 21686 super(SCHEMA, def); 21687 } 21688 21689 ReduceMin(ReduceMin that, CopyContext cc) { 21690 super(that, cc); 21691 } 21692 21693 @Override 21694 public ReduceMin transform(CopyContext cc, OpTransformer ot) { 21695 return new ReduceMin(this, cc); 21696 } 21697 21698 ReduceMin(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 21699 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 21700 } 21701 21702 @Override 21703 public SequencedSet<OnnxParameter> onnxOutputs() { 21704 return onnxOutputs(SCHEMA); 21705 } 21706 21707 @Override 21708 public SequencedMap<OnnxParameter, Object> onnxInputs() { 21709 return onnxInputs(SCHEMA, List.of(data(), axes())); 21710 } 21711 21712 public Value data() { 21713 return operands().get(0); 21714 } 21715 21716 public java.util.Optional<Value> axes() { 21717 int i = optionalInputArguments.indexOf(InputParameter.axes); 21718 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 21719 } 21720 21721 public java.util.Optional<Long> noop_with_empty_axes() { 21722 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 21723 return java.util.Optional.ofNullable(noop_with_empty_axes); 21724 } 21725 21726 public java.util.Optional<Long> keepdims() { 21727 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 21728 return java.util.Optional.ofNullable(keepdims); 21729 } 21730 21731 } 21732 21733 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) { 21734 return new ReduceMin(resultType, data, axes, noop_with_empty_axes, keepdims); 21735 } 21736 21737 @OpFactory.OpDeclaration(ReduceProd.NAME) 21738 public static final class ReduceProd extends OnnxOp { 21739 public static final String NAME = "ReduceProd"; 21740 21741 public enum Attribute implements OnnxAttribute { 21742 noop_with_empty_axes(Long.class, true, 0), 21743 keepdims(Long.class, true, 1), 21744 ; 21745 21746 final Class<?> t; 21747 final boolean optional; 21748 final Object defaultValue; 21749 21750 Attribute(Class<?> type, boolean optional, Object defaultValue) { 21751 this.t = type; 21752 this.optional = optional; 21753 this.defaultValue = defaultValue; 21754 assert optional || defaultValue == null; 21755 } 21756 21757 public Class<?> type() { 21758 return t; 21759 } 21760 21761 public boolean isOptional() { 21762 return optional; 21763 } 21764 21765 public Object defaultValue() { 21766 return defaultValue; 21767 } 21768 } 21769 21770 public enum TypeConstraint implements OnnxTypeConstraint { 21771 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())))), 21772 ; 21773 21774 final OnnxType.TypeVariable typeVariable; 21775 21776 TypeConstraint(OnnxType.TypeVariable typeVariable) { 21777 assert typeVariable.name().equals(name()); 21778 this.typeVariable = typeVariable; 21779 } 21780 21781 @Override 21782 public OnnxType.TypeVariable typeVariable() { 21783 return typeVariable; 21784 } 21785 } 21786 21787 public enum InputParameter implements OnnxParameter { 21788 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21789 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 21790 ; 21791 21792 final OnnxType type; 21793 final Quantifier quantifier; 21794 21795 InputParameter(OnnxType type, Quantifier quantifier) { 21796 this.type = type; 21797 this.quantifier = quantifier; 21798 } 21799 21800 @Override 21801 public OnnxType type() { 21802 return type; 21803 } 21804 21805 @Override 21806 public Quantifier quantifier() { 21807 return quantifier; 21808 } 21809 } 21810 21811 public enum OutputParameter implements OnnxParameter { 21812 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21813 ; 21814 21815 final OnnxType type; 21816 final Quantifier quantifier; 21817 21818 OutputParameter(OnnxType type, Quantifier quantifier) { 21819 this.type = type; 21820 this.quantifier = quantifier; 21821 } 21822 21823 @Override 21824 public OnnxType type() { 21825 return type; 21826 } 21827 21828 @Override 21829 public Quantifier quantifier() { 21830 return quantifier; 21831 } 21832 } 21833 21834 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 21835 NAME, 21836 List.of(Attribute.values()), 21837 List.of(TypeConstraint.values()), 21838 List.of(InputParameter.values()), 21839 List.of(OutputParameter.values()) 21840 ); 21841 21842 public ReduceProd(ExternalizedOp def) { 21843 super(SCHEMA, def); 21844 } 21845 21846 ReduceProd(ReduceProd that, CopyContext cc) { 21847 super(that, cc); 21848 } 21849 21850 @Override 21851 public ReduceProd transform(CopyContext cc, OpTransformer ot) { 21852 return new ReduceProd(this, cc); 21853 } 21854 21855 ReduceProd(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 21856 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 21857 } 21858 21859 @Override 21860 public SequencedSet<OnnxParameter> onnxOutputs() { 21861 return onnxOutputs(SCHEMA); 21862 } 21863 21864 @Override 21865 public SequencedMap<OnnxParameter, Object> onnxInputs() { 21866 return onnxInputs(SCHEMA, List.of(data(), axes())); 21867 } 21868 21869 public Value data() { 21870 return operands().get(0); 21871 } 21872 21873 public java.util.Optional<Value> axes() { 21874 int i = optionalInputArguments.indexOf(InputParameter.axes); 21875 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 21876 } 21877 21878 public java.util.Optional<Long> noop_with_empty_axes() { 21879 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 21880 return java.util.Optional.ofNullable(noop_with_empty_axes); 21881 } 21882 21883 public java.util.Optional<Long> keepdims() { 21884 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 21885 return java.util.Optional.ofNullable(keepdims); 21886 } 21887 21888 } 21889 21890 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) { 21891 return new ReduceProd(resultType, data, axes, noop_with_empty_axes, keepdims); 21892 } 21893 21894 @OpFactory.OpDeclaration(ReduceSum.NAME) 21895 public static final class ReduceSum extends OnnxOp { 21896 public static final String NAME = "ReduceSum"; 21897 21898 public enum Attribute implements OnnxAttribute { 21899 noop_with_empty_axes(Long.class, true, 0), 21900 keepdims(Long.class, true, 1), 21901 ; 21902 21903 final Class<?> t; 21904 final boolean optional; 21905 final Object defaultValue; 21906 21907 Attribute(Class<?> type, boolean optional, Object defaultValue) { 21908 this.t = type; 21909 this.optional = optional; 21910 this.defaultValue = defaultValue; 21911 assert optional || defaultValue == null; 21912 } 21913 21914 public Class<?> type() { 21915 return t; 21916 } 21917 21918 public boolean isOptional() { 21919 return optional; 21920 } 21921 21922 public Object defaultValue() { 21923 return defaultValue; 21924 } 21925 } 21926 21927 public enum TypeConstraint implements OnnxTypeConstraint { 21928 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())))), 21929 ; 21930 21931 final OnnxType.TypeVariable typeVariable; 21932 21933 TypeConstraint(OnnxType.TypeVariable typeVariable) { 21934 assert typeVariable.name().equals(name()); 21935 this.typeVariable = typeVariable; 21936 } 21937 21938 @Override 21939 public OnnxType.TypeVariable typeVariable() { 21940 return typeVariable; 21941 } 21942 } 21943 21944 public enum InputParameter implements OnnxParameter { 21945 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21946 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 21947 ; 21948 21949 final OnnxType type; 21950 final Quantifier quantifier; 21951 21952 InputParameter(OnnxType type, Quantifier quantifier) { 21953 this.type = type; 21954 this.quantifier = quantifier; 21955 } 21956 21957 @Override 21958 public OnnxType type() { 21959 return type; 21960 } 21961 21962 @Override 21963 public Quantifier quantifier() { 21964 return quantifier; 21965 } 21966 } 21967 21968 public enum OutputParameter implements OnnxParameter { 21969 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 21970 ; 21971 21972 final OnnxType type; 21973 final Quantifier quantifier; 21974 21975 OutputParameter(OnnxType type, Quantifier quantifier) { 21976 this.type = type; 21977 this.quantifier = quantifier; 21978 } 21979 21980 @Override 21981 public OnnxType type() { 21982 return type; 21983 } 21984 21985 @Override 21986 public Quantifier quantifier() { 21987 return quantifier; 21988 } 21989 } 21990 21991 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 21992 NAME, 21993 List.of(Attribute.values()), 21994 List.of(TypeConstraint.values()), 21995 List.of(InputParameter.values()), 21996 List.of(OutputParameter.values()) 21997 ); 21998 21999 public ReduceSum(ExternalizedOp def) { 22000 super(SCHEMA, def); 22001 } 22002 22003 ReduceSum(ReduceSum that, CopyContext cc) { 22004 super(that, cc); 22005 } 22006 22007 @Override 22008 public ReduceSum transform(CopyContext cc, OpTransformer ot) { 22009 return new ReduceSum(this, cc); 22010 } 22011 22012 ReduceSum(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 22013 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 22014 } 22015 22016 @Override 22017 public SequencedSet<OnnxParameter> onnxOutputs() { 22018 return onnxOutputs(SCHEMA); 22019 } 22020 22021 @Override 22022 public SequencedMap<OnnxParameter, Object> onnxInputs() { 22023 return onnxInputs(SCHEMA, List.of(data(), axes())); 22024 } 22025 22026 public Value data() { 22027 return operands().get(0); 22028 } 22029 22030 public java.util.Optional<Value> axes() { 22031 int i = optionalInputArguments.indexOf(InputParameter.axes); 22032 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 22033 } 22034 22035 public java.util.Optional<Long> noop_with_empty_axes() { 22036 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 22037 return java.util.Optional.ofNullable(noop_with_empty_axes); 22038 } 22039 22040 public java.util.Optional<Long> keepdims() { 22041 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 22042 return java.util.Optional.ofNullable(keepdims); 22043 } 22044 22045 } 22046 22047 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) { 22048 return new ReduceSum(resultType, data, axes, noop_with_empty_axes, keepdims); 22049 } 22050 22051 @OpFactory.OpDeclaration(ReduceSumSquare.NAME) 22052 public static final class ReduceSumSquare extends OnnxOp { 22053 public static final String NAME = "ReduceSumSquare"; 22054 22055 public enum Attribute implements OnnxAttribute { 22056 noop_with_empty_axes(Long.class, true, 0), 22057 keepdims(Long.class, true, 1), 22058 ; 22059 22060 final Class<?> t; 22061 final boolean optional; 22062 final Object defaultValue; 22063 22064 Attribute(Class<?> type, boolean optional, Object defaultValue) { 22065 this.t = type; 22066 this.optional = optional; 22067 this.defaultValue = defaultValue; 22068 assert optional || defaultValue == null; 22069 } 22070 22071 public Class<?> type() { 22072 return t; 22073 } 22074 22075 public boolean isOptional() { 22076 return optional; 22077 } 22078 22079 public Object defaultValue() { 22080 return defaultValue; 22081 } 22082 } 22083 22084 public enum TypeConstraint implements OnnxTypeConstraint { 22085 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())))), 22086 ; 22087 22088 final OnnxType.TypeVariable typeVariable; 22089 22090 TypeConstraint(OnnxType.TypeVariable typeVariable) { 22091 assert typeVariable.name().equals(name()); 22092 this.typeVariable = typeVariable; 22093 } 22094 22095 @Override 22096 public OnnxType.TypeVariable typeVariable() { 22097 return typeVariable; 22098 } 22099 } 22100 22101 public enum InputParameter implements OnnxParameter { 22102 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 22103 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 22104 ; 22105 22106 final OnnxType type; 22107 final Quantifier quantifier; 22108 22109 InputParameter(OnnxType type, Quantifier quantifier) { 22110 this.type = type; 22111 this.quantifier = quantifier; 22112 } 22113 22114 @Override 22115 public OnnxType type() { 22116 return type; 22117 } 22118 22119 @Override 22120 public Quantifier quantifier() { 22121 return quantifier; 22122 } 22123 } 22124 22125 public enum OutputParameter implements OnnxParameter { 22126 reduced(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 22127 ; 22128 22129 final OnnxType type; 22130 final Quantifier quantifier; 22131 22132 OutputParameter(OnnxType type, Quantifier quantifier) { 22133 this.type = type; 22134 this.quantifier = quantifier; 22135 } 22136 22137 @Override 22138 public OnnxType type() { 22139 return type; 22140 } 22141 22142 @Override 22143 public Quantifier quantifier() { 22144 return quantifier; 22145 } 22146 } 22147 22148 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 22149 NAME, 22150 List.of(Attribute.values()), 22151 List.of(TypeConstraint.values()), 22152 List.of(InputParameter.values()), 22153 List.of(OutputParameter.values()) 22154 ); 22155 22156 public ReduceSumSquare(ExternalizedOp def) { 22157 super(SCHEMA, def); 22158 } 22159 22160 ReduceSumSquare(ReduceSumSquare that, CopyContext cc) { 22161 super(that, cc); 22162 } 22163 22164 @Override 22165 public ReduceSumSquare transform(CopyContext cc, OpTransformer ot) { 22166 return new ReduceSumSquare(this, cc); 22167 } 22168 22169 ReduceSumSquare(TypeElement resultType, Value data, java.util.Optional<Value> axes, java.util.Optional<Long> noop_with_empty_axes, java.util.Optional<Long> keepdims) { 22170 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of(noop_with_empty_axes, keepdims)); 22171 } 22172 22173 @Override 22174 public SequencedSet<OnnxParameter> onnxOutputs() { 22175 return onnxOutputs(SCHEMA); 22176 } 22177 22178 @Override 22179 public SequencedMap<OnnxParameter, Object> onnxInputs() { 22180 return onnxInputs(SCHEMA, List.of(data(), axes())); 22181 } 22182 22183 public Value data() { 22184 return operands().get(0); 22185 } 22186 22187 public java.util.Optional<Value> axes() { 22188 int i = optionalInputArguments.indexOf(InputParameter.axes); 22189 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 22190 } 22191 22192 public java.util.Optional<Long> noop_with_empty_axes() { 22193 Long noop_with_empty_axes = Attribute.noop_with_empty_axes.access(Long.class, onnxAttributes); 22194 return java.util.Optional.ofNullable(noop_with_empty_axes); 22195 } 22196 22197 public java.util.Optional<Long> keepdims() { 22198 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 22199 return java.util.Optional.ofNullable(keepdims); 22200 } 22201 22202 } 22203 22204 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) { 22205 return new ReduceSumSquare(resultType, data, axes, noop_with_empty_axes, keepdims); 22206 } 22207 22208 @OpFactory.OpDeclaration(RegexFullMatch.NAME) 22209 public static final class RegexFullMatch extends OnnxOp { 22210 public static final String NAME = "RegexFullMatch"; 22211 22212 public enum Attribute implements OnnxAttribute { 22213 pattern(String.class, true, null), 22214 ; 22215 22216 final Class<?> t; 22217 final boolean optional; 22218 final Object defaultValue; 22219 22220 Attribute(Class<?> type, boolean optional, Object defaultValue) { 22221 this.t = type; 22222 this.optional = optional; 22223 this.defaultValue = defaultValue; 22224 assert optional || defaultValue == null; 22225 } 22226 22227 public Class<?> type() { 22228 return t; 22229 } 22230 22231 public boolean isOptional() { 22232 return optional; 22233 } 22234 22235 public Object defaultValue() { 22236 return defaultValue; 22237 } 22238 } 22239 22240 public enum TypeConstraint implements OnnxTypeConstraint { 22241 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.string())))), 22242 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.bool())))), 22243 ; 22244 22245 final OnnxType.TypeVariable typeVariable; 22246 22247 TypeConstraint(OnnxType.TypeVariable typeVariable) { 22248 assert typeVariable.name().equals(name()); 22249 this.typeVariable = typeVariable; 22250 } 22251 22252 @Override 22253 public OnnxType.TypeVariable typeVariable() { 22254 return typeVariable; 22255 } 22256 } 22257 22258 public enum InputParameter implements OnnxParameter { 22259 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 22260 ; 22261 22262 final OnnxType type; 22263 final Quantifier quantifier; 22264 22265 InputParameter(OnnxType type, Quantifier quantifier) { 22266 this.type = type; 22267 this.quantifier = quantifier; 22268 } 22269 22270 @Override 22271 public OnnxType type() { 22272 return type; 22273 } 22274 22275 @Override 22276 public Quantifier quantifier() { 22277 return quantifier; 22278 } 22279 } 22280 22281 public enum OutputParameter implements OnnxParameter { 22282 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 22283 ; 22284 22285 final OnnxType type; 22286 final Quantifier quantifier; 22287 22288 OutputParameter(OnnxType type, Quantifier quantifier) { 22289 this.type = type; 22290 this.quantifier = quantifier; 22291 } 22292 22293 @Override 22294 public OnnxType type() { 22295 return type; 22296 } 22297 22298 @Override 22299 public Quantifier quantifier() { 22300 return quantifier; 22301 } 22302 } 22303 22304 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 22305 NAME, 22306 List.of(Attribute.values()), 22307 List.of(TypeConstraint.values()), 22308 List.of(InputParameter.values()), 22309 List.of(OutputParameter.values()) 22310 ); 22311 22312 public RegexFullMatch(ExternalizedOp def) { 22313 super(SCHEMA, def); 22314 } 22315 22316 RegexFullMatch(RegexFullMatch that, CopyContext cc) { 22317 super(that, cc); 22318 } 22319 22320 @Override 22321 public RegexFullMatch transform(CopyContext cc, OpTransformer ot) { 22322 return new RegexFullMatch(this, cc); 22323 } 22324 22325 RegexFullMatch(TypeElement resultType, Value X, java.util.Optional<String> pattern) { 22326 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(pattern)); 22327 } 22328 22329 @Override 22330 public SequencedSet<OnnxParameter> onnxOutputs() { 22331 return onnxOutputs(SCHEMA); 22332 } 22333 22334 @Override 22335 public SequencedMap<OnnxParameter, Object> onnxInputs() { 22336 return onnxInputs(SCHEMA, List.of(X())); 22337 } 22338 22339 public Value X() { 22340 return operands().get(0); 22341 } 22342 22343 public java.util.Optional<String> pattern() { 22344 String pattern = Attribute.pattern.access(String.class, onnxAttributes); 22345 return java.util.Optional.ofNullable(pattern); 22346 } 22347 22348 } 22349 22350 public static RegexFullMatch RegexFullMatch(TypeElement resultType, Value X, java.util.Optional<String> pattern) { 22351 return new RegexFullMatch(resultType, X, pattern); 22352 } 22353 22354 @OpFactory.OpDeclaration(Relu.NAME) 22355 public static final class Relu extends OnnxOp { 22356 public static final String NAME = "Relu"; 22357 22358 public enum Attribute implements OnnxAttribute.None { } 22359 22360 public enum TypeConstraint implements OnnxTypeConstraint { 22361 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())))), 22362 ; 22363 22364 final OnnxType.TypeVariable typeVariable; 22365 22366 TypeConstraint(OnnxType.TypeVariable typeVariable) { 22367 assert typeVariable.name().equals(name()); 22368 this.typeVariable = typeVariable; 22369 } 22370 22371 @Override 22372 public OnnxType.TypeVariable typeVariable() { 22373 return typeVariable; 22374 } 22375 } 22376 22377 public enum InputParameter implements OnnxParameter { 22378 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 22379 ; 22380 22381 final OnnxType type; 22382 final Quantifier quantifier; 22383 22384 InputParameter(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 enum OutputParameter implements OnnxParameter { 22401 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 22402 ; 22403 22404 final OnnxType type; 22405 final Quantifier quantifier; 22406 22407 OutputParameter(OnnxType type, Quantifier quantifier) { 22408 this.type = type; 22409 this.quantifier = quantifier; 22410 } 22411 22412 @Override 22413 public OnnxType type() { 22414 return type; 22415 } 22416 22417 @Override 22418 public Quantifier quantifier() { 22419 return quantifier; 22420 } 22421 } 22422 22423 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 22424 NAME, 22425 List.of(Attribute.values()), 22426 List.of(TypeConstraint.values()), 22427 List.of(InputParameter.values()), 22428 List.of(OutputParameter.values()) 22429 ); 22430 22431 public Relu(ExternalizedOp def) { 22432 super(SCHEMA, def); 22433 } 22434 22435 Relu(Relu that, CopyContext cc) { 22436 super(that, cc); 22437 } 22438 22439 @Override 22440 public Relu transform(CopyContext cc, OpTransformer ot) { 22441 return new Relu(this, cc); 22442 } 22443 22444 Relu(TypeElement resultType, Value X) { 22445 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 22446 } 22447 22448 @Override 22449 public SequencedSet<OnnxParameter> onnxOutputs() { 22450 return onnxOutputs(SCHEMA); 22451 } 22452 22453 @Override 22454 public SequencedMap<OnnxParameter, Object> onnxInputs() { 22455 return onnxInputs(SCHEMA, List.of(X())); 22456 } 22457 22458 public Value X() { 22459 return operands().get(0); 22460 } 22461 22462 } 22463 22464 public static Relu Relu(TypeElement resultType, Value X) { 22465 return new Relu(resultType, X); 22466 } 22467 22468 @OpFactory.OpDeclaration(Reshape.NAME) 22469 public static final class Reshape extends OnnxOp { 22470 public static final String NAME = "Reshape"; 22471 22472 public enum Attribute implements OnnxAttribute { 22473 allowzero(Long.class, true, 0), 22474 ; 22475 22476 final Class<?> t; 22477 final boolean optional; 22478 final Object defaultValue; 22479 22480 Attribute(Class<?> type, boolean optional, Object defaultValue) { 22481 this.t = type; 22482 this.optional = optional; 22483 this.defaultValue = defaultValue; 22484 assert optional || defaultValue == null; 22485 } 22486 22487 public Class<?> type() { 22488 return t; 22489 } 22490 22491 public boolean isOptional() { 22492 return optional; 22493 } 22494 22495 public Object defaultValue() { 22496 return defaultValue; 22497 } 22498 } 22499 22500 public enum TypeConstraint implements OnnxTypeConstraint { 22501 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())))), 22502 ; 22503 22504 final OnnxType.TypeVariable typeVariable; 22505 22506 TypeConstraint(OnnxType.TypeVariable typeVariable) { 22507 assert typeVariable.name().equals(name()); 22508 this.typeVariable = typeVariable; 22509 } 22510 22511 @Override 22512 public OnnxType.TypeVariable typeVariable() { 22513 return typeVariable; 22514 } 22515 } 22516 22517 public enum InputParameter implements OnnxParameter { 22518 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 22519 shape(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 22520 ; 22521 22522 final OnnxType type; 22523 final Quantifier quantifier; 22524 22525 InputParameter(OnnxType type, Quantifier quantifier) { 22526 this.type = type; 22527 this.quantifier = quantifier; 22528 } 22529 22530 @Override 22531 public OnnxType type() { 22532 return type; 22533 } 22534 22535 @Override 22536 public Quantifier quantifier() { 22537 return quantifier; 22538 } 22539 } 22540 22541 public enum OutputParameter implements OnnxParameter { 22542 reshaped(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 22543 ; 22544 22545 final OnnxType type; 22546 final Quantifier quantifier; 22547 22548 OutputParameter(OnnxType type, Quantifier quantifier) { 22549 this.type = type; 22550 this.quantifier = quantifier; 22551 } 22552 22553 @Override 22554 public OnnxType type() { 22555 return type; 22556 } 22557 22558 @Override 22559 public Quantifier quantifier() { 22560 return quantifier; 22561 } 22562 } 22563 22564 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 22565 NAME, 22566 List.of(Attribute.values()), 22567 List.of(TypeConstraint.values()), 22568 List.of(InputParameter.values()), 22569 List.of(OutputParameter.values()) 22570 ); 22571 22572 public Reshape(ExternalizedOp def) { 22573 super(SCHEMA, def); 22574 } 22575 22576 Reshape(Reshape that, CopyContext cc) { 22577 super(that, cc); 22578 } 22579 22580 @Override 22581 public Reshape transform(CopyContext cc, OpTransformer ot) { 22582 return new Reshape(this, cc); 22583 } 22584 22585 Reshape(TypeElement resultType, Value data, Value shape, java.util.Optional<Long> allowzero) { 22586 super(SCHEMA, resultType, Set.of(), List.of(data, shape), List.of(allowzero)); 22587 } 22588 22589 @Override 22590 public SequencedSet<OnnxParameter> onnxOutputs() { 22591 return onnxOutputs(SCHEMA); 22592 } 22593 22594 @Override 22595 public SequencedMap<OnnxParameter, Object> onnxInputs() { 22596 return onnxInputs(SCHEMA, List.of(data(), shape())); 22597 } 22598 22599 public Value data() { 22600 return operands().get(0); 22601 } 22602 22603 public Value shape() { 22604 return operands().get(1); 22605 } 22606 22607 public java.util.Optional<Long> allowzero() { 22608 Long allowzero = Attribute.allowzero.access(Long.class, onnxAttributes); 22609 return java.util.Optional.ofNullable(allowzero); 22610 } 22611 22612 } 22613 22614 public static Reshape Reshape(TypeElement resultType, Value data, Value shape, java.util.Optional<Long> allowzero) { 22615 return new Reshape(resultType, data, shape, allowzero); 22616 } 22617 22618 @OpFactory.OpDeclaration(Resize.NAME) 22619 public static final class Resize extends OnnxOp { 22620 public static final String NAME = "Resize"; 22621 22622 public enum Attribute implements OnnxAttribute { 22623 mode(String.class, true, "nearest"), 22624 extrapolation_value(Float.class, true, 0.0f), 22625 nearest_mode(String.class, true, "round_prefer_floor"), 22626 antialias(Long.class, true, 0), 22627 cubic_coeff_a(Float.class, true, -0.75f), 22628 axes(long[].class, true, null), 22629 coordinate_transformation_mode(String.class, true, "half_pixel"), 22630 keep_aspect_ratio_policy(String.class, true, "stretch"), 22631 exclude_outside(Long.class, true, 0), 22632 ; 22633 22634 final Class<?> t; 22635 final boolean optional; 22636 final Object defaultValue; 22637 22638 Attribute(Class<?> type, boolean optional, Object defaultValue) { 22639 this.t = type; 22640 this.optional = optional; 22641 this.defaultValue = defaultValue; 22642 assert optional || defaultValue == null; 22643 } 22644 22645 public Class<?> type() { 22646 return t; 22647 } 22648 22649 public boolean isOptional() { 22650 return optional; 22651 } 22652 22653 public Object defaultValue() { 22654 return defaultValue; 22655 } 22656 } 22657 22658 public enum TypeConstraint implements OnnxTypeConstraint { 22659 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())))), 22660 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 22661 ; 22662 22663 final OnnxType.TypeVariable typeVariable; 22664 22665 TypeConstraint(OnnxType.TypeVariable typeVariable) { 22666 assert typeVariable.name().equals(name()); 22667 this.typeVariable = typeVariable; 22668 } 22669 22670 @Override 22671 public OnnxType.TypeVariable typeVariable() { 22672 return typeVariable; 22673 } 22674 } 22675 22676 public enum InputParameter implements OnnxParameter { 22677 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 22678 roi(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 22679 scales(OnnxType.tensor(OnnxType.float32()), Quantifier.OPTIONAL), 22680 sizes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 22681 ; 22682 22683 final OnnxType type; 22684 final Quantifier quantifier; 22685 22686 InputParameter(OnnxType type, Quantifier quantifier) { 22687 this.type = type; 22688 this.quantifier = quantifier; 22689 } 22690 22691 @Override 22692 public OnnxType type() { 22693 return type; 22694 } 22695 22696 @Override 22697 public Quantifier quantifier() { 22698 return quantifier; 22699 } 22700 } 22701 22702 public enum OutputParameter implements OnnxParameter { 22703 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 22704 ; 22705 22706 final OnnxType type; 22707 final Quantifier quantifier; 22708 22709 OutputParameter(OnnxType type, Quantifier quantifier) { 22710 this.type = type; 22711 this.quantifier = quantifier; 22712 } 22713 22714 @Override 22715 public OnnxType type() { 22716 return type; 22717 } 22718 22719 @Override 22720 public Quantifier quantifier() { 22721 return quantifier; 22722 } 22723 } 22724 22725 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 22726 NAME, 22727 List.of(Attribute.values()), 22728 List.of(TypeConstraint.values()), 22729 List.of(InputParameter.values()), 22730 List.of(OutputParameter.values()) 22731 ); 22732 22733 public Resize(ExternalizedOp def) { 22734 super(SCHEMA, def); 22735 } 22736 22737 Resize(Resize that, CopyContext cc) { 22738 super(that, cc); 22739 } 22740 22741 @Override 22742 public Resize transform(CopyContext cc, OpTransformer ot) { 22743 return new Resize(this, cc); 22744 } 22745 22746 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) { 22747 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)); 22748 } 22749 22750 @Override 22751 public SequencedSet<OnnxParameter> onnxOutputs() { 22752 return onnxOutputs(SCHEMA); 22753 } 22754 22755 @Override 22756 public SequencedMap<OnnxParameter, Object> onnxInputs() { 22757 return onnxInputs(SCHEMA, List.of(X(), roi(), scales(), sizes())); 22758 } 22759 22760 public Value X() { 22761 return operands().get(0); 22762 } 22763 22764 public java.util.Optional<Value> roi() { 22765 int i = optionalInputArguments.indexOf(InputParameter.roi); 22766 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 22767 } 22768 22769 public java.util.Optional<Value> scales() { 22770 int i = optionalInputArguments.indexOf(InputParameter.scales); 22771 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 22772 } 22773 22774 public java.util.Optional<Value> sizes() { 22775 int i = optionalInputArguments.indexOf(InputParameter.sizes); 22776 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 22777 } 22778 22779 public java.util.Optional<String> mode() { 22780 String mode = Attribute.mode.access(String.class, onnxAttributes); 22781 return java.util.Optional.ofNullable(mode); 22782 } 22783 22784 public java.util.Optional<Float> extrapolation_value() { 22785 Float extrapolation_value = Attribute.extrapolation_value.access(Float.class, onnxAttributes); 22786 return java.util.Optional.ofNullable(extrapolation_value); 22787 } 22788 22789 public java.util.Optional<String> nearest_mode() { 22790 String nearest_mode = Attribute.nearest_mode.access(String.class, onnxAttributes); 22791 return java.util.Optional.ofNullable(nearest_mode); 22792 } 22793 22794 public java.util.Optional<Long> antialias() { 22795 Long antialias = Attribute.antialias.access(Long.class, onnxAttributes); 22796 return java.util.Optional.ofNullable(antialias); 22797 } 22798 22799 public java.util.Optional<Float> cubic_coeff_a() { 22800 Float cubic_coeff_a = Attribute.cubic_coeff_a.access(Float.class, onnxAttributes); 22801 return java.util.Optional.ofNullable(cubic_coeff_a); 22802 } 22803 22804 public java.util.Optional<long[]> axes() { 22805 long[] axes = Attribute.axes.access(long[].class, onnxAttributes); 22806 return java.util.Optional.ofNullable(axes).map(long[]::clone); 22807 } 22808 22809 public java.util.Optional<String> coordinate_transformation_mode() { 22810 String coordinate_transformation_mode = Attribute.coordinate_transformation_mode.access(String.class, onnxAttributes); 22811 return java.util.Optional.ofNullable(coordinate_transformation_mode); 22812 } 22813 22814 public java.util.Optional<String> keep_aspect_ratio_policy() { 22815 String keep_aspect_ratio_policy = Attribute.keep_aspect_ratio_policy.access(String.class, onnxAttributes); 22816 return java.util.Optional.ofNullable(keep_aspect_ratio_policy); 22817 } 22818 22819 public java.util.Optional<Long> exclude_outside() { 22820 Long exclude_outside = Attribute.exclude_outside.access(Long.class, onnxAttributes); 22821 return java.util.Optional.ofNullable(exclude_outside); 22822 } 22823 22824 } 22825 22826 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) { 22827 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); 22828 } 22829 22830 @OpFactory.OpDeclaration(ReverseSequence.NAME) 22831 public static final class ReverseSequence extends OnnxOp { 22832 public static final String NAME = "ReverseSequence"; 22833 22834 public enum Attribute implements OnnxAttribute { 22835 time_axis(Long.class, true, 0), 22836 batch_axis(Long.class, true, 1), 22837 ; 22838 22839 final Class<?> t; 22840 final boolean optional; 22841 final Object defaultValue; 22842 22843 Attribute(Class<?> type, boolean optional, Object defaultValue) { 22844 this.t = type; 22845 this.optional = optional; 22846 this.defaultValue = defaultValue; 22847 assert optional || defaultValue == null; 22848 } 22849 22850 public Class<?> type() { 22851 return t; 22852 } 22853 22854 public boolean isOptional() { 22855 return optional; 22856 } 22857 22858 public Object defaultValue() { 22859 return defaultValue; 22860 } 22861 } 22862 22863 public enum TypeConstraint implements OnnxTypeConstraint { 22864 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())))), 22865 ; 22866 22867 final OnnxType.TypeVariable typeVariable; 22868 22869 TypeConstraint(OnnxType.TypeVariable typeVariable) { 22870 assert typeVariable.name().equals(name()); 22871 this.typeVariable = typeVariable; 22872 } 22873 22874 @Override 22875 public OnnxType.TypeVariable typeVariable() { 22876 return typeVariable; 22877 } 22878 } 22879 22880 public enum InputParameter implements OnnxParameter { 22881 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 22882 sequence_lens(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 22883 ; 22884 22885 final OnnxType type; 22886 final Quantifier quantifier; 22887 22888 InputParameter(OnnxType type, Quantifier quantifier) { 22889 this.type = type; 22890 this.quantifier = quantifier; 22891 } 22892 22893 @Override 22894 public OnnxType type() { 22895 return type; 22896 } 22897 22898 @Override 22899 public Quantifier quantifier() { 22900 return quantifier; 22901 } 22902 } 22903 22904 public enum OutputParameter implements OnnxParameter { 22905 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 22906 ; 22907 22908 final OnnxType type; 22909 final Quantifier quantifier; 22910 22911 OutputParameter(OnnxType type, Quantifier quantifier) { 22912 this.type = type; 22913 this.quantifier = quantifier; 22914 } 22915 22916 @Override 22917 public OnnxType type() { 22918 return type; 22919 } 22920 22921 @Override 22922 public Quantifier quantifier() { 22923 return quantifier; 22924 } 22925 } 22926 22927 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 22928 NAME, 22929 List.of(Attribute.values()), 22930 List.of(TypeConstraint.values()), 22931 List.of(InputParameter.values()), 22932 List.of(OutputParameter.values()) 22933 ); 22934 22935 public ReverseSequence(ExternalizedOp def) { 22936 super(SCHEMA, def); 22937 } 22938 22939 ReverseSequence(ReverseSequence that, CopyContext cc) { 22940 super(that, cc); 22941 } 22942 22943 @Override 22944 public ReverseSequence transform(CopyContext cc, OpTransformer ot) { 22945 return new ReverseSequence(this, cc); 22946 } 22947 22948 ReverseSequence(TypeElement resultType, Value input, Value sequence_lens, java.util.Optional<Long> time_axis, java.util.Optional<Long> batch_axis) { 22949 super(SCHEMA, resultType, Set.of(), List.of(input, sequence_lens), List.of(time_axis, batch_axis)); 22950 } 22951 22952 @Override 22953 public SequencedSet<OnnxParameter> onnxOutputs() { 22954 return onnxOutputs(SCHEMA); 22955 } 22956 22957 @Override 22958 public SequencedMap<OnnxParameter, Object> onnxInputs() { 22959 return onnxInputs(SCHEMA, List.of(input(), sequence_lens())); 22960 } 22961 22962 public Value input() { 22963 return operands().get(0); 22964 } 22965 22966 public Value sequence_lens() { 22967 return operands().get(1); 22968 } 22969 22970 public java.util.Optional<Long> time_axis() { 22971 Long time_axis = Attribute.time_axis.access(Long.class, onnxAttributes); 22972 return java.util.Optional.ofNullable(time_axis); 22973 } 22974 22975 public java.util.Optional<Long> batch_axis() { 22976 Long batch_axis = Attribute.batch_axis.access(Long.class, onnxAttributes); 22977 return java.util.Optional.ofNullable(batch_axis); 22978 } 22979 22980 } 22981 22982 public static ReverseSequence ReverseSequence(TypeElement resultType, Value input, Value sequence_lens, java.util.Optional<Long> time_axis, java.util.Optional<Long> batch_axis) { 22983 return new ReverseSequence(resultType, input, sequence_lens, time_axis, batch_axis); 22984 } 22985 22986 @OpFactory.OpDeclaration(RoiAlign.NAME) 22987 public static final class RoiAlign extends OnnxOp { 22988 public static final String NAME = "RoiAlign"; 22989 22990 public enum Attribute implements OnnxAttribute { 22991 mode(String.class, true, "avg"), 22992 output_width(Long.class, true, 1), 22993 spatial_scale(Float.class, true, 1.0f), 22994 coordinate_transformation_mode(String.class, true, "half_pixel"), 22995 sampling_ratio(Long.class, true, 0), 22996 output_height(Long.class, true, 1), 22997 ; 22998 22999 final Class<?> t; 23000 final boolean optional; 23001 final Object defaultValue; 23002 23003 Attribute(Class<?> type, boolean optional, Object defaultValue) { 23004 this.t = type; 23005 this.optional = optional; 23006 this.defaultValue = defaultValue; 23007 assert optional || defaultValue == null; 23008 } 23009 23010 public Class<?> type() { 23011 return t; 23012 } 23013 23014 public boolean isOptional() { 23015 return optional; 23016 } 23017 23018 public Object defaultValue() { 23019 return defaultValue; 23020 } 23021 } 23022 23023 public enum TypeConstraint implements OnnxTypeConstraint { 23024 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 23025 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int64())))), 23026 ; 23027 23028 final OnnxType.TypeVariable typeVariable; 23029 23030 TypeConstraint(OnnxType.TypeVariable typeVariable) { 23031 assert typeVariable.name().equals(name()); 23032 this.typeVariable = typeVariable; 23033 } 23034 23035 @Override 23036 public OnnxType.TypeVariable typeVariable() { 23037 return typeVariable; 23038 } 23039 } 23040 23041 public enum InputParameter implements OnnxParameter { 23042 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 23043 rois(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 23044 batch_indices(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 23045 ; 23046 23047 final OnnxType type; 23048 final Quantifier quantifier; 23049 23050 InputParameter(OnnxType type, Quantifier quantifier) { 23051 this.type = type; 23052 this.quantifier = quantifier; 23053 } 23054 23055 @Override 23056 public OnnxType type() { 23057 return type; 23058 } 23059 23060 @Override 23061 public Quantifier quantifier() { 23062 return quantifier; 23063 } 23064 } 23065 23066 public enum OutputParameter implements OnnxParameter { 23067 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 23068 ; 23069 23070 final OnnxType type; 23071 final Quantifier quantifier; 23072 23073 OutputParameter(OnnxType type, Quantifier quantifier) { 23074 this.type = type; 23075 this.quantifier = quantifier; 23076 } 23077 23078 @Override 23079 public OnnxType type() { 23080 return type; 23081 } 23082 23083 @Override 23084 public Quantifier quantifier() { 23085 return quantifier; 23086 } 23087 } 23088 23089 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 23090 NAME, 23091 List.of(Attribute.values()), 23092 List.of(TypeConstraint.values()), 23093 List.of(InputParameter.values()), 23094 List.of(OutputParameter.values()) 23095 ); 23096 23097 public RoiAlign(ExternalizedOp def) { 23098 super(SCHEMA, def); 23099 } 23100 23101 RoiAlign(RoiAlign that, CopyContext cc) { 23102 super(that, cc); 23103 } 23104 23105 @Override 23106 public RoiAlign transform(CopyContext cc, OpTransformer ot) { 23107 return new RoiAlign(this, cc); 23108 } 23109 23110 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) { 23111 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)); 23112 } 23113 23114 @Override 23115 public SequencedSet<OnnxParameter> onnxOutputs() { 23116 return onnxOutputs(SCHEMA); 23117 } 23118 23119 @Override 23120 public SequencedMap<OnnxParameter, Object> onnxInputs() { 23121 return onnxInputs(SCHEMA, List.of(X(), rois(), batch_indices())); 23122 } 23123 23124 public Value X() { 23125 return operands().get(0); 23126 } 23127 23128 public Value rois() { 23129 return operands().get(1); 23130 } 23131 23132 public Value batch_indices() { 23133 return operands().get(2); 23134 } 23135 23136 public java.util.Optional<String> mode() { 23137 String mode = Attribute.mode.access(String.class, onnxAttributes); 23138 return java.util.Optional.ofNullable(mode); 23139 } 23140 23141 public java.util.Optional<Long> output_width() { 23142 Long output_width = Attribute.output_width.access(Long.class, onnxAttributes); 23143 return java.util.Optional.ofNullable(output_width); 23144 } 23145 23146 public java.util.Optional<Float> spatial_scale() { 23147 Float spatial_scale = Attribute.spatial_scale.access(Float.class, onnxAttributes); 23148 return java.util.Optional.ofNullable(spatial_scale); 23149 } 23150 23151 public java.util.Optional<String> coordinate_transformation_mode() { 23152 String coordinate_transformation_mode = Attribute.coordinate_transformation_mode.access(String.class, onnxAttributes); 23153 return java.util.Optional.ofNullable(coordinate_transformation_mode); 23154 } 23155 23156 public java.util.Optional<Long> sampling_ratio() { 23157 Long sampling_ratio = Attribute.sampling_ratio.access(Long.class, onnxAttributes); 23158 return java.util.Optional.ofNullable(sampling_ratio); 23159 } 23160 23161 public java.util.Optional<Long> output_height() { 23162 Long output_height = Attribute.output_height.access(Long.class, onnxAttributes); 23163 return java.util.Optional.ofNullable(output_height); 23164 } 23165 23166 } 23167 23168 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) { 23169 return new RoiAlign(resultType, X, rois, batch_indices, mode, output_width, spatial_scale, coordinate_transformation_mode, sampling_ratio, output_height); 23170 } 23171 23172 @OpFactory.OpDeclaration(Round.NAME) 23173 public static final class Round extends OnnxOp { 23174 public static final String NAME = "Round"; 23175 23176 public enum Attribute implements OnnxAttribute.None { } 23177 23178 public enum TypeConstraint implements OnnxTypeConstraint { 23179 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 23180 ; 23181 23182 final OnnxType.TypeVariable typeVariable; 23183 23184 TypeConstraint(OnnxType.TypeVariable typeVariable) { 23185 assert typeVariable.name().equals(name()); 23186 this.typeVariable = typeVariable; 23187 } 23188 23189 @Override 23190 public OnnxType.TypeVariable typeVariable() { 23191 return typeVariable; 23192 } 23193 } 23194 23195 public enum InputParameter implements OnnxParameter { 23196 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 23197 ; 23198 23199 final OnnxType type; 23200 final Quantifier quantifier; 23201 23202 InputParameter(OnnxType type, Quantifier quantifier) { 23203 this.type = type; 23204 this.quantifier = quantifier; 23205 } 23206 23207 @Override 23208 public OnnxType type() { 23209 return type; 23210 } 23211 23212 @Override 23213 public Quantifier quantifier() { 23214 return quantifier; 23215 } 23216 } 23217 23218 public enum OutputParameter implements OnnxParameter { 23219 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 23220 ; 23221 23222 final OnnxType type; 23223 final Quantifier quantifier; 23224 23225 OutputParameter(OnnxType type, Quantifier quantifier) { 23226 this.type = type; 23227 this.quantifier = quantifier; 23228 } 23229 23230 @Override 23231 public OnnxType type() { 23232 return type; 23233 } 23234 23235 @Override 23236 public Quantifier quantifier() { 23237 return quantifier; 23238 } 23239 } 23240 23241 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 23242 NAME, 23243 List.of(Attribute.values()), 23244 List.of(TypeConstraint.values()), 23245 List.of(InputParameter.values()), 23246 List.of(OutputParameter.values()) 23247 ); 23248 23249 public Round(ExternalizedOp def) { 23250 super(SCHEMA, def); 23251 } 23252 23253 Round(Round that, CopyContext cc) { 23254 super(that, cc); 23255 } 23256 23257 @Override 23258 public Round transform(CopyContext cc, OpTransformer ot) { 23259 return new Round(this, cc); 23260 } 23261 23262 Round(TypeElement resultType, Value X) { 23263 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 23264 } 23265 23266 @Override 23267 public SequencedSet<OnnxParameter> onnxOutputs() { 23268 return onnxOutputs(SCHEMA); 23269 } 23270 23271 @Override 23272 public SequencedMap<OnnxParameter, Object> onnxInputs() { 23273 return onnxInputs(SCHEMA, List.of(X())); 23274 } 23275 23276 public Value X() { 23277 return operands().get(0); 23278 } 23279 23280 } 23281 23282 public static Round Round(TypeElement resultType, Value X) { 23283 return new Round(resultType, X); 23284 } 23285 23286 @OpFactory.OpDeclaration(STFT.NAME) 23287 public static final class STFT extends OnnxOp { 23288 public static final String NAME = "STFT"; 23289 23290 public enum Attribute implements OnnxAttribute { 23291 onesided(Long.class, true, 1), 23292 ; 23293 23294 final Class<?> t; 23295 final boolean optional; 23296 final Object defaultValue; 23297 23298 Attribute(Class<?> type, boolean optional, Object defaultValue) { 23299 this.t = type; 23300 this.optional = optional; 23301 this.defaultValue = defaultValue; 23302 assert optional || defaultValue == null; 23303 } 23304 23305 public Class<?> type() { 23306 return t; 23307 } 23308 23309 public boolean isOptional() { 23310 return optional; 23311 } 23312 23313 public Object defaultValue() { 23314 return defaultValue; 23315 } 23316 } 23317 23318 public enum TypeConstraint implements OnnxTypeConstraint { 23319 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 23320 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 23321 ; 23322 23323 final OnnxType.TypeVariable typeVariable; 23324 23325 TypeConstraint(OnnxType.TypeVariable typeVariable) { 23326 assert typeVariable.name().equals(name()); 23327 this.typeVariable = typeVariable; 23328 } 23329 23330 @Override 23331 public OnnxType.TypeVariable typeVariable() { 23332 return typeVariable; 23333 } 23334 } 23335 23336 public enum InputParameter implements OnnxParameter { 23337 signal(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 23338 frame_step(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 23339 window(TypeConstraint.T1.typeVariable(), Quantifier.OPTIONAL), 23340 frame_length(TypeConstraint.T2.typeVariable(), Quantifier.OPTIONAL), 23341 ; 23342 23343 final OnnxType type; 23344 final Quantifier quantifier; 23345 23346 InputParameter(OnnxType type, Quantifier quantifier) { 23347 this.type = type; 23348 this.quantifier = quantifier; 23349 } 23350 23351 @Override 23352 public OnnxType type() { 23353 return type; 23354 } 23355 23356 @Override 23357 public Quantifier quantifier() { 23358 return quantifier; 23359 } 23360 } 23361 23362 public enum OutputParameter implements OnnxParameter { 23363 output(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 23364 ; 23365 23366 final OnnxType type; 23367 final Quantifier quantifier; 23368 23369 OutputParameter(OnnxType type, Quantifier quantifier) { 23370 this.type = type; 23371 this.quantifier = quantifier; 23372 } 23373 23374 @Override 23375 public OnnxType type() { 23376 return type; 23377 } 23378 23379 @Override 23380 public Quantifier quantifier() { 23381 return quantifier; 23382 } 23383 } 23384 23385 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 23386 NAME, 23387 List.of(Attribute.values()), 23388 List.of(TypeConstraint.values()), 23389 List.of(InputParameter.values()), 23390 List.of(OutputParameter.values()) 23391 ); 23392 23393 public STFT(ExternalizedOp def) { 23394 super(SCHEMA, def); 23395 } 23396 23397 STFT(STFT that, CopyContext cc) { 23398 super(that, cc); 23399 } 23400 23401 @Override 23402 public STFT transform(CopyContext cc, OpTransformer ot) { 23403 return new STFT(this, cc); 23404 } 23405 23406 STFT(TypeElement resultType, Value signal, Value frame_step, java.util.Optional<Value> window, java.util.Optional<Value> frame_length, java.util.Optional<Long> onesided) { 23407 super(SCHEMA, resultType, Set.of(), List.of(signal, frame_step, window, frame_length), List.of(onesided)); 23408 } 23409 23410 @Override 23411 public SequencedSet<OnnxParameter> onnxOutputs() { 23412 return onnxOutputs(SCHEMA); 23413 } 23414 23415 @Override 23416 public SequencedMap<OnnxParameter, Object> onnxInputs() { 23417 return onnxInputs(SCHEMA, List.of(signal(), frame_step(), window(), frame_length())); 23418 } 23419 23420 public Value signal() { 23421 return operands().get(0); 23422 } 23423 23424 public Value frame_step() { 23425 return operands().get(1); 23426 } 23427 23428 public java.util.Optional<Value> window() { 23429 int i = optionalInputArguments.indexOf(InputParameter.window); 23430 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 23431 } 23432 23433 public java.util.Optional<Value> frame_length() { 23434 int i = optionalInputArguments.indexOf(InputParameter.frame_length); 23435 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 23436 } 23437 23438 public java.util.Optional<Long> onesided() { 23439 Long onesided = Attribute.onesided.access(Long.class, onnxAttributes); 23440 return java.util.Optional.ofNullable(onesided); 23441 } 23442 23443 } 23444 23445 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) { 23446 return new STFT(resultType, signal, frame_step, window, frame_length, onesided); 23447 } 23448 23449 @OpFactory.OpDeclaration(SVMClassifier.NAME) 23450 public static final class SVMClassifier extends OnnxOp { 23451 public static final String NAME = "SVMClassifier"; 23452 23453 public enum Attribute implements OnnxAttribute { 23454 prob_b(float[].class, true, null), 23455 kernel_params(float[].class, true, null), 23456 kernel_type(String.class, true, "LINEAR"), 23457 classlabels_ints(long[].class, true, null), 23458 post_transform(String.class, true, "NONE"), 23459 rho(float[].class, true, null), 23460 coefficients(float[].class, true, null), 23461 support_vectors(float[].class, true, null), 23462 vectors_per_class(long[].class, true, null), 23463 prob_a(float[].class, true, null), 23464 classlabels_strings(String[].class, true, null), 23465 ; 23466 23467 final Class<?> t; 23468 final boolean optional; 23469 final Object defaultValue; 23470 23471 Attribute(Class<?> type, boolean optional, Object defaultValue) { 23472 this.t = type; 23473 this.optional = optional; 23474 this.defaultValue = defaultValue; 23475 assert optional || defaultValue == null; 23476 } 23477 23478 public Class<?> type() { 23479 return t; 23480 } 23481 23482 public boolean isOptional() { 23483 return optional; 23484 } 23485 23486 public Object defaultValue() { 23487 return defaultValue; 23488 } 23489 } 23490 23491 public enum TypeConstraint implements OnnxTypeConstraint { 23492 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 23493 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))), 23494 ; 23495 23496 final OnnxType.TypeVariable typeVariable; 23497 23498 TypeConstraint(OnnxType.TypeVariable typeVariable) { 23499 assert typeVariable.name().equals(name()); 23500 this.typeVariable = typeVariable; 23501 } 23502 23503 @Override 23504 public OnnxType.TypeVariable typeVariable() { 23505 return typeVariable; 23506 } 23507 } 23508 23509 public enum InputParameter implements OnnxParameter { 23510 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 23511 ; 23512 23513 final OnnxType type; 23514 final Quantifier quantifier; 23515 23516 InputParameter(OnnxType type, Quantifier quantifier) { 23517 this.type = type; 23518 this.quantifier = quantifier; 23519 } 23520 23521 @Override 23522 public OnnxType type() { 23523 return type; 23524 } 23525 23526 @Override 23527 public Quantifier quantifier() { 23528 return quantifier; 23529 } 23530 } 23531 23532 public enum OutputParameter implements OnnxParameter { 23533 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 23534 Z(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 23535 ; 23536 23537 final OnnxType type; 23538 final Quantifier quantifier; 23539 23540 OutputParameter(OnnxType type, Quantifier quantifier) { 23541 this.type = type; 23542 this.quantifier = quantifier; 23543 } 23544 23545 @Override 23546 public OnnxType type() { 23547 return type; 23548 } 23549 23550 @Override 23551 public Quantifier quantifier() { 23552 return quantifier; 23553 } 23554 } 23555 23556 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 23557 NAME, 23558 List.of(Attribute.values()), 23559 List.of(TypeConstraint.values()), 23560 List.of(InputParameter.values()), 23561 List.of(OutputParameter.values()) 23562 ); 23563 23564 public SVMClassifier(ExternalizedOp def) { 23565 super(SCHEMA, def); 23566 } 23567 23568 SVMClassifier(SVMClassifier that, CopyContext cc) { 23569 super(that, cc); 23570 } 23571 23572 @Override 23573 public SVMClassifier transform(CopyContext cc, OpTransformer ot) { 23574 return new SVMClassifier(this, cc); 23575 } 23576 23577 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) { 23578 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)); 23579 } 23580 23581 @Override 23582 public SequencedSet<OnnxParameter> onnxOutputs() { 23583 return onnxOutputs(SCHEMA); 23584 } 23585 23586 @Override 23587 public SequencedMap<OnnxParameter, Object> onnxInputs() { 23588 return onnxInputs(SCHEMA, List.of(X())); 23589 } 23590 23591 public Value X() { 23592 return operands().get(0); 23593 } 23594 23595 public java.util.Optional<float[]> prob_b() { 23596 float[] prob_b = Attribute.prob_b.access(float[].class, onnxAttributes); 23597 return java.util.Optional.ofNullable(prob_b).map(float[]::clone); 23598 } 23599 23600 public java.util.Optional<float[]> kernel_params() { 23601 float[] kernel_params = Attribute.kernel_params.access(float[].class, onnxAttributes); 23602 return java.util.Optional.ofNullable(kernel_params).map(float[]::clone); 23603 } 23604 23605 public java.util.Optional<String> kernel_type() { 23606 String kernel_type = Attribute.kernel_type.access(String.class, onnxAttributes); 23607 return java.util.Optional.ofNullable(kernel_type); 23608 } 23609 23610 public java.util.Optional<long[]> classlabels_ints() { 23611 long[] classlabels_ints = Attribute.classlabels_ints.access(long[].class, onnxAttributes); 23612 return java.util.Optional.ofNullable(classlabels_ints).map(long[]::clone); 23613 } 23614 23615 public java.util.Optional<String> post_transform() { 23616 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes); 23617 return java.util.Optional.ofNullable(post_transform); 23618 } 23619 23620 public java.util.Optional<float[]> rho() { 23621 float[] rho = Attribute.rho.access(float[].class, onnxAttributes); 23622 return java.util.Optional.ofNullable(rho).map(float[]::clone); 23623 } 23624 23625 public java.util.Optional<float[]> coefficients() { 23626 float[] coefficients = Attribute.coefficients.access(float[].class, onnxAttributes); 23627 return java.util.Optional.ofNullable(coefficients).map(float[]::clone); 23628 } 23629 23630 public java.util.Optional<float[]> support_vectors() { 23631 float[] support_vectors = Attribute.support_vectors.access(float[].class, onnxAttributes); 23632 return java.util.Optional.ofNullable(support_vectors).map(float[]::clone); 23633 } 23634 23635 public java.util.Optional<long[]> vectors_per_class() { 23636 long[] vectors_per_class = Attribute.vectors_per_class.access(long[].class, onnxAttributes); 23637 return java.util.Optional.ofNullable(vectors_per_class).map(long[]::clone); 23638 } 23639 23640 public java.util.Optional<float[]> prob_a() { 23641 float[] prob_a = Attribute.prob_a.access(float[].class, onnxAttributes); 23642 return java.util.Optional.ofNullable(prob_a).map(float[]::clone); 23643 } 23644 23645 public java.util.Optional<String[]> classlabels_strings() { 23646 String[] classlabels_strings = Attribute.classlabels_strings.access(String[].class, onnxAttributes); 23647 return java.util.Optional.ofNullable(classlabels_strings).map(String[]::clone); 23648 } 23649 23650 } 23651 23652 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) { 23653 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); 23654 } 23655 23656 @OpFactory.OpDeclaration(SVMRegressor.NAME) 23657 public static final class SVMRegressor extends OnnxOp { 23658 public static final String NAME = "SVMRegressor"; 23659 23660 public enum Attribute implements OnnxAttribute { 23661 kernel_type(String.class, true, "LINEAR"), 23662 kernel_params(float[].class, true, null), 23663 n_supports(Long.class, true, 0), 23664 rho(float[].class, true, null), 23665 post_transform(String.class, true, "NONE"), 23666 coefficients(float[].class, true, null), 23667 support_vectors(float[].class, true, null), 23668 one_class(Long.class, true, 0), 23669 ; 23670 23671 final Class<?> t; 23672 final boolean optional; 23673 final Object defaultValue; 23674 23675 Attribute(Class<?> type, boolean optional, Object defaultValue) { 23676 this.t = type; 23677 this.optional = optional; 23678 this.defaultValue = defaultValue; 23679 assert optional || defaultValue == null; 23680 } 23681 23682 public Class<?> type() { 23683 return t; 23684 } 23685 23686 public boolean isOptional() { 23687 return optional; 23688 } 23689 23690 public Object defaultValue() { 23691 return defaultValue; 23692 } 23693 } 23694 23695 public enum TypeConstraint implements OnnxTypeConstraint { 23696 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 23697 ; 23698 23699 final OnnxType.TypeVariable typeVariable; 23700 23701 TypeConstraint(OnnxType.TypeVariable typeVariable) { 23702 assert typeVariable.name().equals(name()); 23703 this.typeVariable = typeVariable; 23704 } 23705 23706 @Override 23707 public OnnxType.TypeVariable typeVariable() { 23708 return typeVariable; 23709 } 23710 } 23711 23712 public enum InputParameter implements OnnxParameter { 23713 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 23714 ; 23715 23716 final OnnxType type; 23717 final Quantifier quantifier; 23718 23719 InputParameter(OnnxType type, Quantifier quantifier) { 23720 this.type = type; 23721 this.quantifier = quantifier; 23722 } 23723 23724 @Override 23725 public OnnxType type() { 23726 return type; 23727 } 23728 23729 @Override 23730 public Quantifier quantifier() { 23731 return quantifier; 23732 } 23733 } 23734 23735 public enum OutputParameter implements OnnxParameter { 23736 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 23737 ; 23738 23739 final OnnxType type; 23740 final Quantifier quantifier; 23741 23742 OutputParameter(OnnxType type, Quantifier quantifier) { 23743 this.type = type; 23744 this.quantifier = quantifier; 23745 } 23746 23747 @Override 23748 public OnnxType type() { 23749 return type; 23750 } 23751 23752 @Override 23753 public Quantifier quantifier() { 23754 return quantifier; 23755 } 23756 } 23757 23758 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 23759 NAME, 23760 List.of(Attribute.values()), 23761 List.of(TypeConstraint.values()), 23762 List.of(InputParameter.values()), 23763 List.of(OutputParameter.values()) 23764 ); 23765 23766 public SVMRegressor(ExternalizedOp def) { 23767 super(SCHEMA, def); 23768 } 23769 23770 SVMRegressor(SVMRegressor that, CopyContext cc) { 23771 super(that, cc); 23772 } 23773 23774 @Override 23775 public SVMRegressor transform(CopyContext cc, OpTransformer ot) { 23776 return new SVMRegressor(this, cc); 23777 } 23778 23779 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) { 23780 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(kernel_type, kernel_params, n_supports, rho, post_transform, coefficients, support_vectors, one_class)); 23781 } 23782 23783 @Override 23784 public SequencedSet<OnnxParameter> onnxOutputs() { 23785 return onnxOutputs(SCHEMA); 23786 } 23787 23788 @Override 23789 public SequencedMap<OnnxParameter, Object> onnxInputs() { 23790 return onnxInputs(SCHEMA, List.of(X())); 23791 } 23792 23793 public Value X() { 23794 return operands().get(0); 23795 } 23796 23797 public java.util.Optional<String> kernel_type() { 23798 String kernel_type = Attribute.kernel_type.access(String.class, onnxAttributes); 23799 return java.util.Optional.ofNullable(kernel_type); 23800 } 23801 23802 public java.util.Optional<float[]> kernel_params() { 23803 float[] kernel_params = Attribute.kernel_params.access(float[].class, onnxAttributes); 23804 return java.util.Optional.ofNullable(kernel_params).map(float[]::clone); 23805 } 23806 23807 public java.util.Optional<Long> n_supports() { 23808 Long n_supports = Attribute.n_supports.access(Long.class, onnxAttributes); 23809 return java.util.Optional.ofNullable(n_supports); 23810 } 23811 23812 public java.util.Optional<float[]> rho() { 23813 float[] rho = Attribute.rho.access(float[].class, onnxAttributes); 23814 return java.util.Optional.ofNullable(rho).map(float[]::clone); 23815 } 23816 23817 public java.util.Optional<String> post_transform() { 23818 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes); 23819 return java.util.Optional.ofNullable(post_transform); 23820 } 23821 23822 public java.util.Optional<float[]> coefficients() { 23823 float[] coefficients = Attribute.coefficients.access(float[].class, onnxAttributes); 23824 return java.util.Optional.ofNullable(coefficients).map(float[]::clone); 23825 } 23826 23827 public java.util.Optional<float[]> support_vectors() { 23828 float[] support_vectors = Attribute.support_vectors.access(float[].class, onnxAttributes); 23829 return java.util.Optional.ofNullable(support_vectors).map(float[]::clone); 23830 } 23831 23832 public java.util.Optional<Long> one_class() { 23833 Long one_class = Attribute.one_class.access(Long.class, onnxAttributes); 23834 return java.util.Optional.ofNullable(one_class); 23835 } 23836 23837 } 23838 23839 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) { 23840 return new SVMRegressor(resultType, X, kernel_type, kernel_params, n_supports, rho, post_transform, coefficients, support_vectors, one_class); 23841 } 23842 23843 @OpFactory.OpDeclaration(Scaler.NAME) 23844 public static final class Scaler extends OnnxOp { 23845 public static final String NAME = "Scaler"; 23846 23847 public enum Attribute implements OnnxAttribute { 23848 offset(float[].class, true, null), 23849 scale(float[].class, true, null), 23850 ; 23851 23852 final Class<?> t; 23853 final boolean optional; 23854 final Object defaultValue; 23855 23856 Attribute(Class<?> type, boolean optional, Object defaultValue) { 23857 this.t = type; 23858 this.optional = optional; 23859 this.defaultValue = defaultValue; 23860 assert optional || defaultValue == null; 23861 } 23862 23863 public Class<?> type() { 23864 return t; 23865 } 23866 23867 public boolean isOptional() { 23868 return optional; 23869 } 23870 23871 public Object defaultValue() { 23872 return defaultValue; 23873 } 23874 } 23875 23876 public enum TypeConstraint implements OnnxTypeConstraint { 23877 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 23878 ; 23879 23880 final OnnxType.TypeVariable typeVariable; 23881 23882 TypeConstraint(OnnxType.TypeVariable typeVariable) { 23883 assert typeVariable.name().equals(name()); 23884 this.typeVariable = typeVariable; 23885 } 23886 23887 @Override 23888 public OnnxType.TypeVariable typeVariable() { 23889 return typeVariable; 23890 } 23891 } 23892 23893 public enum InputParameter implements OnnxParameter { 23894 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 23895 ; 23896 23897 final OnnxType type; 23898 final Quantifier quantifier; 23899 23900 InputParameter(OnnxType type, Quantifier quantifier) { 23901 this.type = type; 23902 this.quantifier = quantifier; 23903 } 23904 23905 @Override 23906 public OnnxType type() { 23907 return type; 23908 } 23909 23910 @Override 23911 public Quantifier quantifier() { 23912 return quantifier; 23913 } 23914 } 23915 23916 public enum OutputParameter implements OnnxParameter { 23917 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 23918 ; 23919 23920 final OnnxType type; 23921 final Quantifier quantifier; 23922 23923 OutputParameter(OnnxType type, Quantifier quantifier) { 23924 this.type = type; 23925 this.quantifier = quantifier; 23926 } 23927 23928 @Override 23929 public OnnxType type() { 23930 return type; 23931 } 23932 23933 @Override 23934 public Quantifier quantifier() { 23935 return quantifier; 23936 } 23937 } 23938 23939 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 23940 NAME, 23941 List.of(Attribute.values()), 23942 List.of(TypeConstraint.values()), 23943 List.of(InputParameter.values()), 23944 List.of(OutputParameter.values()) 23945 ); 23946 23947 public Scaler(ExternalizedOp def) { 23948 super(SCHEMA, def); 23949 } 23950 23951 Scaler(Scaler that, CopyContext cc) { 23952 super(that, cc); 23953 } 23954 23955 @Override 23956 public Scaler transform(CopyContext cc, OpTransformer ot) { 23957 return new Scaler(this, cc); 23958 } 23959 23960 Scaler(TypeElement resultType, Value X, java.util.Optional<float[]> offset, java.util.Optional<float[]> scale) { 23961 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(offset, scale)); 23962 } 23963 23964 @Override 23965 public SequencedSet<OnnxParameter> onnxOutputs() { 23966 return onnxOutputs(SCHEMA); 23967 } 23968 23969 @Override 23970 public SequencedMap<OnnxParameter, Object> onnxInputs() { 23971 return onnxInputs(SCHEMA, List.of(X())); 23972 } 23973 23974 public Value X() { 23975 return operands().get(0); 23976 } 23977 23978 public java.util.Optional<float[]> offset() { 23979 float[] offset = Attribute.offset.access(float[].class, onnxAttributes); 23980 return java.util.Optional.ofNullable(offset).map(float[]::clone); 23981 } 23982 23983 public java.util.Optional<float[]> scale() { 23984 float[] scale = Attribute.scale.access(float[].class, onnxAttributes); 23985 return java.util.Optional.ofNullable(scale).map(float[]::clone); 23986 } 23987 23988 } 23989 23990 public static Scaler Scaler(TypeElement resultType, Value X, java.util.Optional<float[]> offset, java.util.Optional<float[]> scale) { 23991 return new Scaler(resultType, X, offset, scale); 23992 } 23993 23994 @OpFactory.OpDeclaration(Scatter.NAME) 23995 public static final class Scatter extends OnnxOp { 23996 public static final String NAME = "Scatter"; 23997 23998 public enum Attribute implements OnnxAttribute { 23999 axis(Long.class, true, 0), 24000 ; 24001 24002 final Class<?> t; 24003 final boolean optional; 24004 final Object defaultValue; 24005 24006 Attribute(Class<?> type, boolean optional, Object defaultValue) { 24007 this.t = type; 24008 this.optional = optional; 24009 this.defaultValue = defaultValue; 24010 assert optional || defaultValue == null; 24011 } 24012 24013 public Class<?> type() { 24014 return t; 24015 } 24016 24017 public boolean isOptional() { 24018 return optional; 24019 } 24020 24021 public Object defaultValue() { 24022 return defaultValue; 24023 } 24024 } 24025 24026 public enum TypeConstraint implements OnnxTypeConstraint { 24027 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())))), 24028 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 24029 ; 24030 24031 final OnnxType.TypeVariable typeVariable; 24032 24033 TypeConstraint(OnnxType.TypeVariable typeVariable) { 24034 assert typeVariable.name().equals(name()); 24035 this.typeVariable = typeVariable; 24036 } 24037 24038 @Override 24039 public OnnxType.TypeVariable typeVariable() { 24040 return typeVariable; 24041 } 24042 } 24043 24044 public enum InputParameter implements OnnxParameter { 24045 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24046 indices(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 24047 updates(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24048 ; 24049 24050 final OnnxType type; 24051 final Quantifier quantifier; 24052 24053 InputParameter(OnnxType type, Quantifier quantifier) { 24054 this.type = type; 24055 this.quantifier = quantifier; 24056 } 24057 24058 @Override 24059 public OnnxType type() { 24060 return type; 24061 } 24062 24063 @Override 24064 public Quantifier quantifier() { 24065 return quantifier; 24066 } 24067 } 24068 24069 public enum OutputParameter implements OnnxParameter { 24070 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24071 ; 24072 24073 final OnnxType type; 24074 final Quantifier quantifier; 24075 24076 OutputParameter(OnnxType type, Quantifier quantifier) { 24077 this.type = type; 24078 this.quantifier = quantifier; 24079 } 24080 24081 @Override 24082 public OnnxType type() { 24083 return type; 24084 } 24085 24086 @Override 24087 public Quantifier quantifier() { 24088 return quantifier; 24089 } 24090 } 24091 24092 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 24093 NAME, 24094 List.of(Attribute.values()), 24095 List.of(TypeConstraint.values()), 24096 List.of(InputParameter.values()), 24097 List.of(OutputParameter.values()) 24098 ); 24099 24100 public Scatter(ExternalizedOp def) { 24101 super(SCHEMA, def); 24102 } 24103 24104 Scatter(Scatter that, CopyContext cc) { 24105 super(that, cc); 24106 } 24107 24108 @Override 24109 public Scatter transform(CopyContext cc, OpTransformer ot) { 24110 return new Scatter(this, cc); 24111 } 24112 24113 Scatter(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<Long> axis) { 24114 super(SCHEMA, resultType, Set.of(), List.of(data, indices, updates), List.of(axis)); 24115 } 24116 24117 @Override 24118 public SequencedSet<OnnxParameter> onnxOutputs() { 24119 return onnxOutputs(SCHEMA); 24120 } 24121 24122 @Override 24123 public SequencedMap<OnnxParameter, Object> onnxInputs() { 24124 return onnxInputs(SCHEMA, List.of(data(), indices(), updates())); 24125 } 24126 24127 public Value data() { 24128 return operands().get(0); 24129 } 24130 24131 public Value indices() { 24132 return operands().get(1); 24133 } 24134 24135 public Value updates() { 24136 return operands().get(2); 24137 } 24138 24139 public java.util.Optional<Long> axis() { 24140 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 24141 return java.util.Optional.ofNullable(axis); 24142 } 24143 24144 } 24145 24146 public static Scatter Scatter(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<Long> axis) { 24147 return new Scatter(resultType, data, indices, updates, axis); 24148 } 24149 24150 @OpFactory.OpDeclaration(ScatterElements.NAME) 24151 public static final class ScatterElements extends OnnxOp { 24152 public static final String NAME = "ScatterElements"; 24153 24154 public enum Attribute implements OnnxAttribute { 24155 reduction(String.class, true, "none"), 24156 axis(Long.class, true, 0), 24157 ; 24158 24159 final Class<?> t; 24160 final boolean optional; 24161 final Object defaultValue; 24162 24163 Attribute(Class<?> type, boolean optional, Object defaultValue) { 24164 this.t = type; 24165 this.optional = optional; 24166 this.defaultValue = defaultValue; 24167 assert optional || defaultValue == null; 24168 } 24169 24170 public Class<?> type() { 24171 return t; 24172 } 24173 24174 public boolean isOptional() { 24175 return optional; 24176 } 24177 24178 public Object defaultValue() { 24179 return defaultValue; 24180 } 24181 } 24182 24183 public enum TypeConstraint implements OnnxTypeConstraint { 24184 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())))), 24185 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 24186 ; 24187 24188 final OnnxType.TypeVariable typeVariable; 24189 24190 TypeConstraint(OnnxType.TypeVariable typeVariable) { 24191 assert typeVariable.name().equals(name()); 24192 this.typeVariable = typeVariable; 24193 } 24194 24195 @Override 24196 public OnnxType.TypeVariable typeVariable() { 24197 return typeVariable; 24198 } 24199 } 24200 24201 public enum InputParameter implements OnnxParameter { 24202 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24203 indices(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 24204 updates(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24205 ; 24206 24207 final OnnxType type; 24208 final Quantifier quantifier; 24209 24210 InputParameter(OnnxType type, Quantifier quantifier) { 24211 this.type = type; 24212 this.quantifier = quantifier; 24213 } 24214 24215 @Override 24216 public OnnxType type() { 24217 return type; 24218 } 24219 24220 @Override 24221 public Quantifier quantifier() { 24222 return quantifier; 24223 } 24224 } 24225 24226 public enum OutputParameter implements OnnxParameter { 24227 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24228 ; 24229 24230 final OnnxType type; 24231 final Quantifier quantifier; 24232 24233 OutputParameter(OnnxType type, Quantifier quantifier) { 24234 this.type = type; 24235 this.quantifier = quantifier; 24236 } 24237 24238 @Override 24239 public OnnxType type() { 24240 return type; 24241 } 24242 24243 @Override 24244 public Quantifier quantifier() { 24245 return quantifier; 24246 } 24247 } 24248 24249 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 24250 NAME, 24251 List.of(Attribute.values()), 24252 List.of(TypeConstraint.values()), 24253 List.of(InputParameter.values()), 24254 List.of(OutputParameter.values()) 24255 ); 24256 24257 public ScatterElements(ExternalizedOp def) { 24258 super(SCHEMA, def); 24259 } 24260 24261 ScatterElements(ScatterElements that, CopyContext cc) { 24262 super(that, cc); 24263 } 24264 24265 @Override 24266 public ScatterElements transform(CopyContext cc, OpTransformer ot) { 24267 return new ScatterElements(this, cc); 24268 } 24269 24270 ScatterElements(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<String> reduction, java.util.Optional<Long> axis) { 24271 super(SCHEMA, resultType, Set.of(), List.of(data, indices, updates), List.of(reduction, axis)); 24272 } 24273 24274 @Override 24275 public SequencedSet<OnnxParameter> onnxOutputs() { 24276 return onnxOutputs(SCHEMA); 24277 } 24278 24279 @Override 24280 public SequencedMap<OnnxParameter, Object> onnxInputs() { 24281 return onnxInputs(SCHEMA, List.of(data(), indices(), updates())); 24282 } 24283 24284 public Value data() { 24285 return operands().get(0); 24286 } 24287 24288 public Value indices() { 24289 return operands().get(1); 24290 } 24291 24292 public Value updates() { 24293 return operands().get(2); 24294 } 24295 24296 public java.util.Optional<String> reduction() { 24297 String reduction = Attribute.reduction.access(String.class, onnxAttributes); 24298 return java.util.Optional.ofNullable(reduction); 24299 } 24300 24301 public java.util.Optional<Long> axis() { 24302 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 24303 return java.util.Optional.ofNullable(axis); 24304 } 24305 24306 } 24307 24308 public static ScatterElements ScatterElements(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<String> reduction, java.util.Optional<Long> axis) { 24309 return new ScatterElements(resultType, data, indices, updates, reduction, axis); 24310 } 24311 24312 @OpFactory.OpDeclaration(ScatterND.NAME) 24313 public static final class ScatterND extends OnnxOp { 24314 public static final String NAME = "ScatterND"; 24315 24316 public enum Attribute implements OnnxAttribute { 24317 reduction(String.class, true, "none"), 24318 ; 24319 24320 final Class<?> t; 24321 final boolean optional; 24322 final Object defaultValue; 24323 24324 Attribute(Class<?> type, boolean optional, Object defaultValue) { 24325 this.t = type; 24326 this.optional = optional; 24327 this.defaultValue = defaultValue; 24328 assert optional || defaultValue == null; 24329 } 24330 24331 public Class<?> type() { 24332 return t; 24333 } 24334 24335 public boolean isOptional() { 24336 return optional; 24337 } 24338 24339 public Object defaultValue() { 24340 return defaultValue; 24341 } 24342 } 24343 24344 public enum TypeConstraint implements OnnxTypeConstraint { 24345 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())))), 24346 ; 24347 24348 final OnnxType.TypeVariable typeVariable; 24349 24350 TypeConstraint(OnnxType.TypeVariable typeVariable) { 24351 assert typeVariable.name().equals(name()); 24352 this.typeVariable = typeVariable; 24353 } 24354 24355 @Override 24356 public OnnxType.TypeVariable typeVariable() { 24357 return typeVariable; 24358 } 24359 } 24360 24361 public enum InputParameter implements OnnxParameter { 24362 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24363 indices(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 24364 updates(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24365 ; 24366 24367 final OnnxType type; 24368 final Quantifier quantifier; 24369 24370 InputParameter(OnnxType type, Quantifier quantifier) { 24371 this.type = type; 24372 this.quantifier = quantifier; 24373 } 24374 24375 @Override 24376 public OnnxType type() { 24377 return type; 24378 } 24379 24380 @Override 24381 public Quantifier quantifier() { 24382 return quantifier; 24383 } 24384 } 24385 24386 public enum OutputParameter implements OnnxParameter { 24387 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24388 ; 24389 24390 final OnnxType type; 24391 final Quantifier quantifier; 24392 24393 OutputParameter(OnnxType type, Quantifier quantifier) { 24394 this.type = type; 24395 this.quantifier = quantifier; 24396 } 24397 24398 @Override 24399 public OnnxType type() { 24400 return type; 24401 } 24402 24403 @Override 24404 public Quantifier quantifier() { 24405 return quantifier; 24406 } 24407 } 24408 24409 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 24410 NAME, 24411 List.of(Attribute.values()), 24412 List.of(TypeConstraint.values()), 24413 List.of(InputParameter.values()), 24414 List.of(OutputParameter.values()) 24415 ); 24416 24417 public ScatterND(ExternalizedOp def) { 24418 super(SCHEMA, def); 24419 } 24420 24421 ScatterND(ScatterND that, CopyContext cc) { 24422 super(that, cc); 24423 } 24424 24425 @Override 24426 public ScatterND transform(CopyContext cc, OpTransformer ot) { 24427 return new ScatterND(this, cc); 24428 } 24429 24430 ScatterND(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<String> reduction) { 24431 super(SCHEMA, resultType, Set.of(), List.of(data, indices, updates), List.of(reduction)); 24432 } 24433 24434 @Override 24435 public SequencedSet<OnnxParameter> onnxOutputs() { 24436 return onnxOutputs(SCHEMA); 24437 } 24438 24439 @Override 24440 public SequencedMap<OnnxParameter, Object> onnxInputs() { 24441 return onnxInputs(SCHEMA, List.of(data(), indices(), updates())); 24442 } 24443 24444 public Value data() { 24445 return operands().get(0); 24446 } 24447 24448 public Value indices() { 24449 return operands().get(1); 24450 } 24451 24452 public Value updates() { 24453 return operands().get(2); 24454 } 24455 24456 public java.util.Optional<String> reduction() { 24457 String reduction = Attribute.reduction.access(String.class, onnxAttributes); 24458 return java.util.Optional.ofNullable(reduction); 24459 } 24460 24461 } 24462 24463 public static ScatterND ScatterND(TypeElement resultType, Value data, Value indices, Value updates, java.util.Optional<String> reduction) { 24464 return new ScatterND(resultType, data, indices, updates, reduction); 24465 } 24466 24467 @OpFactory.OpDeclaration(Selu.NAME) 24468 public static final class Selu extends OnnxOp { 24469 public static final String NAME = "Selu"; 24470 24471 public enum Attribute implements OnnxAttribute { 24472 alpha(Float.class, true, 1.6732632f), 24473 gamma(Float.class, true, 1.050701f), 24474 ; 24475 24476 final Class<?> t; 24477 final boolean optional; 24478 final Object defaultValue; 24479 24480 Attribute(Class<?> type, boolean optional, Object defaultValue) { 24481 this.t = type; 24482 this.optional = optional; 24483 this.defaultValue = defaultValue; 24484 assert optional || defaultValue == null; 24485 } 24486 24487 public Class<?> type() { 24488 return t; 24489 } 24490 24491 public boolean isOptional() { 24492 return optional; 24493 } 24494 24495 public Object defaultValue() { 24496 return defaultValue; 24497 } 24498 } 24499 24500 public enum TypeConstraint implements OnnxTypeConstraint { 24501 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 24502 ; 24503 24504 final OnnxType.TypeVariable typeVariable; 24505 24506 TypeConstraint(OnnxType.TypeVariable typeVariable) { 24507 assert typeVariable.name().equals(name()); 24508 this.typeVariable = typeVariable; 24509 } 24510 24511 @Override 24512 public OnnxType.TypeVariable typeVariable() { 24513 return typeVariable; 24514 } 24515 } 24516 24517 public enum InputParameter implements OnnxParameter { 24518 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24519 ; 24520 24521 final OnnxType type; 24522 final Quantifier quantifier; 24523 24524 InputParameter(OnnxType type, Quantifier quantifier) { 24525 this.type = type; 24526 this.quantifier = quantifier; 24527 } 24528 24529 @Override 24530 public OnnxType type() { 24531 return type; 24532 } 24533 24534 @Override 24535 public Quantifier quantifier() { 24536 return quantifier; 24537 } 24538 } 24539 24540 public enum OutputParameter implements OnnxParameter { 24541 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24542 ; 24543 24544 final OnnxType type; 24545 final Quantifier quantifier; 24546 24547 OutputParameter(OnnxType type, Quantifier quantifier) { 24548 this.type = type; 24549 this.quantifier = quantifier; 24550 } 24551 24552 @Override 24553 public OnnxType type() { 24554 return type; 24555 } 24556 24557 @Override 24558 public Quantifier quantifier() { 24559 return quantifier; 24560 } 24561 } 24562 24563 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 24564 NAME, 24565 List.of(Attribute.values()), 24566 List.of(TypeConstraint.values()), 24567 List.of(InputParameter.values()), 24568 List.of(OutputParameter.values()) 24569 ); 24570 24571 public Selu(ExternalizedOp def) { 24572 super(SCHEMA, def); 24573 } 24574 24575 Selu(Selu that, CopyContext cc) { 24576 super(that, cc); 24577 } 24578 24579 @Override 24580 public Selu transform(CopyContext cc, OpTransformer ot) { 24581 return new Selu(this, cc); 24582 } 24583 24584 Selu(TypeElement resultType, Value X, java.util.Optional<Float> alpha, java.util.Optional<Float> gamma) { 24585 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha, gamma)); 24586 } 24587 24588 @Override 24589 public SequencedSet<OnnxParameter> onnxOutputs() { 24590 return onnxOutputs(SCHEMA); 24591 } 24592 24593 @Override 24594 public SequencedMap<OnnxParameter, Object> onnxInputs() { 24595 return onnxInputs(SCHEMA, List.of(X())); 24596 } 24597 24598 public Value X() { 24599 return operands().get(0); 24600 } 24601 24602 public java.util.Optional<Float> alpha() { 24603 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 24604 return java.util.Optional.ofNullable(alpha); 24605 } 24606 24607 public java.util.Optional<Float> gamma() { 24608 Float gamma = Attribute.gamma.access(Float.class, onnxAttributes); 24609 return java.util.Optional.ofNullable(gamma); 24610 } 24611 24612 } 24613 24614 public static Selu Selu(TypeElement resultType, Value X, java.util.Optional<Float> alpha, java.util.Optional<Float> gamma) { 24615 return new Selu(resultType, X, alpha, gamma); 24616 } 24617 24618 @OpFactory.OpDeclaration(SequenceAt.NAME) 24619 public static final class SequenceAt extends OnnxOp { 24620 public static final String NAME = "SequenceAt"; 24621 24622 public enum Attribute implements OnnxAttribute.None { } 24623 24624 public enum TypeConstraint implements OnnxTypeConstraint { 24625 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()))))), 24626 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())))), 24627 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 24628 ; 24629 24630 final OnnxType.TypeVariable typeVariable; 24631 24632 TypeConstraint(OnnxType.TypeVariable typeVariable) { 24633 assert typeVariable.name().equals(name()); 24634 this.typeVariable = typeVariable; 24635 } 24636 24637 @Override 24638 public OnnxType.TypeVariable typeVariable() { 24639 return typeVariable; 24640 } 24641 } 24642 24643 public enum InputParameter implements OnnxParameter { 24644 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 24645 position(TypeConstraint.I.typeVariable(), Quantifier.REQUIRED), 24646 ; 24647 24648 final OnnxType type; 24649 final Quantifier quantifier; 24650 24651 InputParameter(OnnxType type, Quantifier quantifier) { 24652 this.type = type; 24653 this.quantifier = quantifier; 24654 } 24655 24656 @Override 24657 public OnnxType type() { 24658 return type; 24659 } 24660 24661 @Override 24662 public Quantifier quantifier() { 24663 return quantifier; 24664 } 24665 } 24666 24667 public enum OutputParameter implements OnnxParameter { 24668 tensor(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 24669 ; 24670 24671 final OnnxType type; 24672 final Quantifier quantifier; 24673 24674 OutputParameter(OnnxType type, Quantifier quantifier) { 24675 this.type = type; 24676 this.quantifier = quantifier; 24677 } 24678 24679 @Override 24680 public OnnxType type() { 24681 return type; 24682 } 24683 24684 @Override 24685 public Quantifier quantifier() { 24686 return quantifier; 24687 } 24688 } 24689 24690 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 24691 NAME, 24692 List.of(Attribute.values()), 24693 List.of(TypeConstraint.values()), 24694 List.of(InputParameter.values()), 24695 List.of(OutputParameter.values()) 24696 ); 24697 24698 public SequenceAt(ExternalizedOp def) { 24699 super(SCHEMA, def); 24700 } 24701 24702 SequenceAt(SequenceAt that, CopyContext cc) { 24703 super(that, cc); 24704 } 24705 24706 @Override 24707 public SequenceAt transform(CopyContext cc, OpTransformer ot) { 24708 return new SequenceAt(this, cc); 24709 } 24710 24711 SequenceAt(TypeElement resultType, Value input_sequence, Value position) { 24712 super(SCHEMA, resultType, Set.of(), List.of(input_sequence, position), List.of()); 24713 } 24714 24715 @Override 24716 public SequencedSet<OnnxParameter> onnxOutputs() { 24717 return onnxOutputs(SCHEMA); 24718 } 24719 24720 @Override 24721 public SequencedMap<OnnxParameter, Object> onnxInputs() { 24722 return onnxInputs(SCHEMA, List.of(input_sequence(), position())); 24723 } 24724 24725 public Value input_sequence() { 24726 return operands().get(0); 24727 } 24728 24729 public Value position() { 24730 return operands().get(1); 24731 } 24732 24733 } 24734 24735 public static SequenceAt SequenceAt(TypeElement resultType, Value input_sequence, Value position) { 24736 return new SequenceAt(resultType, input_sequence, position); 24737 } 24738 24739 @OpFactory.OpDeclaration(SequenceConstruct.NAME) 24740 public static final class SequenceConstruct extends OnnxOp { 24741 public static final String NAME = "SequenceConstruct"; 24742 24743 public enum Attribute implements OnnxAttribute.None { } 24744 24745 public enum TypeConstraint implements OnnxTypeConstraint { 24746 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())))), 24747 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()))))), 24748 ; 24749 24750 final OnnxType.TypeVariable typeVariable; 24751 24752 TypeConstraint(OnnxType.TypeVariable typeVariable) { 24753 assert typeVariable.name().equals(name()); 24754 this.typeVariable = typeVariable; 24755 } 24756 24757 @Override 24758 public OnnxType.TypeVariable typeVariable() { 24759 return typeVariable; 24760 } 24761 } 24762 24763 public enum InputParameter implements OnnxParameter { 24764 inputs(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC), 24765 ; 24766 24767 final OnnxType type; 24768 final Quantifier quantifier; 24769 24770 InputParameter(OnnxType type, Quantifier quantifier) { 24771 this.type = type; 24772 this.quantifier = quantifier; 24773 } 24774 24775 @Override 24776 public OnnxType type() { 24777 return type; 24778 } 24779 24780 @Override 24781 public Quantifier quantifier() { 24782 return quantifier; 24783 } 24784 } 24785 24786 public enum OutputParameter implements OnnxParameter { 24787 output_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 24788 ; 24789 24790 final OnnxType type; 24791 final Quantifier quantifier; 24792 24793 OutputParameter(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 static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 24810 NAME, 24811 List.of(Attribute.values()), 24812 List.of(TypeConstraint.values()), 24813 List.of(InputParameter.values()), 24814 List.of(OutputParameter.values()) 24815 ); 24816 24817 public SequenceConstruct(ExternalizedOp def) { 24818 super(SCHEMA, def); 24819 } 24820 24821 SequenceConstruct(SequenceConstruct that, CopyContext cc) { 24822 super(that, cc); 24823 } 24824 24825 @Override 24826 public SequenceConstruct transform(CopyContext cc, OpTransformer ot) { 24827 return new SequenceConstruct(this, cc); 24828 } 24829 24830 SequenceConstruct(TypeElement resultType, List<Value> inputs) { 24831 super(SCHEMA, resultType, Set.of(), List.of(inputs), List.of()); 24832 } 24833 24834 @Override 24835 public SequencedSet<OnnxParameter> onnxOutputs() { 24836 return onnxOutputs(SCHEMA); 24837 } 24838 24839 @Override 24840 public SequencedMap<OnnxParameter, Object> onnxInputs() { 24841 return onnxInputs(SCHEMA, List.of(inputs())); 24842 } 24843 24844 public List<Value> inputs() { 24845 return operands(); 24846 } 24847 24848 } 24849 24850 public static SequenceConstruct SequenceConstruct(TypeElement resultType, List<Value> inputs) { 24851 return new SequenceConstruct(resultType, inputs); 24852 } 24853 24854 @OpFactory.OpDeclaration(SequenceEmpty.NAME) 24855 public static final class SequenceEmpty extends OnnxOp { 24856 public static final String NAME = "SequenceEmpty"; 24857 24858 public enum Attribute implements OnnxAttribute { 24859 dtype(Long.class, true, null), 24860 ; 24861 24862 final Class<?> t; 24863 final boolean optional; 24864 final Object defaultValue; 24865 24866 Attribute(Class<?> type, boolean optional, Object defaultValue) { 24867 this.t = type; 24868 this.optional = optional; 24869 this.defaultValue = defaultValue; 24870 assert optional || defaultValue == null; 24871 } 24872 24873 public Class<?> type() { 24874 return t; 24875 } 24876 24877 public boolean isOptional() { 24878 return optional; 24879 } 24880 24881 public Object defaultValue() { 24882 return defaultValue; 24883 } 24884 } 24885 24886 public enum TypeConstraint implements OnnxTypeConstraint { 24887 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()))))), 24888 ; 24889 24890 final OnnxType.TypeVariable typeVariable; 24891 24892 TypeConstraint(OnnxType.TypeVariable typeVariable) { 24893 assert typeVariable.name().equals(name()); 24894 this.typeVariable = typeVariable; 24895 } 24896 24897 @Override 24898 public OnnxType.TypeVariable typeVariable() { 24899 return typeVariable; 24900 } 24901 } 24902 24903 public enum InputParameter implements OnnxParameter.None { } 24904 24905 public enum OutputParameter implements OnnxParameter { 24906 output(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 24907 ; 24908 24909 final OnnxType type; 24910 final Quantifier quantifier; 24911 24912 OutputParameter(OnnxType type, Quantifier quantifier) { 24913 this.type = type; 24914 this.quantifier = quantifier; 24915 } 24916 24917 @Override 24918 public OnnxType type() { 24919 return type; 24920 } 24921 24922 @Override 24923 public Quantifier quantifier() { 24924 return quantifier; 24925 } 24926 } 24927 24928 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 24929 NAME, 24930 List.of(Attribute.values()), 24931 List.of(TypeConstraint.values()), 24932 List.of(InputParameter.values()), 24933 List.of(OutputParameter.values()) 24934 ); 24935 24936 public SequenceEmpty(ExternalizedOp def) { 24937 super(SCHEMA, def); 24938 } 24939 24940 SequenceEmpty(SequenceEmpty that, CopyContext cc) { 24941 super(that, cc); 24942 } 24943 24944 @Override 24945 public SequenceEmpty transform(CopyContext cc, OpTransformer ot) { 24946 return new SequenceEmpty(this, cc); 24947 } 24948 24949 SequenceEmpty(TypeElement resultType, java.util.Optional<Long> dtype) { 24950 super(SCHEMA, resultType, Set.of(), List.of(), List.of(dtype)); 24951 } 24952 24953 @Override 24954 public SequencedSet<OnnxParameter> onnxOutputs() { 24955 return onnxOutputs(SCHEMA); 24956 } 24957 24958 @Override 24959 public SequencedMap<OnnxParameter, Object> onnxInputs() { 24960 return onnxInputs(SCHEMA, List.of()); 24961 } 24962 24963 public java.util.Optional<Long> dtype() { 24964 Long dtype = Attribute.dtype.access(Long.class, onnxAttributes); 24965 return java.util.Optional.ofNullable(dtype); 24966 } 24967 24968 } 24969 24970 public static SequenceEmpty SequenceEmpty(TypeElement resultType, java.util.Optional<Long> dtype) { 24971 return new SequenceEmpty(resultType, dtype); 24972 } 24973 24974 @OpFactory.OpDeclaration(SequenceErase.NAME) 24975 public static final class SequenceErase extends OnnxOp { 24976 public static final String NAME = "SequenceErase"; 24977 24978 public enum Attribute implements OnnxAttribute.None { } 24979 24980 public enum TypeConstraint implements OnnxTypeConstraint { 24981 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()))))), 24982 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 24983 ; 24984 24985 final OnnxType.TypeVariable typeVariable; 24986 24987 TypeConstraint(OnnxType.TypeVariable typeVariable) { 24988 assert typeVariable.name().equals(name()); 24989 this.typeVariable = typeVariable; 24990 } 24991 24992 @Override 24993 public OnnxType.TypeVariable typeVariable() { 24994 return typeVariable; 24995 } 24996 } 24997 24998 public enum InputParameter implements OnnxParameter { 24999 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 25000 position(TypeConstraint.I.typeVariable(), Quantifier.OPTIONAL), 25001 ; 25002 25003 final OnnxType type; 25004 final Quantifier quantifier; 25005 25006 InputParameter(OnnxType type, Quantifier quantifier) { 25007 this.type = type; 25008 this.quantifier = quantifier; 25009 } 25010 25011 @Override 25012 public OnnxType type() { 25013 return type; 25014 } 25015 25016 @Override 25017 public Quantifier quantifier() { 25018 return quantifier; 25019 } 25020 } 25021 25022 public enum OutputParameter implements OnnxParameter { 25023 output_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 25024 ; 25025 25026 final OnnxType type; 25027 final Quantifier quantifier; 25028 25029 OutputParameter(OnnxType type, Quantifier quantifier) { 25030 this.type = type; 25031 this.quantifier = quantifier; 25032 } 25033 25034 @Override 25035 public OnnxType type() { 25036 return type; 25037 } 25038 25039 @Override 25040 public Quantifier quantifier() { 25041 return quantifier; 25042 } 25043 } 25044 25045 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 25046 NAME, 25047 List.of(Attribute.values()), 25048 List.of(TypeConstraint.values()), 25049 List.of(InputParameter.values()), 25050 List.of(OutputParameter.values()) 25051 ); 25052 25053 public SequenceErase(ExternalizedOp def) { 25054 super(SCHEMA, def); 25055 } 25056 25057 SequenceErase(SequenceErase that, CopyContext cc) { 25058 super(that, cc); 25059 } 25060 25061 @Override 25062 public SequenceErase transform(CopyContext cc, OpTransformer ot) { 25063 return new SequenceErase(this, cc); 25064 } 25065 25066 SequenceErase(TypeElement resultType, Value input_sequence, java.util.Optional<Value> position) { 25067 super(SCHEMA, resultType, Set.of(), List.of(input_sequence, position), List.of()); 25068 } 25069 25070 @Override 25071 public SequencedSet<OnnxParameter> onnxOutputs() { 25072 return onnxOutputs(SCHEMA); 25073 } 25074 25075 @Override 25076 public SequencedMap<OnnxParameter, Object> onnxInputs() { 25077 return onnxInputs(SCHEMA, List.of(input_sequence(), position())); 25078 } 25079 25080 public Value input_sequence() { 25081 return operands().get(0); 25082 } 25083 25084 public java.util.Optional<Value> position() { 25085 int i = optionalInputArguments.indexOf(InputParameter.position); 25086 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 25087 } 25088 25089 } 25090 25091 public static SequenceErase SequenceErase(TypeElement resultType, Value input_sequence, java.util.Optional<Value> position) { 25092 return new SequenceErase(resultType, input_sequence, position); 25093 } 25094 25095 @OpFactory.OpDeclaration(SequenceInsert.NAME) 25096 public static final class SequenceInsert extends OnnxOp { 25097 public static final String NAME = "SequenceInsert"; 25098 25099 public enum Attribute implements OnnxAttribute.None { } 25100 25101 public enum TypeConstraint implements OnnxTypeConstraint { 25102 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())))), 25103 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()))))), 25104 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 25105 ; 25106 25107 final OnnxType.TypeVariable typeVariable; 25108 25109 TypeConstraint(OnnxType.TypeVariable typeVariable) { 25110 assert typeVariable.name().equals(name()); 25111 this.typeVariable = typeVariable; 25112 } 25113 25114 @Override 25115 public OnnxType.TypeVariable typeVariable() { 25116 return typeVariable; 25117 } 25118 } 25119 25120 public enum InputParameter implements OnnxParameter { 25121 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 25122 tensor(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25123 position(TypeConstraint.I.typeVariable(), Quantifier.OPTIONAL), 25124 ; 25125 25126 final OnnxType type; 25127 final Quantifier quantifier; 25128 25129 InputParameter(OnnxType type, Quantifier quantifier) { 25130 this.type = type; 25131 this.quantifier = quantifier; 25132 } 25133 25134 @Override 25135 public OnnxType type() { 25136 return type; 25137 } 25138 25139 @Override 25140 public Quantifier quantifier() { 25141 return quantifier; 25142 } 25143 } 25144 25145 public enum OutputParameter implements OnnxParameter { 25146 output_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 25147 ; 25148 25149 final OnnxType type; 25150 final Quantifier quantifier; 25151 25152 OutputParameter(OnnxType type, Quantifier quantifier) { 25153 this.type = type; 25154 this.quantifier = quantifier; 25155 } 25156 25157 @Override 25158 public OnnxType type() { 25159 return type; 25160 } 25161 25162 @Override 25163 public Quantifier quantifier() { 25164 return quantifier; 25165 } 25166 } 25167 25168 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 25169 NAME, 25170 List.of(Attribute.values()), 25171 List.of(TypeConstraint.values()), 25172 List.of(InputParameter.values()), 25173 List.of(OutputParameter.values()) 25174 ); 25175 25176 public SequenceInsert(ExternalizedOp def) { 25177 super(SCHEMA, def); 25178 } 25179 25180 SequenceInsert(SequenceInsert that, CopyContext cc) { 25181 super(that, cc); 25182 } 25183 25184 @Override 25185 public SequenceInsert transform(CopyContext cc, OpTransformer ot) { 25186 return new SequenceInsert(this, cc); 25187 } 25188 25189 SequenceInsert(TypeElement resultType, Value input_sequence, Value tensor, java.util.Optional<Value> position) { 25190 super(SCHEMA, resultType, Set.of(), List.of(input_sequence, tensor, position), List.of()); 25191 } 25192 25193 @Override 25194 public SequencedSet<OnnxParameter> onnxOutputs() { 25195 return onnxOutputs(SCHEMA); 25196 } 25197 25198 @Override 25199 public SequencedMap<OnnxParameter, Object> onnxInputs() { 25200 return onnxInputs(SCHEMA, List.of(input_sequence(), tensor(), position())); 25201 } 25202 25203 public Value input_sequence() { 25204 return operands().get(0); 25205 } 25206 25207 public Value tensor() { 25208 return operands().get(1); 25209 } 25210 25211 public java.util.Optional<Value> position() { 25212 int i = optionalInputArguments.indexOf(InputParameter.position); 25213 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 25214 } 25215 25216 } 25217 25218 public static SequenceInsert SequenceInsert(TypeElement resultType, Value input_sequence, Value tensor, java.util.Optional<Value> position) { 25219 return new SequenceInsert(resultType, input_sequence, tensor, position); 25220 } 25221 25222 @OpFactory.OpDeclaration(SequenceLength.NAME) 25223 public static final class SequenceLength extends OnnxOp { 25224 public static final String NAME = "SequenceLength"; 25225 25226 public enum Attribute implements OnnxAttribute.None { } 25227 25228 public enum TypeConstraint implements OnnxTypeConstraint { 25229 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()))))), 25230 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int64())))), 25231 ; 25232 25233 final OnnxType.TypeVariable typeVariable; 25234 25235 TypeConstraint(OnnxType.TypeVariable typeVariable) { 25236 assert typeVariable.name().equals(name()); 25237 this.typeVariable = typeVariable; 25238 } 25239 25240 @Override 25241 public OnnxType.TypeVariable typeVariable() { 25242 return typeVariable; 25243 } 25244 } 25245 25246 public enum InputParameter implements OnnxParameter { 25247 input_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 25248 ; 25249 25250 final OnnxType type; 25251 final Quantifier quantifier; 25252 25253 InputParameter(OnnxType type, Quantifier quantifier) { 25254 this.type = type; 25255 this.quantifier = quantifier; 25256 } 25257 25258 @Override 25259 public OnnxType type() { 25260 return type; 25261 } 25262 25263 @Override 25264 public Quantifier quantifier() { 25265 return quantifier; 25266 } 25267 } 25268 25269 public enum OutputParameter implements OnnxParameter { 25270 length(TypeConstraint.I.typeVariable(), Quantifier.REQUIRED), 25271 ; 25272 25273 final OnnxType type; 25274 final Quantifier quantifier; 25275 25276 OutputParameter(OnnxType type, Quantifier quantifier) { 25277 this.type = type; 25278 this.quantifier = quantifier; 25279 } 25280 25281 @Override 25282 public OnnxType type() { 25283 return type; 25284 } 25285 25286 @Override 25287 public Quantifier quantifier() { 25288 return quantifier; 25289 } 25290 } 25291 25292 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 25293 NAME, 25294 List.of(Attribute.values()), 25295 List.of(TypeConstraint.values()), 25296 List.of(InputParameter.values()), 25297 List.of(OutputParameter.values()) 25298 ); 25299 25300 public SequenceLength(ExternalizedOp def) { 25301 super(SCHEMA, def); 25302 } 25303 25304 SequenceLength(SequenceLength that, CopyContext cc) { 25305 super(that, cc); 25306 } 25307 25308 @Override 25309 public SequenceLength transform(CopyContext cc, OpTransformer ot) { 25310 return new SequenceLength(this, cc); 25311 } 25312 25313 SequenceLength(TypeElement resultType, Value input_sequence) { 25314 super(SCHEMA, resultType, Set.of(), List.of(input_sequence), List.of()); 25315 } 25316 25317 @Override 25318 public SequencedSet<OnnxParameter> onnxOutputs() { 25319 return onnxOutputs(SCHEMA); 25320 } 25321 25322 @Override 25323 public SequencedMap<OnnxParameter, Object> onnxInputs() { 25324 return onnxInputs(SCHEMA, List.of(input_sequence())); 25325 } 25326 25327 public Value input_sequence() { 25328 return operands().get(0); 25329 } 25330 25331 } 25332 25333 public static SequenceLength SequenceLength(TypeElement resultType, Value input_sequence) { 25334 return new SequenceLength(resultType, input_sequence); 25335 } 25336 25337 @OpFactory.OpDeclaration(Shape.NAME) 25338 public static final class Shape extends OnnxOp { 25339 public static final String NAME = "Shape"; 25340 25341 public enum Attribute implements OnnxAttribute { 25342 start(Long.class, true, 0), 25343 end(Long.class, true, null), 25344 ; 25345 25346 final Class<?> t; 25347 final boolean optional; 25348 final Object defaultValue; 25349 25350 Attribute(Class<?> type, boolean optional, Object defaultValue) { 25351 this.t = type; 25352 this.optional = optional; 25353 this.defaultValue = defaultValue; 25354 assert optional || defaultValue == null; 25355 } 25356 25357 public Class<?> type() { 25358 return t; 25359 } 25360 25361 public boolean isOptional() { 25362 return optional; 25363 } 25364 25365 public Object defaultValue() { 25366 return defaultValue; 25367 } 25368 } 25369 25370 public enum TypeConstraint implements OnnxTypeConstraint { 25371 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())))), 25372 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int64())))), 25373 ; 25374 25375 final OnnxType.TypeVariable typeVariable; 25376 25377 TypeConstraint(OnnxType.TypeVariable typeVariable) { 25378 assert typeVariable.name().equals(name()); 25379 this.typeVariable = typeVariable; 25380 } 25381 25382 @Override 25383 public OnnxType.TypeVariable typeVariable() { 25384 return typeVariable; 25385 } 25386 } 25387 25388 public enum InputParameter implements OnnxParameter { 25389 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25390 ; 25391 25392 final OnnxType type; 25393 final Quantifier quantifier; 25394 25395 InputParameter(OnnxType type, Quantifier quantifier) { 25396 this.type = type; 25397 this.quantifier = quantifier; 25398 } 25399 25400 @Override 25401 public OnnxType type() { 25402 return type; 25403 } 25404 25405 @Override 25406 public Quantifier quantifier() { 25407 return quantifier; 25408 } 25409 } 25410 25411 public enum OutputParameter implements OnnxParameter { 25412 shape(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 25413 ; 25414 25415 final OnnxType type; 25416 final Quantifier quantifier; 25417 25418 OutputParameter(OnnxType type, Quantifier quantifier) { 25419 this.type = type; 25420 this.quantifier = quantifier; 25421 } 25422 25423 @Override 25424 public OnnxType type() { 25425 return type; 25426 } 25427 25428 @Override 25429 public Quantifier quantifier() { 25430 return quantifier; 25431 } 25432 } 25433 25434 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 25435 NAME, 25436 List.of(Attribute.values()), 25437 List.of(TypeConstraint.values()), 25438 List.of(InputParameter.values()), 25439 List.of(OutputParameter.values()) 25440 ); 25441 25442 public Shape(ExternalizedOp def) { 25443 super(SCHEMA, def); 25444 } 25445 25446 Shape(Shape that, CopyContext cc) { 25447 super(that, cc); 25448 } 25449 25450 @Override 25451 public Shape transform(CopyContext cc, OpTransformer ot) { 25452 return new Shape(this, cc); 25453 } 25454 25455 Shape(TypeElement resultType, Value data, java.util.Optional<Long> start, java.util.Optional<Long> end) { 25456 super(SCHEMA, resultType, Set.of(), List.of(data), List.of(start, end)); 25457 } 25458 25459 @Override 25460 public SequencedSet<OnnxParameter> onnxOutputs() { 25461 return onnxOutputs(SCHEMA); 25462 } 25463 25464 @Override 25465 public SequencedMap<OnnxParameter, Object> onnxInputs() { 25466 return onnxInputs(SCHEMA, List.of(data())); 25467 } 25468 25469 public Value data() { 25470 return operands().get(0); 25471 } 25472 25473 public java.util.Optional<Long> start() { 25474 Long start = Attribute.start.access(Long.class, onnxAttributes); 25475 return java.util.Optional.ofNullable(start); 25476 } 25477 25478 public java.util.Optional<Long> end() { 25479 Long end = Attribute.end.access(Long.class, onnxAttributes); 25480 return java.util.Optional.ofNullable(end); 25481 } 25482 25483 } 25484 25485 public static Shape Shape(TypeElement resultType, Value data, java.util.Optional<Long> start, java.util.Optional<Long> end) { 25486 return new Shape(resultType, data, start, end); 25487 } 25488 25489 @OpFactory.OpDeclaration(Shrink.NAME) 25490 public static final class Shrink extends OnnxOp { 25491 public static final String NAME = "Shrink"; 25492 25493 public enum Attribute implements OnnxAttribute { 25494 lambd(Float.class, true, 0.5f), 25495 bias(Float.class, true, 0.0f), 25496 ; 25497 25498 final Class<?> t; 25499 final boolean optional; 25500 final Object defaultValue; 25501 25502 Attribute(Class<?> type, boolean optional, Object defaultValue) { 25503 this.t = type; 25504 this.optional = optional; 25505 this.defaultValue = defaultValue; 25506 assert optional || defaultValue == null; 25507 } 25508 25509 public Class<?> type() { 25510 return t; 25511 } 25512 25513 public boolean isOptional() { 25514 return optional; 25515 } 25516 25517 public Object defaultValue() { 25518 return defaultValue; 25519 } 25520 } 25521 25522 public enum TypeConstraint implements OnnxTypeConstraint { 25523 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())))), 25524 ; 25525 25526 final OnnxType.TypeVariable typeVariable; 25527 25528 TypeConstraint(OnnxType.TypeVariable typeVariable) { 25529 assert typeVariable.name().equals(name()); 25530 this.typeVariable = typeVariable; 25531 } 25532 25533 @Override 25534 public OnnxType.TypeVariable typeVariable() { 25535 return typeVariable; 25536 } 25537 } 25538 25539 public enum InputParameter implements OnnxParameter { 25540 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25541 ; 25542 25543 final OnnxType type; 25544 final Quantifier quantifier; 25545 25546 InputParameter(OnnxType type, Quantifier quantifier) { 25547 this.type = type; 25548 this.quantifier = quantifier; 25549 } 25550 25551 @Override 25552 public OnnxType type() { 25553 return type; 25554 } 25555 25556 @Override 25557 public Quantifier quantifier() { 25558 return quantifier; 25559 } 25560 } 25561 25562 public enum OutputParameter implements OnnxParameter { 25563 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25564 ; 25565 25566 final OnnxType type; 25567 final Quantifier quantifier; 25568 25569 OutputParameter(OnnxType type, Quantifier quantifier) { 25570 this.type = type; 25571 this.quantifier = quantifier; 25572 } 25573 25574 @Override 25575 public OnnxType type() { 25576 return type; 25577 } 25578 25579 @Override 25580 public Quantifier quantifier() { 25581 return quantifier; 25582 } 25583 } 25584 25585 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 25586 NAME, 25587 List.of(Attribute.values()), 25588 List.of(TypeConstraint.values()), 25589 List.of(InputParameter.values()), 25590 List.of(OutputParameter.values()) 25591 ); 25592 25593 public Shrink(ExternalizedOp def) { 25594 super(SCHEMA, def); 25595 } 25596 25597 Shrink(Shrink that, CopyContext cc) { 25598 super(that, cc); 25599 } 25600 25601 @Override 25602 public Shrink transform(CopyContext cc, OpTransformer ot) { 25603 return new Shrink(this, cc); 25604 } 25605 25606 Shrink(TypeElement resultType, Value input, java.util.Optional<Float> lambd, java.util.Optional<Float> bias) { 25607 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(lambd, bias)); 25608 } 25609 25610 @Override 25611 public SequencedSet<OnnxParameter> onnxOutputs() { 25612 return onnxOutputs(SCHEMA); 25613 } 25614 25615 @Override 25616 public SequencedMap<OnnxParameter, Object> onnxInputs() { 25617 return onnxInputs(SCHEMA, List.of(input())); 25618 } 25619 25620 public Value input() { 25621 return operands().get(0); 25622 } 25623 25624 public java.util.Optional<Float> lambd() { 25625 Float lambd = Attribute.lambd.access(Float.class, onnxAttributes); 25626 return java.util.Optional.ofNullable(lambd); 25627 } 25628 25629 public java.util.Optional<Float> bias() { 25630 Float bias = Attribute.bias.access(Float.class, onnxAttributes); 25631 return java.util.Optional.ofNullable(bias); 25632 } 25633 25634 } 25635 25636 public static Shrink Shrink(TypeElement resultType, Value input, java.util.Optional<Float> lambd, java.util.Optional<Float> bias) { 25637 return new Shrink(resultType, input, lambd, bias); 25638 } 25639 25640 @OpFactory.OpDeclaration(Sigmoid.NAME) 25641 public static final class Sigmoid extends OnnxOp { 25642 public static final String NAME = "Sigmoid"; 25643 25644 public enum Attribute implements OnnxAttribute.None { } 25645 25646 public enum TypeConstraint implements OnnxTypeConstraint { 25647 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 25648 ; 25649 25650 final OnnxType.TypeVariable typeVariable; 25651 25652 TypeConstraint(OnnxType.TypeVariable typeVariable) { 25653 assert typeVariable.name().equals(name()); 25654 this.typeVariable = typeVariable; 25655 } 25656 25657 @Override 25658 public OnnxType.TypeVariable typeVariable() { 25659 return typeVariable; 25660 } 25661 } 25662 25663 public enum InputParameter implements OnnxParameter { 25664 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25665 ; 25666 25667 final OnnxType type; 25668 final Quantifier quantifier; 25669 25670 InputParameter(OnnxType type, Quantifier quantifier) { 25671 this.type = type; 25672 this.quantifier = quantifier; 25673 } 25674 25675 @Override 25676 public OnnxType type() { 25677 return type; 25678 } 25679 25680 @Override 25681 public Quantifier quantifier() { 25682 return quantifier; 25683 } 25684 } 25685 25686 public enum OutputParameter implements OnnxParameter { 25687 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25688 ; 25689 25690 final OnnxType type; 25691 final Quantifier quantifier; 25692 25693 OutputParameter(OnnxType type, Quantifier quantifier) { 25694 this.type = type; 25695 this.quantifier = quantifier; 25696 } 25697 25698 @Override 25699 public OnnxType type() { 25700 return type; 25701 } 25702 25703 @Override 25704 public Quantifier quantifier() { 25705 return quantifier; 25706 } 25707 } 25708 25709 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 25710 NAME, 25711 List.of(Attribute.values()), 25712 List.of(TypeConstraint.values()), 25713 List.of(InputParameter.values()), 25714 List.of(OutputParameter.values()) 25715 ); 25716 25717 public Sigmoid(ExternalizedOp def) { 25718 super(SCHEMA, def); 25719 } 25720 25721 Sigmoid(Sigmoid that, CopyContext cc) { 25722 super(that, cc); 25723 } 25724 25725 @Override 25726 public Sigmoid transform(CopyContext cc, OpTransformer ot) { 25727 return new Sigmoid(this, cc); 25728 } 25729 25730 Sigmoid(TypeElement resultType, Value X) { 25731 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 25732 } 25733 25734 @Override 25735 public SequencedSet<OnnxParameter> onnxOutputs() { 25736 return onnxOutputs(SCHEMA); 25737 } 25738 25739 @Override 25740 public SequencedMap<OnnxParameter, Object> onnxInputs() { 25741 return onnxInputs(SCHEMA, List.of(X())); 25742 } 25743 25744 public Value X() { 25745 return operands().get(0); 25746 } 25747 25748 } 25749 25750 public static Sigmoid Sigmoid(TypeElement resultType, Value X) { 25751 return new Sigmoid(resultType, X); 25752 } 25753 25754 @OpFactory.OpDeclaration(Sign.NAME) 25755 public static final class Sign extends OnnxOp { 25756 public static final String NAME = "Sign"; 25757 25758 public enum Attribute implements OnnxAttribute.None { } 25759 25760 public enum TypeConstraint implements OnnxTypeConstraint { 25761 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())))), 25762 ; 25763 25764 final OnnxType.TypeVariable typeVariable; 25765 25766 TypeConstraint(OnnxType.TypeVariable typeVariable) { 25767 assert typeVariable.name().equals(name()); 25768 this.typeVariable = typeVariable; 25769 } 25770 25771 @Override 25772 public OnnxType.TypeVariable typeVariable() { 25773 return typeVariable; 25774 } 25775 } 25776 25777 public enum InputParameter implements OnnxParameter { 25778 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25779 ; 25780 25781 final OnnxType type; 25782 final Quantifier quantifier; 25783 25784 InputParameter(OnnxType type, Quantifier quantifier) { 25785 this.type = type; 25786 this.quantifier = quantifier; 25787 } 25788 25789 @Override 25790 public OnnxType type() { 25791 return type; 25792 } 25793 25794 @Override 25795 public Quantifier quantifier() { 25796 return quantifier; 25797 } 25798 } 25799 25800 public enum OutputParameter implements OnnxParameter { 25801 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25802 ; 25803 25804 final OnnxType type; 25805 final Quantifier quantifier; 25806 25807 OutputParameter(OnnxType type, Quantifier quantifier) { 25808 this.type = type; 25809 this.quantifier = quantifier; 25810 } 25811 25812 @Override 25813 public OnnxType type() { 25814 return type; 25815 } 25816 25817 @Override 25818 public Quantifier quantifier() { 25819 return quantifier; 25820 } 25821 } 25822 25823 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 25824 NAME, 25825 List.of(Attribute.values()), 25826 List.of(TypeConstraint.values()), 25827 List.of(InputParameter.values()), 25828 List.of(OutputParameter.values()) 25829 ); 25830 25831 public Sign(ExternalizedOp def) { 25832 super(SCHEMA, def); 25833 } 25834 25835 Sign(Sign that, CopyContext cc) { 25836 super(that, cc); 25837 } 25838 25839 @Override 25840 public Sign transform(CopyContext cc, OpTransformer ot) { 25841 return new Sign(this, cc); 25842 } 25843 25844 Sign(TypeElement resultType, Value input) { 25845 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 25846 } 25847 25848 @Override 25849 public SequencedSet<OnnxParameter> onnxOutputs() { 25850 return onnxOutputs(SCHEMA); 25851 } 25852 25853 @Override 25854 public SequencedMap<OnnxParameter, Object> onnxInputs() { 25855 return onnxInputs(SCHEMA, List.of(input())); 25856 } 25857 25858 public Value input() { 25859 return operands().get(0); 25860 } 25861 25862 } 25863 25864 public static Sign Sign(TypeElement resultType, Value input) { 25865 return new Sign(resultType, input); 25866 } 25867 25868 @OpFactory.OpDeclaration(Sin.NAME) 25869 public static final class Sin extends OnnxOp { 25870 public static final String NAME = "Sin"; 25871 25872 public enum Attribute implements OnnxAttribute.None { } 25873 25874 public enum TypeConstraint implements OnnxTypeConstraint { 25875 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 25876 ; 25877 25878 final OnnxType.TypeVariable typeVariable; 25879 25880 TypeConstraint(OnnxType.TypeVariable typeVariable) { 25881 assert typeVariable.name().equals(name()); 25882 this.typeVariable = typeVariable; 25883 } 25884 25885 @Override 25886 public OnnxType.TypeVariable typeVariable() { 25887 return typeVariable; 25888 } 25889 } 25890 25891 public enum InputParameter implements OnnxParameter { 25892 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25893 ; 25894 25895 final OnnxType type; 25896 final Quantifier quantifier; 25897 25898 InputParameter(OnnxType type, Quantifier quantifier) { 25899 this.type = type; 25900 this.quantifier = quantifier; 25901 } 25902 25903 @Override 25904 public OnnxType type() { 25905 return type; 25906 } 25907 25908 @Override 25909 public Quantifier quantifier() { 25910 return quantifier; 25911 } 25912 } 25913 25914 public enum OutputParameter implements OnnxParameter { 25915 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 25916 ; 25917 25918 final OnnxType type; 25919 final Quantifier quantifier; 25920 25921 OutputParameter(OnnxType type, Quantifier quantifier) { 25922 this.type = type; 25923 this.quantifier = quantifier; 25924 } 25925 25926 @Override 25927 public OnnxType type() { 25928 return type; 25929 } 25930 25931 @Override 25932 public Quantifier quantifier() { 25933 return quantifier; 25934 } 25935 } 25936 25937 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 25938 NAME, 25939 List.of(Attribute.values()), 25940 List.of(TypeConstraint.values()), 25941 List.of(InputParameter.values()), 25942 List.of(OutputParameter.values()) 25943 ); 25944 25945 public Sin(ExternalizedOp def) { 25946 super(SCHEMA, def); 25947 } 25948 25949 Sin(Sin that, CopyContext cc) { 25950 super(that, cc); 25951 } 25952 25953 @Override 25954 public Sin transform(CopyContext cc, OpTransformer ot) { 25955 return new Sin(this, cc); 25956 } 25957 25958 Sin(TypeElement resultType, Value input) { 25959 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 25960 } 25961 25962 @Override 25963 public SequencedSet<OnnxParameter> onnxOutputs() { 25964 return onnxOutputs(SCHEMA); 25965 } 25966 25967 @Override 25968 public SequencedMap<OnnxParameter, Object> onnxInputs() { 25969 return onnxInputs(SCHEMA, List.of(input())); 25970 } 25971 25972 public Value input() { 25973 return operands().get(0); 25974 } 25975 25976 } 25977 25978 public static Sin Sin(TypeElement resultType, Value input) { 25979 return new Sin(resultType, input); 25980 } 25981 25982 @OpFactory.OpDeclaration(Sinh.NAME) 25983 public static final class Sinh extends OnnxOp { 25984 public static final String NAME = "Sinh"; 25985 25986 public enum Attribute implements OnnxAttribute.None { } 25987 25988 public enum TypeConstraint implements OnnxTypeConstraint { 25989 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 25990 ; 25991 25992 final OnnxType.TypeVariable typeVariable; 25993 25994 TypeConstraint(OnnxType.TypeVariable typeVariable) { 25995 assert typeVariable.name().equals(name()); 25996 this.typeVariable = typeVariable; 25997 } 25998 25999 @Override 26000 public OnnxType.TypeVariable typeVariable() { 26001 return typeVariable; 26002 } 26003 } 26004 26005 public enum InputParameter implements OnnxParameter { 26006 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26007 ; 26008 26009 final OnnxType type; 26010 final Quantifier quantifier; 26011 26012 InputParameter(OnnxType type, Quantifier quantifier) { 26013 this.type = type; 26014 this.quantifier = quantifier; 26015 } 26016 26017 @Override 26018 public OnnxType type() { 26019 return type; 26020 } 26021 26022 @Override 26023 public Quantifier quantifier() { 26024 return quantifier; 26025 } 26026 } 26027 26028 public enum OutputParameter implements OnnxParameter { 26029 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26030 ; 26031 26032 final OnnxType type; 26033 final Quantifier quantifier; 26034 26035 OutputParameter(OnnxType type, Quantifier quantifier) { 26036 this.type = type; 26037 this.quantifier = quantifier; 26038 } 26039 26040 @Override 26041 public OnnxType type() { 26042 return type; 26043 } 26044 26045 @Override 26046 public Quantifier quantifier() { 26047 return quantifier; 26048 } 26049 } 26050 26051 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 26052 NAME, 26053 List.of(Attribute.values()), 26054 List.of(TypeConstraint.values()), 26055 List.of(InputParameter.values()), 26056 List.of(OutputParameter.values()) 26057 ); 26058 26059 public Sinh(ExternalizedOp def) { 26060 super(SCHEMA, def); 26061 } 26062 26063 Sinh(Sinh that, CopyContext cc) { 26064 super(that, cc); 26065 } 26066 26067 @Override 26068 public Sinh transform(CopyContext cc, OpTransformer ot) { 26069 return new Sinh(this, cc); 26070 } 26071 26072 Sinh(TypeElement resultType, Value input) { 26073 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 26074 } 26075 26076 @Override 26077 public SequencedSet<OnnxParameter> onnxOutputs() { 26078 return onnxOutputs(SCHEMA); 26079 } 26080 26081 @Override 26082 public SequencedMap<OnnxParameter, Object> onnxInputs() { 26083 return onnxInputs(SCHEMA, List.of(input())); 26084 } 26085 26086 public Value input() { 26087 return operands().get(0); 26088 } 26089 26090 } 26091 26092 public static Sinh Sinh(TypeElement resultType, Value input) { 26093 return new Sinh(resultType, input); 26094 } 26095 26096 @OpFactory.OpDeclaration(Size.NAME) 26097 public static final class Size extends OnnxOp { 26098 public static final String NAME = "Size"; 26099 26100 public enum Attribute implements OnnxAttribute.None { } 26101 26102 public enum TypeConstraint implements OnnxTypeConstraint { 26103 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())))), 26104 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int64())))), 26105 ; 26106 26107 final OnnxType.TypeVariable typeVariable; 26108 26109 TypeConstraint(OnnxType.TypeVariable typeVariable) { 26110 assert typeVariable.name().equals(name()); 26111 this.typeVariable = typeVariable; 26112 } 26113 26114 @Override 26115 public OnnxType.TypeVariable typeVariable() { 26116 return typeVariable; 26117 } 26118 } 26119 26120 public enum InputParameter implements OnnxParameter { 26121 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26122 ; 26123 26124 final OnnxType type; 26125 final Quantifier quantifier; 26126 26127 InputParameter(OnnxType type, Quantifier quantifier) { 26128 this.type = type; 26129 this.quantifier = quantifier; 26130 } 26131 26132 @Override 26133 public OnnxType type() { 26134 return type; 26135 } 26136 26137 @Override 26138 public Quantifier quantifier() { 26139 return quantifier; 26140 } 26141 } 26142 26143 public enum OutputParameter implements OnnxParameter { 26144 size(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 26145 ; 26146 26147 final OnnxType type; 26148 final Quantifier quantifier; 26149 26150 OutputParameter(OnnxType type, Quantifier quantifier) { 26151 this.type = type; 26152 this.quantifier = quantifier; 26153 } 26154 26155 @Override 26156 public OnnxType type() { 26157 return type; 26158 } 26159 26160 @Override 26161 public Quantifier quantifier() { 26162 return quantifier; 26163 } 26164 } 26165 26166 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 26167 NAME, 26168 List.of(Attribute.values()), 26169 List.of(TypeConstraint.values()), 26170 List.of(InputParameter.values()), 26171 List.of(OutputParameter.values()) 26172 ); 26173 26174 public Size(ExternalizedOp def) { 26175 super(SCHEMA, def); 26176 } 26177 26178 Size(Size that, CopyContext cc) { 26179 super(that, cc); 26180 } 26181 26182 @Override 26183 public Size transform(CopyContext cc, OpTransformer ot) { 26184 return new Size(this, cc); 26185 } 26186 26187 Size(TypeElement resultType, Value data) { 26188 super(SCHEMA, resultType, Set.of(), List.of(data), List.of()); 26189 } 26190 26191 @Override 26192 public SequencedSet<OnnxParameter> onnxOutputs() { 26193 return onnxOutputs(SCHEMA); 26194 } 26195 26196 @Override 26197 public SequencedMap<OnnxParameter, Object> onnxInputs() { 26198 return onnxInputs(SCHEMA, List.of(data())); 26199 } 26200 26201 public Value data() { 26202 return operands().get(0); 26203 } 26204 26205 } 26206 26207 public static Size Size(TypeElement resultType, Value data) { 26208 return new Size(resultType, data); 26209 } 26210 26211 @OpFactory.OpDeclaration(Slice.NAME) 26212 public static final class Slice extends OnnxOp { 26213 public static final String NAME = "Slice"; 26214 26215 public enum Attribute implements OnnxAttribute.None { } 26216 26217 public enum TypeConstraint implements OnnxTypeConstraint { 26218 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())))), 26219 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 26220 ; 26221 26222 final OnnxType.TypeVariable typeVariable; 26223 26224 TypeConstraint(OnnxType.TypeVariable typeVariable) { 26225 assert typeVariable.name().equals(name()); 26226 this.typeVariable = typeVariable; 26227 } 26228 26229 @Override 26230 public OnnxType.TypeVariable typeVariable() { 26231 return typeVariable; 26232 } 26233 } 26234 26235 public enum InputParameter implements OnnxParameter { 26236 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26237 starts(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 26238 ends(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 26239 axes(TypeConstraint.Tind.typeVariable(), Quantifier.OPTIONAL), 26240 steps(TypeConstraint.Tind.typeVariable(), Quantifier.OPTIONAL), 26241 ; 26242 26243 final OnnxType type; 26244 final Quantifier quantifier; 26245 26246 InputParameter(OnnxType type, Quantifier quantifier) { 26247 this.type = type; 26248 this.quantifier = quantifier; 26249 } 26250 26251 @Override 26252 public OnnxType type() { 26253 return type; 26254 } 26255 26256 @Override 26257 public Quantifier quantifier() { 26258 return quantifier; 26259 } 26260 } 26261 26262 public enum OutputParameter implements OnnxParameter { 26263 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26264 ; 26265 26266 final OnnxType type; 26267 final Quantifier quantifier; 26268 26269 OutputParameter(OnnxType type, Quantifier quantifier) { 26270 this.type = type; 26271 this.quantifier = quantifier; 26272 } 26273 26274 @Override 26275 public OnnxType type() { 26276 return type; 26277 } 26278 26279 @Override 26280 public Quantifier quantifier() { 26281 return quantifier; 26282 } 26283 } 26284 26285 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 26286 NAME, 26287 List.of(Attribute.values()), 26288 List.of(TypeConstraint.values()), 26289 List.of(InputParameter.values()), 26290 List.of(OutputParameter.values()) 26291 ); 26292 26293 public Slice(ExternalizedOp def) { 26294 super(SCHEMA, def); 26295 } 26296 26297 Slice(Slice that, CopyContext cc) { 26298 super(that, cc); 26299 } 26300 26301 @Override 26302 public Slice transform(CopyContext cc, OpTransformer ot) { 26303 return new Slice(this, cc); 26304 } 26305 26306 Slice(TypeElement resultType, Value data, Value starts, Value ends, java.util.Optional<Value> axes, java.util.Optional<Value> steps) { 26307 super(SCHEMA, resultType, Set.of(), List.of(data, starts, ends, axes, steps), List.of()); 26308 } 26309 26310 @Override 26311 public SequencedSet<OnnxParameter> onnxOutputs() { 26312 return onnxOutputs(SCHEMA); 26313 } 26314 26315 @Override 26316 public SequencedMap<OnnxParameter, Object> onnxInputs() { 26317 return onnxInputs(SCHEMA, List.of(data(), starts(), ends(), axes(), steps())); 26318 } 26319 26320 public Value data() { 26321 return operands().get(0); 26322 } 26323 26324 public Value starts() { 26325 return operands().get(1); 26326 } 26327 26328 public Value ends() { 26329 return operands().get(2); 26330 } 26331 26332 public java.util.Optional<Value> axes() { 26333 int i = optionalInputArguments.indexOf(InputParameter.axes); 26334 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 26335 } 26336 26337 public java.util.Optional<Value> steps() { 26338 int i = optionalInputArguments.indexOf(InputParameter.steps); 26339 return i != -1 ? java.util.Optional.of(operands().get(3 + i)) : java.util.Optional.empty(); 26340 } 26341 26342 } 26343 26344 public static Slice Slice(TypeElement resultType, Value data, Value starts, Value ends, java.util.Optional<Value> axes, java.util.Optional<Value> steps) { 26345 return new Slice(resultType, data, starts, ends, axes, steps); 26346 } 26347 26348 @OpFactory.OpDeclaration(Softmax.NAME) 26349 public static final class Softmax extends OnnxOp { 26350 public static final String NAME = "Softmax"; 26351 26352 public enum Attribute implements OnnxAttribute { 26353 axis(Long.class, true, -1), 26354 ; 26355 26356 final Class<?> t; 26357 final boolean optional; 26358 final Object defaultValue; 26359 26360 Attribute(Class<?> type, boolean optional, Object defaultValue) { 26361 this.t = type; 26362 this.optional = optional; 26363 this.defaultValue = defaultValue; 26364 assert optional || defaultValue == null; 26365 } 26366 26367 public Class<?> type() { 26368 return t; 26369 } 26370 26371 public boolean isOptional() { 26372 return optional; 26373 } 26374 26375 public Object defaultValue() { 26376 return defaultValue; 26377 } 26378 } 26379 26380 public enum TypeConstraint implements OnnxTypeConstraint { 26381 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 26382 ; 26383 26384 final OnnxType.TypeVariable typeVariable; 26385 26386 TypeConstraint(OnnxType.TypeVariable typeVariable) { 26387 assert typeVariable.name().equals(name()); 26388 this.typeVariable = typeVariable; 26389 } 26390 26391 @Override 26392 public OnnxType.TypeVariable typeVariable() { 26393 return typeVariable; 26394 } 26395 } 26396 26397 public enum InputParameter implements OnnxParameter { 26398 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26399 ; 26400 26401 final OnnxType type; 26402 final Quantifier quantifier; 26403 26404 InputParameter(OnnxType type, Quantifier quantifier) { 26405 this.type = type; 26406 this.quantifier = quantifier; 26407 } 26408 26409 @Override 26410 public OnnxType type() { 26411 return type; 26412 } 26413 26414 @Override 26415 public Quantifier quantifier() { 26416 return quantifier; 26417 } 26418 } 26419 26420 public enum OutputParameter implements OnnxParameter { 26421 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26422 ; 26423 26424 final OnnxType type; 26425 final Quantifier quantifier; 26426 26427 OutputParameter(OnnxType type, Quantifier quantifier) { 26428 this.type = type; 26429 this.quantifier = quantifier; 26430 } 26431 26432 @Override 26433 public OnnxType type() { 26434 return type; 26435 } 26436 26437 @Override 26438 public Quantifier quantifier() { 26439 return quantifier; 26440 } 26441 } 26442 26443 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 26444 NAME, 26445 List.of(Attribute.values()), 26446 List.of(TypeConstraint.values()), 26447 List.of(InputParameter.values()), 26448 List.of(OutputParameter.values()) 26449 ); 26450 26451 public Softmax(ExternalizedOp def) { 26452 super(SCHEMA, def); 26453 } 26454 26455 Softmax(Softmax that, CopyContext cc) { 26456 super(that, cc); 26457 } 26458 26459 @Override 26460 public Softmax transform(CopyContext cc, OpTransformer ot) { 26461 return new Softmax(this, cc); 26462 } 26463 26464 Softmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) { 26465 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(axis)); 26466 } 26467 26468 @Override 26469 public SequencedSet<OnnxParameter> onnxOutputs() { 26470 return onnxOutputs(SCHEMA); 26471 } 26472 26473 @Override 26474 public SequencedMap<OnnxParameter, Object> onnxInputs() { 26475 return onnxInputs(SCHEMA, List.of(input())); 26476 } 26477 26478 public Value input() { 26479 return operands().get(0); 26480 } 26481 26482 public java.util.Optional<Long> axis() { 26483 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 26484 return java.util.Optional.ofNullable(axis); 26485 } 26486 26487 } 26488 26489 public static Softmax Softmax(TypeElement resultType, Value input, java.util.Optional<Long> axis) { 26490 return new Softmax(resultType, input, axis); 26491 } 26492 26493 @OpFactory.OpDeclaration(SoftmaxCrossEntropyLoss.NAME) 26494 public static final class SoftmaxCrossEntropyLoss extends OnnxOp { 26495 public static final String NAME = "SoftmaxCrossEntropyLoss"; 26496 26497 public enum Attribute implements OnnxAttribute { 26498 ignore_index(Long.class, true, null), 26499 reduction(String.class, true, "mean"), 26500 ; 26501 26502 final Class<?> t; 26503 final boolean optional; 26504 final Object defaultValue; 26505 26506 Attribute(Class<?> type, boolean optional, Object defaultValue) { 26507 this.t = type; 26508 this.optional = optional; 26509 this.defaultValue = defaultValue; 26510 assert optional || defaultValue == null; 26511 } 26512 26513 public Class<?> type() { 26514 return t; 26515 } 26516 26517 public boolean isOptional() { 26518 return optional; 26519 } 26520 26521 public Object defaultValue() { 26522 return defaultValue; 26523 } 26524 } 26525 26526 public enum TypeConstraint implements OnnxTypeConstraint { 26527 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 26528 Tind(new OnnxType.TypeVariable("Tind", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 26529 ; 26530 26531 final OnnxType.TypeVariable typeVariable; 26532 26533 TypeConstraint(OnnxType.TypeVariable typeVariable) { 26534 assert typeVariable.name().equals(name()); 26535 this.typeVariable = typeVariable; 26536 } 26537 26538 @Override 26539 public OnnxType.TypeVariable typeVariable() { 26540 return typeVariable; 26541 } 26542 } 26543 26544 public enum InputParameter implements OnnxParameter { 26545 scores(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26546 labels(TypeConstraint.Tind.typeVariable(), Quantifier.REQUIRED), 26547 weights(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 26548 ; 26549 26550 final OnnxType type; 26551 final Quantifier quantifier; 26552 26553 InputParameter(OnnxType type, Quantifier quantifier) { 26554 this.type = type; 26555 this.quantifier = quantifier; 26556 } 26557 26558 @Override 26559 public OnnxType type() { 26560 return type; 26561 } 26562 26563 @Override 26564 public Quantifier quantifier() { 26565 return quantifier; 26566 } 26567 } 26568 26569 public enum OutputParameter implements OnnxParameter { 26570 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26571 log_prob(TypeConstraint.T.typeVariable(), Quantifier.OPTIONAL), 26572 ; 26573 26574 final OnnxType type; 26575 final Quantifier quantifier; 26576 26577 OutputParameter(OnnxType type, Quantifier quantifier) { 26578 this.type = type; 26579 this.quantifier = quantifier; 26580 } 26581 26582 @Override 26583 public OnnxType type() { 26584 return type; 26585 } 26586 26587 @Override 26588 public Quantifier quantifier() { 26589 return quantifier; 26590 } 26591 } 26592 26593 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 26594 NAME, 26595 List.of(Attribute.values()), 26596 List.of(TypeConstraint.values()), 26597 List.of(InputParameter.values()), 26598 List.of(OutputParameter.values()) 26599 ); 26600 26601 public SoftmaxCrossEntropyLoss(ExternalizedOp def) { 26602 super(SCHEMA, def); 26603 } 26604 26605 SoftmaxCrossEntropyLoss(SoftmaxCrossEntropyLoss that, CopyContext cc) { 26606 super(that, cc); 26607 } 26608 26609 @Override 26610 public SoftmaxCrossEntropyLoss transform(CopyContext cc, OpTransformer ot) { 26611 return new SoftmaxCrossEntropyLoss(this, cc); 26612 } 26613 26614 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) { 26615 super(SCHEMA, resultType, optionalOutputs, List.of(scores, labels, weights), List.of(ignore_index, reduction)); 26616 } 26617 26618 @Override 26619 public SequencedSet<OnnxParameter> onnxOutputs() { 26620 return onnxOutputs(SCHEMA); 26621 } 26622 26623 @Override 26624 public SequencedMap<OnnxParameter, Object> onnxInputs() { 26625 return onnxInputs(SCHEMA, List.of(scores(), labels(), weights())); 26626 } 26627 26628 public Value scores() { 26629 return operands().get(0); 26630 } 26631 26632 public Value labels() { 26633 return operands().get(1); 26634 } 26635 26636 public java.util.Optional<Value> weights() { 26637 int i = optionalInputArguments.indexOf(InputParameter.weights); 26638 return i != -1 ? java.util.Optional.of(operands().get(2 + i)) : java.util.Optional.empty(); 26639 } 26640 26641 public java.util.Optional<Long> ignore_index() { 26642 Long ignore_index = Attribute.ignore_index.access(Long.class, onnxAttributes); 26643 return java.util.Optional.ofNullable(ignore_index); 26644 } 26645 26646 public java.util.Optional<String> reduction() { 26647 String reduction = Attribute.reduction.access(String.class, onnxAttributes); 26648 return java.util.Optional.ofNullable(reduction); 26649 } 26650 26651 } 26652 26653 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) { 26654 return new SoftmaxCrossEntropyLoss(resultType, optionalOutputs, scores, labels, weights, ignore_index, reduction); 26655 } 26656 26657 @OpFactory.OpDeclaration(Softplus.NAME) 26658 public static final class Softplus extends OnnxOp { 26659 public static final String NAME = "Softplus"; 26660 26661 public enum Attribute implements OnnxAttribute.None { } 26662 26663 public enum TypeConstraint implements OnnxTypeConstraint { 26664 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 26665 ; 26666 26667 final OnnxType.TypeVariable typeVariable; 26668 26669 TypeConstraint(OnnxType.TypeVariable typeVariable) { 26670 assert typeVariable.name().equals(name()); 26671 this.typeVariable = typeVariable; 26672 } 26673 26674 @Override 26675 public OnnxType.TypeVariable typeVariable() { 26676 return typeVariable; 26677 } 26678 } 26679 26680 public enum InputParameter implements OnnxParameter { 26681 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26682 ; 26683 26684 final OnnxType type; 26685 final Quantifier quantifier; 26686 26687 InputParameter(OnnxType type, Quantifier quantifier) { 26688 this.type = type; 26689 this.quantifier = quantifier; 26690 } 26691 26692 @Override 26693 public OnnxType type() { 26694 return type; 26695 } 26696 26697 @Override 26698 public Quantifier quantifier() { 26699 return quantifier; 26700 } 26701 } 26702 26703 public enum OutputParameter implements OnnxParameter { 26704 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26705 ; 26706 26707 final OnnxType type; 26708 final Quantifier quantifier; 26709 26710 OutputParameter(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 static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 26727 NAME, 26728 List.of(Attribute.values()), 26729 List.of(TypeConstraint.values()), 26730 List.of(InputParameter.values()), 26731 List.of(OutputParameter.values()) 26732 ); 26733 26734 public Softplus(ExternalizedOp def) { 26735 super(SCHEMA, def); 26736 } 26737 26738 Softplus(Softplus that, CopyContext cc) { 26739 super(that, cc); 26740 } 26741 26742 @Override 26743 public Softplus transform(CopyContext cc, OpTransformer ot) { 26744 return new Softplus(this, cc); 26745 } 26746 26747 Softplus(TypeElement resultType, Value X) { 26748 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 26749 } 26750 26751 @Override 26752 public SequencedSet<OnnxParameter> onnxOutputs() { 26753 return onnxOutputs(SCHEMA); 26754 } 26755 26756 @Override 26757 public SequencedMap<OnnxParameter, Object> onnxInputs() { 26758 return onnxInputs(SCHEMA, List.of(X())); 26759 } 26760 26761 public Value X() { 26762 return operands().get(0); 26763 } 26764 26765 } 26766 26767 public static Softplus Softplus(TypeElement resultType, Value X) { 26768 return new Softplus(resultType, X); 26769 } 26770 26771 @OpFactory.OpDeclaration(Softsign.NAME) 26772 public static final class Softsign extends OnnxOp { 26773 public static final String NAME = "Softsign"; 26774 26775 public enum Attribute implements OnnxAttribute.None { } 26776 26777 public enum TypeConstraint implements OnnxTypeConstraint { 26778 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 26779 ; 26780 26781 final OnnxType.TypeVariable typeVariable; 26782 26783 TypeConstraint(OnnxType.TypeVariable typeVariable) { 26784 assert typeVariable.name().equals(name()); 26785 this.typeVariable = typeVariable; 26786 } 26787 26788 @Override 26789 public OnnxType.TypeVariable typeVariable() { 26790 return typeVariable; 26791 } 26792 } 26793 26794 public enum InputParameter implements OnnxParameter { 26795 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26796 ; 26797 26798 final OnnxType type; 26799 final Quantifier quantifier; 26800 26801 InputParameter(OnnxType type, Quantifier quantifier) { 26802 this.type = type; 26803 this.quantifier = quantifier; 26804 } 26805 26806 @Override 26807 public OnnxType type() { 26808 return type; 26809 } 26810 26811 @Override 26812 public Quantifier quantifier() { 26813 return quantifier; 26814 } 26815 } 26816 26817 public enum OutputParameter implements OnnxParameter { 26818 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26819 ; 26820 26821 final OnnxType type; 26822 final Quantifier quantifier; 26823 26824 OutputParameter(OnnxType type, Quantifier quantifier) { 26825 this.type = type; 26826 this.quantifier = quantifier; 26827 } 26828 26829 @Override 26830 public OnnxType type() { 26831 return type; 26832 } 26833 26834 @Override 26835 public Quantifier quantifier() { 26836 return quantifier; 26837 } 26838 } 26839 26840 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 26841 NAME, 26842 List.of(Attribute.values()), 26843 List.of(TypeConstraint.values()), 26844 List.of(InputParameter.values()), 26845 List.of(OutputParameter.values()) 26846 ); 26847 26848 public Softsign(ExternalizedOp def) { 26849 super(SCHEMA, def); 26850 } 26851 26852 Softsign(Softsign that, CopyContext cc) { 26853 super(that, cc); 26854 } 26855 26856 @Override 26857 public Softsign transform(CopyContext cc, OpTransformer ot) { 26858 return new Softsign(this, cc); 26859 } 26860 26861 Softsign(TypeElement resultType, Value input) { 26862 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 26863 } 26864 26865 @Override 26866 public SequencedSet<OnnxParameter> onnxOutputs() { 26867 return onnxOutputs(SCHEMA); 26868 } 26869 26870 @Override 26871 public SequencedMap<OnnxParameter, Object> onnxInputs() { 26872 return onnxInputs(SCHEMA, List.of(input())); 26873 } 26874 26875 public Value input() { 26876 return operands().get(0); 26877 } 26878 26879 } 26880 26881 public static Softsign Softsign(TypeElement resultType, Value input) { 26882 return new Softsign(resultType, input); 26883 } 26884 26885 @OpFactory.OpDeclaration(SpaceToDepth.NAME) 26886 public static final class SpaceToDepth extends OnnxOp { 26887 public static final String NAME = "SpaceToDepth"; 26888 26889 public enum Attribute implements OnnxAttribute { 26890 blocksize(Long.class, false, null), 26891 ; 26892 26893 final Class<?> t; 26894 final boolean optional; 26895 final Object defaultValue; 26896 26897 Attribute(Class<?> type, boolean optional, Object defaultValue) { 26898 this.t = type; 26899 this.optional = optional; 26900 this.defaultValue = defaultValue; 26901 assert optional || defaultValue == null; 26902 } 26903 26904 public Class<?> type() { 26905 return t; 26906 } 26907 26908 public boolean isOptional() { 26909 return optional; 26910 } 26911 26912 public Object defaultValue() { 26913 return defaultValue; 26914 } 26915 } 26916 26917 public enum TypeConstraint implements OnnxTypeConstraint { 26918 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())))), 26919 ; 26920 26921 final OnnxType.TypeVariable typeVariable; 26922 26923 TypeConstraint(OnnxType.TypeVariable typeVariable) { 26924 assert typeVariable.name().equals(name()); 26925 this.typeVariable = typeVariable; 26926 } 26927 26928 @Override 26929 public OnnxType.TypeVariable typeVariable() { 26930 return typeVariable; 26931 } 26932 } 26933 26934 public enum InputParameter implements OnnxParameter { 26935 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26936 ; 26937 26938 final OnnxType type; 26939 final Quantifier quantifier; 26940 26941 InputParameter(OnnxType type, Quantifier quantifier) { 26942 this.type = type; 26943 this.quantifier = quantifier; 26944 } 26945 26946 @Override 26947 public OnnxType type() { 26948 return type; 26949 } 26950 26951 @Override 26952 public Quantifier quantifier() { 26953 return quantifier; 26954 } 26955 } 26956 26957 public enum OutputParameter implements OnnxParameter { 26958 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 26959 ; 26960 26961 final OnnxType type; 26962 final Quantifier quantifier; 26963 26964 OutputParameter(OnnxType type, Quantifier quantifier) { 26965 this.type = type; 26966 this.quantifier = quantifier; 26967 } 26968 26969 @Override 26970 public OnnxType type() { 26971 return type; 26972 } 26973 26974 @Override 26975 public Quantifier quantifier() { 26976 return quantifier; 26977 } 26978 } 26979 26980 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 26981 NAME, 26982 List.of(Attribute.values()), 26983 List.of(TypeConstraint.values()), 26984 List.of(InputParameter.values()), 26985 List.of(OutputParameter.values()) 26986 ); 26987 26988 public SpaceToDepth(ExternalizedOp def) { 26989 super(SCHEMA, def); 26990 } 26991 26992 SpaceToDepth(SpaceToDepth that, CopyContext cc) { 26993 super(that, cc); 26994 } 26995 26996 @Override 26997 public SpaceToDepth transform(CopyContext cc, OpTransformer ot) { 26998 return new SpaceToDepth(this, cc); 26999 } 27000 27001 SpaceToDepth(TypeElement resultType, Value input, long blocksize) { 27002 super(SCHEMA, resultType, Set.of(), List.of(input), List.of(blocksize)); 27003 } 27004 27005 @Override 27006 public SequencedSet<OnnxParameter> onnxOutputs() { 27007 return onnxOutputs(SCHEMA); 27008 } 27009 27010 @Override 27011 public SequencedMap<OnnxParameter, Object> onnxInputs() { 27012 return onnxInputs(SCHEMA, List.of(input())); 27013 } 27014 27015 public Value input() { 27016 return operands().get(0); 27017 } 27018 27019 public long blocksize() { 27020 long blocksize = Attribute.blocksize.access(Long.class, onnxAttributes); 27021 return blocksize; 27022 } 27023 27024 } 27025 27026 public static SpaceToDepth SpaceToDepth(TypeElement resultType, Value input, long blocksize) { 27027 return new SpaceToDepth(resultType, input, blocksize); 27028 } 27029 27030 @OpFactory.OpDeclaration(Split.NAME) 27031 public static final class Split extends OnnxOp { 27032 public static final String NAME = "Split"; 27033 27034 public enum Attribute implements OnnxAttribute { 27035 num_outputs(Long.class, true, null), 27036 axis(Long.class, true, 0), 27037 ; 27038 27039 final Class<?> t; 27040 final boolean optional; 27041 final Object defaultValue; 27042 27043 Attribute(Class<?> type, boolean optional, Object defaultValue) { 27044 this.t = type; 27045 this.optional = optional; 27046 this.defaultValue = defaultValue; 27047 assert optional || defaultValue == null; 27048 } 27049 27050 public Class<?> type() { 27051 return t; 27052 } 27053 27054 public boolean isOptional() { 27055 return optional; 27056 } 27057 27058 public Object defaultValue() { 27059 return defaultValue; 27060 } 27061 } 27062 27063 public enum TypeConstraint implements OnnxTypeConstraint { 27064 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())))), 27065 ; 27066 27067 final OnnxType.TypeVariable typeVariable; 27068 27069 TypeConstraint(OnnxType.TypeVariable typeVariable) { 27070 assert typeVariable.name().equals(name()); 27071 this.typeVariable = typeVariable; 27072 } 27073 27074 @Override 27075 public OnnxType.TypeVariable typeVariable() { 27076 return typeVariable; 27077 } 27078 } 27079 27080 public enum InputParameter implements OnnxParameter { 27081 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27082 split(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 27083 ; 27084 27085 final OnnxType type; 27086 final Quantifier quantifier; 27087 27088 InputParameter(OnnxType type, Quantifier quantifier) { 27089 this.type = type; 27090 this.quantifier = quantifier; 27091 } 27092 27093 @Override 27094 public OnnxType type() { 27095 return type; 27096 } 27097 27098 @Override 27099 public Quantifier quantifier() { 27100 return quantifier; 27101 } 27102 } 27103 27104 public enum OutputParameter implements OnnxParameter { 27105 outputs(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC), 27106 ; 27107 27108 final OnnxType type; 27109 final Quantifier quantifier; 27110 27111 OutputParameter(OnnxType type, Quantifier quantifier) { 27112 this.type = type; 27113 this.quantifier = quantifier; 27114 } 27115 27116 @Override 27117 public OnnxType type() { 27118 return type; 27119 } 27120 27121 @Override 27122 public Quantifier quantifier() { 27123 return quantifier; 27124 } 27125 } 27126 27127 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 27128 NAME, 27129 List.of(Attribute.values()), 27130 List.of(TypeConstraint.values()), 27131 List.of(InputParameter.values()), 27132 List.of(OutputParameter.values()) 27133 ); 27134 27135 public Split(ExternalizedOp def) { 27136 super(SCHEMA, def); 27137 } 27138 27139 Split(Split that, CopyContext cc) { 27140 super(that, cc); 27141 } 27142 27143 @Override 27144 public Split transform(CopyContext cc, OpTransformer ot) { 27145 return new Split(this, cc); 27146 } 27147 27148 Split(TypeElement resultType, Value input, java.util.Optional<Value> split, java.util.Optional<Long> num_outputs, java.util.Optional<Long> axis) { 27149 super(SCHEMA, resultType, Set.of(), List.of(input, split), List.of(num_outputs, axis)); 27150 } 27151 27152 @Override 27153 public SequencedSet<OnnxParameter> onnxOutputs() { 27154 return onnxOutputs(SCHEMA); 27155 } 27156 27157 @Override 27158 public SequencedMap<OnnxParameter, Object> onnxInputs() { 27159 return onnxInputs(SCHEMA, List.of(input(), split())); 27160 } 27161 27162 public Value input() { 27163 return operands().get(0); 27164 } 27165 27166 public java.util.Optional<Value> split() { 27167 int i = optionalInputArguments.indexOf(InputParameter.split); 27168 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 27169 } 27170 27171 public java.util.Optional<Long> num_outputs() { 27172 Long num_outputs = Attribute.num_outputs.access(Long.class, onnxAttributes); 27173 return java.util.Optional.ofNullable(num_outputs); 27174 } 27175 27176 public java.util.Optional<Long> axis() { 27177 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 27178 return java.util.Optional.ofNullable(axis); 27179 } 27180 27181 } 27182 27183 public static Split Split(TypeElement resultType, Value input, java.util.Optional<Value> split, java.util.Optional<Long> num_outputs, java.util.Optional<Long> axis) { 27184 return new Split(resultType, input, split, num_outputs, axis); 27185 } 27186 27187 @OpFactory.OpDeclaration(SplitToSequence.NAME) 27188 public static final class SplitToSequence extends OnnxOp { 27189 public static final String NAME = "SplitToSequence"; 27190 27191 public enum Attribute implements OnnxAttribute { 27192 keepdims(Long.class, true, 1), 27193 axis(Long.class, true, 0), 27194 ; 27195 27196 final Class<?> t; 27197 final boolean optional; 27198 final Object defaultValue; 27199 27200 Attribute(Class<?> type, boolean optional, Object defaultValue) { 27201 this.t = type; 27202 this.optional = optional; 27203 this.defaultValue = defaultValue; 27204 assert optional || defaultValue == null; 27205 } 27206 27207 public Class<?> type() { 27208 return t; 27209 } 27210 27211 public boolean isOptional() { 27212 return optional; 27213 } 27214 27215 public Object defaultValue() { 27216 return defaultValue; 27217 } 27218 } 27219 27220 public enum TypeConstraint implements OnnxTypeConstraint { 27221 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())))), 27222 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 27223 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()))))), 27224 ; 27225 27226 final OnnxType.TypeVariable typeVariable; 27227 27228 TypeConstraint(OnnxType.TypeVariable typeVariable) { 27229 assert typeVariable.name().equals(name()); 27230 this.typeVariable = typeVariable; 27231 } 27232 27233 @Override 27234 public OnnxType.TypeVariable typeVariable() { 27235 return typeVariable; 27236 } 27237 } 27238 27239 public enum InputParameter implements OnnxParameter { 27240 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27241 split(TypeConstraint.I.typeVariable(), Quantifier.OPTIONAL), 27242 ; 27243 27244 final OnnxType type; 27245 final Quantifier quantifier; 27246 27247 InputParameter(OnnxType type, Quantifier quantifier) { 27248 this.type = type; 27249 this.quantifier = quantifier; 27250 } 27251 27252 @Override 27253 public OnnxType type() { 27254 return type; 27255 } 27256 27257 @Override 27258 public Quantifier quantifier() { 27259 return quantifier; 27260 } 27261 } 27262 27263 public enum OutputParameter implements OnnxParameter { 27264 output_sequence(TypeConstraint.S.typeVariable(), Quantifier.REQUIRED), 27265 ; 27266 27267 final OnnxType type; 27268 final Quantifier quantifier; 27269 27270 OutputParameter(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 static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 27287 NAME, 27288 List.of(Attribute.values()), 27289 List.of(TypeConstraint.values()), 27290 List.of(InputParameter.values()), 27291 List.of(OutputParameter.values()) 27292 ); 27293 27294 public SplitToSequence(ExternalizedOp def) { 27295 super(SCHEMA, def); 27296 } 27297 27298 SplitToSequence(SplitToSequence that, CopyContext cc) { 27299 super(that, cc); 27300 } 27301 27302 @Override 27303 public SplitToSequence transform(CopyContext cc, OpTransformer ot) { 27304 return new SplitToSequence(this, cc); 27305 } 27306 27307 SplitToSequence(TypeElement resultType, Value input, java.util.Optional<Value> split, java.util.Optional<Long> keepdims, java.util.Optional<Long> axis) { 27308 super(SCHEMA, resultType, Set.of(), List.of(input, split), List.of(keepdims, axis)); 27309 } 27310 27311 @Override 27312 public SequencedSet<OnnxParameter> onnxOutputs() { 27313 return onnxOutputs(SCHEMA); 27314 } 27315 27316 @Override 27317 public SequencedMap<OnnxParameter, Object> onnxInputs() { 27318 return onnxInputs(SCHEMA, List.of(input(), split())); 27319 } 27320 27321 public Value input() { 27322 return operands().get(0); 27323 } 27324 27325 public java.util.Optional<Value> split() { 27326 int i = optionalInputArguments.indexOf(InputParameter.split); 27327 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 27328 } 27329 27330 public java.util.Optional<Long> keepdims() { 27331 Long keepdims = Attribute.keepdims.access(Long.class, onnxAttributes); 27332 return java.util.Optional.ofNullable(keepdims); 27333 } 27334 27335 public java.util.Optional<Long> axis() { 27336 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 27337 return java.util.Optional.ofNullable(axis); 27338 } 27339 27340 } 27341 27342 public static SplitToSequence SplitToSequence(TypeElement resultType, Value input, java.util.Optional<Value> split, java.util.Optional<Long> keepdims, java.util.Optional<Long> axis) { 27343 return new SplitToSequence(resultType, input, split, keepdims, axis); 27344 } 27345 27346 @OpFactory.OpDeclaration(Sqrt.NAME) 27347 public static final class Sqrt extends OnnxOp { 27348 public static final String NAME = "Sqrt"; 27349 27350 public enum Attribute implements OnnxAttribute.None { } 27351 27352 public enum TypeConstraint implements OnnxTypeConstraint { 27353 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 27354 ; 27355 27356 final OnnxType.TypeVariable typeVariable; 27357 27358 TypeConstraint(OnnxType.TypeVariable typeVariable) { 27359 assert typeVariable.name().equals(name()); 27360 this.typeVariable = typeVariable; 27361 } 27362 27363 @Override 27364 public OnnxType.TypeVariable typeVariable() { 27365 return typeVariable; 27366 } 27367 } 27368 27369 public enum InputParameter implements OnnxParameter { 27370 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27371 ; 27372 27373 final OnnxType type; 27374 final Quantifier quantifier; 27375 27376 InputParameter(OnnxType type, Quantifier quantifier) { 27377 this.type = type; 27378 this.quantifier = quantifier; 27379 } 27380 27381 @Override 27382 public OnnxType type() { 27383 return type; 27384 } 27385 27386 @Override 27387 public Quantifier quantifier() { 27388 return quantifier; 27389 } 27390 } 27391 27392 public enum OutputParameter implements OnnxParameter { 27393 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27394 ; 27395 27396 final OnnxType type; 27397 final Quantifier quantifier; 27398 27399 OutputParameter(OnnxType type, Quantifier quantifier) { 27400 this.type = type; 27401 this.quantifier = quantifier; 27402 } 27403 27404 @Override 27405 public OnnxType type() { 27406 return type; 27407 } 27408 27409 @Override 27410 public Quantifier quantifier() { 27411 return quantifier; 27412 } 27413 } 27414 27415 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 27416 NAME, 27417 List.of(Attribute.values()), 27418 List.of(TypeConstraint.values()), 27419 List.of(InputParameter.values()), 27420 List.of(OutputParameter.values()) 27421 ); 27422 27423 public Sqrt(ExternalizedOp def) { 27424 super(SCHEMA, def); 27425 } 27426 27427 Sqrt(Sqrt that, CopyContext cc) { 27428 super(that, cc); 27429 } 27430 27431 @Override 27432 public Sqrt transform(CopyContext cc, OpTransformer ot) { 27433 return new Sqrt(this, cc); 27434 } 27435 27436 Sqrt(TypeElement resultType, Value X) { 27437 super(SCHEMA, resultType, Set.of(), List.of(X), List.of()); 27438 } 27439 27440 @Override 27441 public SequencedSet<OnnxParameter> onnxOutputs() { 27442 return onnxOutputs(SCHEMA); 27443 } 27444 27445 @Override 27446 public SequencedMap<OnnxParameter, Object> onnxInputs() { 27447 return onnxInputs(SCHEMA, List.of(X())); 27448 } 27449 27450 public Value X() { 27451 return operands().get(0); 27452 } 27453 27454 } 27455 27456 public static Sqrt Sqrt(TypeElement resultType, Value X) { 27457 return new Sqrt(resultType, X); 27458 } 27459 27460 @OpFactory.OpDeclaration(Squeeze.NAME) 27461 public static final class Squeeze extends OnnxOp { 27462 public static final String NAME = "Squeeze"; 27463 27464 public enum Attribute implements OnnxAttribute.None { } 27465 27466 public enum TypeConstraint implements OnnxTypeConstraint { 27467 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())))), 27468 ; 27469 27470 final OnnxType.TypeVariable typeVariable; 27471 27472 TypeConstraint(OnnxType.TypeVariable typeVariable) { 27473 assert typeVariable.name().equals(name()); 27474 this.typeVariable = typeVariable; 27475 } 27476 27477 @Override 27478 public OnnxType.TypeVariable typeVariable() { 27479 return typeVariable; 27480 } 27481 } 27482 27483 public enum InputParameter implements OnnxParameter { 27484 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27485 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 27486 ; 27487 27488 final OnnxType type; 27489 final Quantifier quantifier; 27490 27491 InputParameter(OnnxType type, Quantifier quantifier) { 27492 this.type = type; 27493 this.quantifier = quantifier; 27494 } 27495 27496 @Override 27497 public OnnxType type() { 27498 return type; 27499 } 27500 27501 @Override 27502 public Quantifier quantifier() { 27503 return quantifier; 27504 } 27505 } 27506 27507 public enum OutputParameter implements OnnxParameter { 27508 squeezed(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27509 ; 27510 27511 final OnnxType type; 27512 final Quantifier quantifier; 27513 27514 OutputParameter(OnnxType type, Quantifier quantifier) { 27515 this.type = type; 27516 this.quantifier = quantifier; 27517 } 27518 27519 @Override 27520 public OnnxType type() { 27521 return type; 27522 } 27523 27524 @Override 27525 public Quantifier quantifier() { 27526 return quantifier; 27527 } 27528 } 27529 27530 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 27531 NAME, 27532 List.of(Attribute.values()), 27533 List.of(TypeConstraint.values()), 27534 List.of(InputParameter.values()), 27535 List.of(OutputParameter.values()) 27536 ); 27537 27538 public Squeeze(ExternalizedOp def) { 27539 super(SCHEMA, def); 27540 } 27541 27542 Squeeze(Squeeze that, CopyContext cc) { 27543 super(that, cc); 27544 } 27545 27546 @Override 27547 public Squeeze transform(CopyContext cc, OpTransformer ot) { 27548 return new Squeeze(this, cc); 27549 } 27550 27551 Squeeze(TypeElement resultType, Value data, java.util.Optional<Value> axes) { 27552 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of()); 27553 } 27554 27555 @Override 27556 public SequencedSet<OnnxParameter> onnxOutputs() { 27557 return onnxOutputs(SCHEMA); 27558 } 27559 27560 @Override 27561 public SequencedMap<OnnxParameter, Object> onnxInputs() { 27562 return onnxInputs(SCHEMA, List.of(data(), axes())); 27563 } 27564 27565 public Value data() { 27566 return operands().get(0); 27567 } 27568 27569 public java.util.Optional<Value> axes() { 27570 int i = optionalInputArguments.indexOf(InputParameter.axes); 27571 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 27572 } 27573 27574 } 27575 27576 public static Squeeze Squeeze(TypeElement resultType, Value data, java.util.Optional<Value> axes) { 27577 return new Squeeze(resultType, data, axes); 27578 } 27579 27580 @OpFactory.OpDeclaration(StringConcat.NAME) 27581 public static final class StringConcat extends OnnxOp { 27582 public static final String NAME = "StringConcat"; 27583 27584 public enum Attribute implements OnnxAttribute.None { } 27585 27586 public enum TypeConstraint implements OnnxTypeConstraint { 27587 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.string())))), 27588 ; 27589 27590 final OnnxType.TypeVariable typeVariable; 27591 27592 TypeConstraint(OnnxType.TypeVariable typeVariable) { 27593 assert typeVariable.name().equals(name()); 27594 this.typeVariable = typeVariable; 27595 } 27596 27597 @Override 27598 public OnnxType.TypeVariable typeVariable() { 27599 return typeVariable; 27600 } 27601 } 27602 27603 public enum InputParameter implements OnnxParameter { 27604 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27605 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27606 ; 27607 27608 final OnnxType type; 27609 final Quantifier quantifier; 27610 27611 InputParameter(OnnxType type, Quantifier quantifier) { 27612 this.type = type; 27613 this.quantifier = quantifier; 27614 } 27615 27616 @Override 27617 public OnnxType type() { 27618 return type; 27619 } 27620 27621 @Override 27622 public Quantifier quantifier() { 27623 return quantifier; 27624 } 27625 } 27626 27627 public enum OutputParameter implements OnnxParameter { 27628 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 27629 ; 27630 27631 final OnnxType type; 27632 final Quantifier quantifier; 27633 27634 OutputParameter(OnnxType type, Quantifier quantifier) { 27635 this.type = type; 27636 this.quantifier = quantifier; 27637 } 27638 27639 @Override 27640 public OnnxType type() { 27641 return type; 27642 } 27643 27644 @Override 27645 public Quantifier quantifier() { 27646 return quantifier; 27647 } 27648 } 27649 27650 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 27651 NAME, 27652 List.of(Attribute.values()), 27653 List.of(TypeConstraint.values()), 27654 List.of(InputParameter.values()), 27655 List.of(OutputParameter.values()) 27656 ); 27657 27658 public StringConcat(ExternalizedOp def) { 27659 super(SCHEMA, def); 27660 } 27661 27662 StringConcat(StringConcat that, CopyContext cc) { 27663 super(that, cc); 27664 } 27665 27666 @Override 27667 public StringConcat transform(CopyContext cc, OpTransformer ot) { 27668 return new StringConcat(this, cc); 27669 } 27670 27671 StringConcat(TypeElement resultType, Value X, Value Y) { 27672 super(SCHEMA, resultType, Set.of(), List.of(X, Y), List.of()); 27673 } 27674 27675 @Override 27676 public SequencedSet<OnnxParameter> onnxOutputs() { 27677 return onnxOutputs(SCHEMA); 27678 } 27679 27680 @Override 27681 public SequencedMap<OnnxParameter, Object> onnxInputs() { 27682 return onnxInputs(SCHEMA, List.of(X(), Y())); 27683 } 27684 27685 public Value X() { 27686 return operands().get(0); 27687 } 27688 27689 public Value Y() { 27690 return operands().get(1); 27691 } 27692 27693 } 27694 27695 public static StringConcat StringConcat(TypeElement resultType, Value X, Value Y) { 27696 return new StringConcat(resultType, X, Y); 27697 } 27698 27699 @OpFactory.OpDeclaration(StringNormalizer.NAME) 27700 public static final class StringNormalizer extends OnnxOp { 27701 public static final String NAME = "StringNormalizer"; 27702 27703 public enum Attribute implements OnnxAttribute { 27704 is_case_sensitive(Long.class, true, 0), 27705 locale(String.class, true, null), 27706 stopwords(String[].class, true, null), 27707 case_change_action(String.class, true, "NONE"), 27708 ; 27709 27710 final Class<?> t; 27711 final boolean optional; 27712 final Object defaultValue; 27713 27714 Attribute(Class<?> type, boolean optional, Object defaultValue) { 27715 this.t = type; 27716 this.optional = optional; 27717 this.defaultValue = defaultValue; 27718 assert optional || defaultValue == null; 27719 } 27720 27721 public Class<?> type() { 27722 return t; 27723 } 27724 27725 public boolean isOptional() { 27726 return optional; 27727 } 27728 27729 public Object defaultValue() { 27730 return defaultValue; 27731 } 27732 } 27733 27734 public enum TypeConstraint implements OnnxTypeConstraint.None { } 27735 27736 public enum InputParameter implements OnnxParameter { 27737 X(OnnxType.tensor(OnnxType.string()), Quantifier.REQUIRED), 27738 ; 27739 27740 final OnnxType type; 27741 final Quantifier quantifier; 27742 27743 InputParameter(OnnxType type, Quantifier quantifier) { 27744 this.type = type; 27745 this.quantifier = quantifier; 27746 } 27747 27748 @Override 27749 public OnnxType type() { 27750 return type; 27751 } 27752 27753 @Override 27754 public Quantifier quantifier() { 27755 return quantifier; 27756 } 27757 } 27758 27759 public enum OutputParameter implements OnnxParameter { 27760 Y(OnnxType.tensor(OnnxType.string()), Quantifier.REQUIRED), 27761 ; 27762 27763 final OnnxType type; 27764 final Quantifier quantifier; 27765 27766 OutputParameter(OnnxType type, Quantifier quantifier) { 27767 this.type = type; 27768 this.quantifier = quantifier; 27769 } 27770 27771 @Override 27772 public OnnxType type() { 27773 return type; 27774 } 27775 27776 @Override 27777 public Quantifier quantifier() { 27778 return quantifier; 27779 } 27780 } 27781 27782 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 27783 NAME, 27784 List.of(Attribute.values()), 27785 List.of(TypeConstraint.values()), 27786 List.of(InputParameter.values()), 27787 List.of(OutputParameter.values()) 27788 ); 27789 27790 public StringNormalizer(ExternalizedOp def) { 27791 super(SCHEMA, def); 27792 } 27793 27794 StringNormalizer(StringNormalizer that, CopyContext cc) { 27795 super(that, cc); 27796 } 27797 27798 @Override 27799 public StringNormalizer transform(CopyContext cc, OpTransformer ot) { 27800 return new StringNormalizer(this, cc); 27801 } 27802 27803 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) { 27804 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(is_case_sensitive, locale, stopwords, case_change_action)); 27805 } 27806 27807 @Override 27808 public SequencedSet<OnnxParameter> onnxOutputs() { 27809 return onnxOutputs(SCHEMA); 27810 } 27811 27812 @Override 27813 public SequencedMap<OnnxParameter, Object> onnxInputs() { 27814 return onnxInputs(SCHEMA, List.of(X())); 27815 } 27816 27817 public Value X() { 27818 return operands().get(0); 27819 } 27820 27821 public java.util.Optional<Long> is_case_sensitive() { 27822 Long is_case_sensitive = Attribute.is_case_sensitive.access(Long.class, onnxAttributes); 27823 return java.util.Optional.ofNullable(is_case_sensitive); 27824 } 27825 27826 public java.util.Optional<String> locale() { 27827 String locale = Attribute.locale.access(String.class, onnxAttributes); 27828 return java.util.Optional.ofNullable(locale); 27829 } 27830 27831 public java.util.Optional<String[]> stopwords() { 27832 String[] stopwords = Attribute.stopwords.access(String[].class, onnxAttributes); 27833 return java.util.Optional.ofNullable(stopwords).map(String[]::clone); 27834 } 27835 27836 public java.util.Optional<String> case_change_action() { 27837 String case_change_action = Attribute.case_change_action.access(String.class, onnxAttributes); 27838 return java.util.Optional.ofNullable(case_change_action); 27839 } 27840 27841 } 27842 27843 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) { 27844 return new StringNormalizer(resultType, X, is_case_sensitive, locale, stopwords, case_change_action); 27845 } 27846 27847 @OpFactory.OpDeclaration(StringSplit.NAME) 27848 public static final class StringSplit extends OnnxOp { 27849 public static final String NAME = "StringSplit"; 27850 27851 public enum Attribute implements OnnxAttribute { 27852 delimiter(String.class, true, null), 27853 maxsplit(Long.class, true, null), 27854 ; 27855 27856 final Class<?> t; 27857 final boolean optional; 27858 final Object defaultValue; 27859 27860 Attribute(Class<?> type, boolean optional, Object defaultValue) { 27861 this.t = type; 27862 this.optional = optional; 27863 this.defaultValue = defaultValue; 27864 assert optional || defaultValue == null; 27865 } 27866 27867 public Class<?> type() { 27868 return t; 27869 } 27870 27871 public boolean isOptional() { 27872 return optional; 27873 } 27874 27875 public Object defaultValue() { 27876 return defaultValue; 27877 } 27878 } 27879 27880 public enum TypeConstraint implements OnnxTypeConstraint { 27881 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.string())))), 27882 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string())))), 27883 T3(new OnnxType.TypeVariable("T3", List.of(OnnxType.tensor(OnnxType.int64())))), 27884 ; 27885 27886 final OnnxType.TypeVariable typeVariable; 27887 27888 TypeConstraint(OnnxType.TypeVariable typeVariable) { 27889 assert typeVariable.name().equals(name()); 27890 this.typeVariable = typeVariable; 27891 } 27892 27893 @Override 27894 public OnnxType.TypeVariable typeVariable() { 27895 return typeVariable; 27896 } 27897 } 27898 27899 public enum InputParameter implements OnnxParameter { 27900 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 27901 ; 27902 27903 final OnnxType type; 27904 final Quantifier quantifier; 27905 27906 InputParameter(OnnxType type, Quantifier quantifier) { 27907 this.type = type; 27908 this.quantifier = quantifier; 27909 } 27910 27911 @Override 27912 public OnnxType type() { 27913 return type; 27914 } 27915 27916 @Override 27917 public Quantifier quantifier() { 27918 return quantifier; 27919 } 27920 } 27921 27922 public enum OutputParameter implements OnnxParameter { 27923 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 27924 Z(TypeConstraint.T3.typeVariable(), Quantifier.REQUIRED), 27925 ; 27926 27927 final OnnxType type; 27928 final Quantifier quantifier; 27929 27930 OutputParameter(OnnxType type, Quantifier quantifier) { 27931 this.type = type; 27932 this.quantifier = quantifier; 27933 } 27934 27935 @Override 27936 public OnnxType type() { 27937 return type; 27938 } 27939 27940 @Override 27941 public Quantifier quantifier() { 27942 return quantifier; 27943 } 27944 } 27945 27946 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 27947 NAME, 27948 List.of(Attribute.values()), 27949 List.of(TypeConstraint.values()), 27950 List.of(InputParameter.values()), 27951 List.of(OutputParameter.values()) 27952 ); 27953 27954 public StringSplit(ExternalizedOp def) { 27955 super(SCHEMA, def); 27956 } 27957 27958 StringSplit(StringSplit that, CopyContext cc) { 27959 super(that, cc); 27960 } 27961 27962 @Override 27963 public StringSplit transform(CopyContext cc, OpTransformer ot) { 27964 return new StringSplit(this, cc); 27965 } 27966 27967 StringSplit(TypeElement resultType, Value X, java.util.Optional<String> delimiter, java.util.Optional<Long> maxsplit) { 27968 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(delimiter, maxsplit)); 27969 } 27970 27971 @Override 27972 public SequencedSet<OnnxParameter> onnxOutputs() { 27973 return onnxOutputs(SCHEMA); 27974 } 27975 27976 @Override 27977 public SequencedMap<OnnxParameter, Object> onnxInputs() { 27978 return onnxInputs(SCHEMA, List.of(X())); 27979 } 27980 27981 public Value X() { 27982 return operands().get(0); 27983 } 27984 27985 public java.util.Optional<String> delimiter() { 27986 String delimiter = Attribute.delimiter.access(String.class, onnxAttributes); 27987 return java.util.Optional.ofNullable(delimiter); 27988 } 27989 27990 public java.util.Optional<Long> maxsplit() { 27991 Long maxsplit = Attribute.maxsplit.access(Long.class, onnxAttributes); 27992 return java.util.Optional.ofNullable(maxsplit); 27993 } 27994 27995 } 27996 27997 public static StringSplit StringSplit(TypeElement resultType, Value X, java.util.Optional<String> delimiter, java.util.Optional<Long> maxsplit) { 27998 return new StringSplit(resultType, X, delimiter, maxsplit); 27999 } 28000 28001 @OpFactory.OpDeclaration(Sub.NAME) 28002 public static final class Sub extends OnnxOp { 28003 public static final String NAME = "Sub"; 28004 28005 public enum Attribute implements OnnxAttribute.None { } 28006 28007 public enum TypeConstraint implements OnnxTypeConstraint { 28008 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())))), 28009 ; 28010 28011 final OnnxType.TypeVariable typeVariable; 28012 28013 TypeConstraint(OnnxType.TypeVariable typeVariable) { 28014 assert typeVariable.name().equals(name()); 28015 this.typeVariable = typeVariable; 28016 } 28017 28018 @Override 28019 public OnnxType.TypeVariable typeVariable() { 28020 return typeVariable; 28021 } 28022 } 28023 28024 public enum InputParameter implements OnnxParameter { 28025 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28026 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28027 ; 28028 28029 final OnnxType type; 28030 final Quantifier quantifier; 28031 28032 InputParameter(OnnxType type, Quantifier quantifier) { 28033 this.type = type; 28034 this.quantifier = quantifier; 28035 } 28036 28037 @Override 28038 public OnnxType type() { 28039 return type; 28040 } 28041 28042 @Override 28043 public Quantifier quantifier() { 28044 return quantifier; 28045 } 28046 } 28047 28048 public enum OutputParameter implements OnnxParameter { 28049 C(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28050 ; 28051 28052 final OnnxType type; 28053 final Quantifier quantifier; 28054 28055 OutputParameter(OnnxType type, Quantifier quantifier) { 28056 this.type = type; 28057 this.quantifier = quantifier; 28058 } 28059 28060 @Override 28061 public OnnxType type() { 28062 return type; 28063 } 28064 28065 @Override 28066 public Quantifier quantifier() { 28067 return quantifier; 28068 } 28069 } 28070 28071 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 28072 NAME, 28073 List.of(Attribute.values()), 28074 List.of(TypeConstraint.values()), 28075 List.of(InputParameter.values()), 28076 List.of(OutputParameter.values()) 28077 ); 28078 28079 public Sub(ExternalizedOp def) { 28080 super(SCHEMA, def); 28081 } 28082 28083 Sub(Sub that, CopyContext cc) { 28084 super(that, cc); 28085 } 28086 28087 @Override 28088 public Sub transform(CopyContext cc, OpTransformer ot) { 28089 return new Sub(this, cc); 28090 } 28091 28092 Sub(TypeElement resultType, Value A, Value B) { 28093 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 28094 } 28095 28096 @Override 28097 public SequencedSet<OnnxParameter> onnxOutputs() { 28098 return onnxOutputs(SCHEMA); 28099 } 28100 28101 @Override 28102 public SequencedMap<OnnxParameter, Object> onnxInputs() { 28103 return onnxInputs(SCHEMA, List.of(A(), B())); 28104 } 28105 28106 public Value A() { 28107 return operands().get(0); 28108 } 28109 28110 public Value B() { 28111 return operands().get(1); 28112 } 28113 28114 } 28115 28116 public static Sub Sub(TypeElement resultType, Value A, Value B) { 28117 return new Sub(resultType, A, B); 28118 } 28119 28120 @OpFactory.OpDeclaration(Sum.NAME) 28121 public static final class Sum extends OnnxOp { 28122 public static final String NAME = "Sum"; 28123 28124 public enum Attribute implements OnnxAttribute.None { } 28125 28126 public enum TypeConstraint implements OnnxTypeConstraint { 28127 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.bfloat16())))), 28128 ; 28129 28130 final OnnxType.TypeVariable typeVariable; 28131 28132 TypeConstraint(OnnxType.TypeVariable typeVariable) { 28133 assert typeVariable.name().equals(name()); 28134 this.typeVariable = typeVariable; 28135 } 28136 28137 @Override 28138 public OnnxType.TypeVariable typeVariable() { 28139 return typeVariable; 28140 } 28141 } 28142 28143 public enum InputParameter implements OnnxParameter { 28144 data_0(TypeConstraint.T.typeVariable(), Quantifier.VARIADIC), 28145 ; 28146 28147 final OnnxType type; 28148 final Quantifier quantifier; 28149 28150 InputParameter(OnnxType type, Quantifier quantifier) { 28151 this.type = type; 28152 this.quantifier = quantifier; 28153 } 28154 28155 @Override 28156 public OnnxType type() { 28157 return type; 28158 } 28159 28160 @Override 28161 public Quantifier quantifier() { 28162 return quantifier; 28163 } 28164 } 28165 28166 public enum OutputParameter implements OnnxParameter { 28167 sum(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28168 ; 28169 28170 final OnnxType type; 28171 final Quantifier quantifier; 28172 28173 OutputParameter(OnnxType type, Quantifier quantifier) { 28174 this.type = type; 28175 this.quantifier = quantifier; 28176 } 28177 28178 @Override 28179 public OnnxType type() { 28180 return type; 28181 } 28182 28183 @Override 28184 public Quantifier quantifier() { 28185 return quantifier; 28186 } 28187 } 28188 28189 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 28190 NAME, 28191 List.of(Attribute.values()), 28192 List.of(TypeConstraint.values()), 28193 List.of(InputParameter.values()), 28194 List.of(OutputParameter.values()) 28195 ); 28196 28197 public Sum(ExternalizedOp def) { 28198 super(SCHEMA, def); 28199 } 28200 28201 Sum(Sum that, CopyContext cc) { 28202 super(that, cc); 28203 } 28204 28205 @Override 28206 public Sum transform(CopyContext cc, OpTransformer ot) { 28207 return new Sum(this, cc); 28208 } 28209 28210 Sum(TypeElement resultType, List<Value> data_0) { 28211 super(SCHEMA, resultType, Set.of(), List.of(data_0), List.of()); 28212 } 28213 28214 @Override 28215 public SequencedSet<OnnxParameter> onnxOutputs() { 28216 return onnxOutputs(SCHEMA); 28217 } 28218 28219 @Override 28220 public SequencedMap<OnnxParameter, Object> onnxInputs() { 28221 return onnxInputs(SCHEMA, List.of(data_0())); 28222 } 28223 28224 public List<Value> data_0() { 28225 return operands(); 28226 } 28227 28228 } 28229 28230 public static Sum Sum(TypeElement resultType, List<Value> data_0) { 28231 return new Sum(resultType, data_0); 28232 } 28233 28234 @OpFactory.OpDeclaration(Tan.NAME) 28235 public static final class Tan extends OnnxOp { 28236 public static final String NAME = "Tan"; 28237 28238 public enum Attribute implements OnnxAttribute.None { } 28239 28240 public enum TypeConstraint implements OnnxTypeConstraint { 28241 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 28242 ; 28243 28244 final OnnxType.TypeVariable typeVariable; 28245 28246 TypeConstraint(OnnxType.TypeVariable typeVariable) { 28247 assert typeVariable.name().equals(name()); 28248 this.typeVariable = typeVariable; 28249 } 28250 28251 @Override 28252 public OnnxType.TypeVariable typeVariable() { 28253 return typeVariable; 28254 } 28255 } 28256 28257 public enum InputParameter implements OnnxParameter { 28258 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28259 ; 28260 28261 final OnnxType type; 28262 final Quantifier quantifier; 28263 28264 InputParameter(OnnxType type, Quantifier quantifier) { 28265 this.type = type; 28266 this.quantifier = quantifier; 28267 } 28268 28269 @Override 28270 public OnnxType type() { 28271 return type; 28272 } 28273 28274 @Override 28275 public Quantifier quantifier() { 28276 return quantifier; 28277 } 28278 } 28279 28280 public enum OutputParameter implements OnnxParameter { 28281 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28282 ; 28283 28284 final OnnxType type; 28285 final Quantifier quantifier; 28286 28287 OutputParameter(OnnxType type, Quantifier quantifier) { 28288 this.type = type; 28289 this.quantifier = quantifier; 28290 } 28291 28292 @Override 28293 public OnnxType type() { 28294 return type; 28295 } 28296 28297 @Override 28298 public Quantifier quantifier() { 28299 return quantifier; 28300 } 28301 } 28302 28303 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 28304 NAME, 28305 List.of(Attribute.values()), 28306 List.of(TypeConstraint.values()), 28307 List.of(InputParameter.values()), 28308 List.of(OutputParameter.values()) 28309 ); 28310 28311 public Tan(ExternalizedOp def) { 28312 super(SCHEMA, def); 28313 } 28314 28315 Tan(Tan that, CopyContext cc) { 28316 super(that, cc); 28317 } 28318 28319 @Override 28320 public Tan transform(CopyContext cc, OpTransformer ot) { 28321 return new Tan(this, cc); 28322 } 28323 28324 Tan(TypeElement resultType, Value input) { 28325 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 28326 } 28327 28328 @Override 28329 public SequencedSet<OnnxParameter> onnxOutputs() { 28330 return onnxOutputs(SCHEMA); 28331 } 28332 28333 @Override 28334 public SequencedMap<OnnxParameter, Object> onnxInputs() { 28335 return onnxInputs(SCHEMA, List.of(input())); 28336 } 28337 28338 public Value input() { 28339 return operands().get(0); 28340 } 28341 28342 } 28343 28344 public static Tan Tan(TypeElement resultType, Value input) { 28345 return new Tan(resultType, input); 28346 } 28347 28348 @OpFactory.OpDeclaration(Tanh.NAME) 28349 public static final class Tanh extends OnnxOp { 28350 public static final String NAME = "Tanh"; 28351 28352 public enum Attribute implements OnnxAttribute.None { } 28353 28354 public enum TypeConstraint implements OnnxTypeConstraint { 28355 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 28356 ; 28357 28358 final OnnxType.TypeVariable typeVariable; 28359 28360 TypeConstraint(OnnxType.TypeVariable typeVariable) { 28361 assert typeVariable.name().equals(name()); 28362 this.typeVariable = typeVariable; 28363 } 28364 28365 @Override 28366 public OnnxType.TypeVariable typeVariable() { 28367 return typeVariable; 28368 } 28369 } 28370 28371 public enum InputParameter implements OnnxParameter { 28372 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28373 ; 28374 28375 final OnnxType type; 28376 final Quantifier quantifier; 28377 28378 InputParameter(OnnxType type, Quantifier quantifier) { 28379 this.type = type; 28380 this.quantifier = quantifier; 28381 } 28382 28383 @Override 28384 public OnnxType type() { 28385 return type; 28386 } 28387 28388 @Override 28389 public Quantifier quantifier() { 28390 return quantifier; 28391 } 28392 } 28393 28394 public enum OutputParameter implements OnnxParameter { 28395 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28396 ; 28397 28398 final OnnxType type; 28399 final Quantifier quantifier; 28400 28401 OutputParameter(OnnxType type, Quantifier quantifier) { 28402 this.type = type; 28403 this.quantifier = quantifier; 28404 } 28405 28406 @Override 28407 public OnnxType type() { 28408 return type; 28409 } 28410 28411 @Override 28412 public Quantifier quantifier() { 28413 return quantifier; 28414 } 28415 } 28416 28417 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 28418 NAME, 28419 List.of(Attribute.values()), 28420 List.of(TypeConstraint.values()), 28421 List.of(InputParameter.values()), 28422 List.of(OutputParameter.values()) 28423 ); 28424 28425 public Tanh(ExternalizedOp def) { 28426 super(SCHEMA, def); 28427 } 28428 28429 Tanh(Tanh that, CopyContext cc) { 28430 super(that, cc); 28431 } 28432 28433 @Override 28434 public Tanh transform(CopyContext cc, OpTransformer ot) { 28435 return new Tanh(this, cc); 28436 } 28437 28438 Tanh(TypeElement resultType, Value input) { 28439 super(SCHEMA, resultType, Set.of(), List.of(input), List.of()); 28440 } 28441 28442 @Override 28443 public SequencedSet<OnnxParameter> onnxOutputs() { 28444 return onnxOutputs(SCHEMA); 28445 } 28446 28447 @Override 28448 public SequencedMap<OnnxParameter, Object> onnxInputs() { 28449 return onnxInputs(SCHEMA, List.of(input())); 28450 } 28451 28452 public Value input() { 28453 return operands().get(0); 28454 } 28455 28456 } 28457 28458 public static Tanh Tanh(TypeElement resultType, Value input) { 28459 return new Tanh(resultType, input); 28460 } 28461 28462 @OpFactory.OpDeclaration(TfIdfVectorizer.NAME) 28463 public static final class TfIdfVectorizer extends OnnxOp { 28464 public static final String NAME = "TfIdfVectorizer"; 28465 28466 public enum Attribute implements OnnxAttribute { 28467 ngram_counts(long[].class, false, null), 28468 min_gram_length(Long.class, false, null), 28469 pool_strings(String[].class, true, null), 28470 mode(String.class, false, null), 28471 max_gram_length(Long.class, false, null), 28472 max_skip_count(Long.class, false, null), 28473 pool_int64s(long[].class, true, null), 28474 weights(float[].class, true, null), 28475 ngram_indexes(long[].class, false, null), 28476 ; 28477 28478 final Class<?> t; 28479 final boolean optional; 28480 final Object defaultValue; 28481 28482 Attribute(Class<?> type, boolean optional, Object defaultValue) { 28483 this.t = type; 28484 this.optional = optional; 28485 this.defaultValue = defaultValue; 28486 assert optional || defaultValue == null; 28487 } 28488 28489 public Class<?> type() { 28490 return t; 28491 } 28492 28493 public boolean isOptional() { 28494 return optional; 28495 } 28496 28497 public Object defaultValue() { 28498 return defaultValue; 28499 } 28500 } 28501 28502 public enum TypeConstraint implements OnnxTypeConstraint { 28503 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int32()), OnnxType.tensor(OnnxType.int64())))), 28504 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32())))), 28505 ; 28506 28507 final OnnxType.TypeVariable typeVariable; 28508 28509 TypeConstraint(OnnxType.TypeVariable typeVariable) { 28510 assert typeVariable.name().equals(name()); 28511 this.typeVariable = typeVariable; 28512 } 28513 28514 @Override 28515 public OnnxType.TypeVariable typeVariable() { 28516 return typeVariable; 28517 } 28518 } 28519 28520 public enum InputParameter implements OnnxParameter { 28521 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28522 ; 28523 28524 final OnnxType type; 28525 final Quantifier quantifier; 28526 28527 InputParameter(OnnxType type, Quantifier quantifier) { 28528 this.type = type; 28529 this.quantifier = quantifier; 28530 } 28531 28532 @Override 28533 public OnnxType type() { 28534 return type; 28535 } 28536 28537 @Override 28538 public Quantifier quantifier() { 28539 return quantifier; 28540 } 28541 } 28542 28543 public enum OutputParameter implements OnnxParameter { 28544 Y(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 28545 ; 28546 28547 final OnnxType type; 28548 final Quantifier quantifier; 28549 28550 OutputParameter(OnnxType type, Quantifier quantifier) { 28551 this.type = type; 28552 this.quantifier = quantifier; 28553 } 28554 28555 @Override 28556 public OnnxType type() { 28557 return type; 28558 } 28559 28560 @Override 28561 public Quantifier quantifier() { 28562 return quantifier; 28563 } 28564 } 28565 28566 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 28567 NAME, 28568 List.of(Attribute.values()), 28569 List.of(TypeConstraint.values()), 28570 List.of(InputParameter.values()), 28571 List.of(OutputParameter.values()) 28572 ); 28573 28574 public TfIdfVectorizer(ExternalizedOp def) { 28575 super(SCHEMA, def); 28576 } 28577 28578 TfIdfVectorizer(TfIdfVectorizer that, CopyContext cc) { 28579 super(that, cc); 28580 } 28581 28582 @Override 28583 public TfIdfVectorizer transform(CopyContext cc, OpTransformer ot) { 28584 return new TfIdfVectorizer(this, cc); 28585 } 28586 28587 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) { 28588 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)); 28589 } 28590 28591 @Override 28592 public SequencedSet<OnnxParameter> onnxOutputs() { 28593 return onnxOutputs(SCHEMA); 28594 } 28595 28596 @Override 28597 public SequencedMap<OnnxParameter, Object> onnxInputs() { 28598 return onnxInputs(SCHEMA, List.of(X())); 28599 } 28600 28601 public Value X() { 28602 return operands().get(0); 28603 } 28604 28605 public long[] ngram_counts() { 28606 long[] ngram_counts = Attribute.ngram_counts.access(long[].class, onnxAttributes); 28607 return ngram_counts.clone(); 28608 } 28609 28610 public long min_gram_length() { 28611 long min_gram_length = Attribute.min_gram_length.access(Long.class, onnxAttributes); 28612 return min_gram_length; 28613 } 28614 28615 public java.util.Optional<String[]> pool_strings() { 28616 String[] pool_strings = Attribute.pool_strings.access(String[].class, onnxAttributes); 28617 return java.util.Optional.ofNullable(pool_strings).map(String[]::clone); 28618 } 28619 28620 public String mode() { 28621 String mode = Attribute.mode.access(String.class, onnxAttributes); 28622 return mode; 28623 } 28624 28625 public long max_gram_length() { 28626 long max_gram_length = Attribute.max_gram_length.access(Long.class, onnxAttributes); 28627 return max_gram_length; 28628 } 28629 28630 public long max_skip_count() { 28631 long max_skip_count = Attribute.max_skip_count.access(Long.class, onnxAttributes); 28632 return max_skip_count; 28633 } 28634 28635 public java.util.Optional<long[]> pool_int64s() { 28636 long[] pool_int64s = Attribute.pool_int64s.access(long[].class, onnxAttributes); 28637 return java.util.Optional.ofNullable(pool_int64s).map(long[]::clone); 28638 } 28639 28640 public java.util.Optional<float[]> weights() { 28641 float[] weights = Attribute.weights.access(float[].class, onnxAttributes); 28642 return java.util.Optional.ofNullable(weights).map(float[]::clone); 28643 } 28644 28645 public long[] ngram_indexes() { 28646 long[] ngram_indexes = Attribute.ngram_indexes.access(long[].class, onnxAttributes); 28647 return ngram_indexes.clone(); 28648 } 28649 28650 } 28651 28652 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) { 28653 return new TfIdfVectorizer(resultType, X, ngram_counts, min_gram_length, pool_strings, mode, max_gram_length, max_skip_count, pool_int64s, weights, ngram_indexes); 28654 } 28655 28656 @OpFactory.OpDeclaration(ThresholdedRelu.NAME) 28657 public static final class ThresholdedRelu extends OnnxOp { 28658 public static final String NAME = "ThresholdedRelu"; 28659 28660 public enum Attribute implements OnnxAttribute { 28661 alpha(Float.class, true, 1.0f), 28662 ; 28663 28664 final Class<?> t; 28665 final boolean optional; 28666 final Object defaultValue; 28667 28668 Attribute(Class<?> type, boolean optional, Object defaultValue) { 28669 this.t = type; 28670 this.optional = optional; 28671 this.defaultValue = defaultValue; 28672 assert optional || defaultValue == null; 28673 } 28674 28675 public Class<?> type() { 28676 return t; 28677 } 28678 28679 public boolean isOptional() { 28680 return optional; 28681 } 28682 28683 public Object defaultValue() { 28684 return defaultValue; 28685 } 28686 } 28687 28688 public enum TypeConstraint implements OnnxTypeConstraint { 28689 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bfloat16()), OnnxType.tensor(OnnxType.float16()), OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64())))), 28690 ; 28691 28692 final OnnxType.TypeVariable typeVariable; 28693 28694 TypeConstraint(OnnxType.TypeVariable typeVariable) { 28695 assert typeVariable.name().equals(name()); 28696 this.typeVariable = typeVariable; 28697 } 28698 28699 @Override 28700 public OnnxType.TypeVariable typeVariable() { 28701 return typeVariable; 28702 } 28703 } 28704 28705 public enum InputParameter implements OnnxParameter { 28706 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28707 ; 28708 28709 final OnnxType type; 28710 final Quantifier quantifier; 28711 28712 InputParameter(OnnxType type, Quantifier quantifier) { 28713 this.type = type; 28714 this.quantifier = quantifier; 28715 } 28716 28717 @Override 28718 public OnnxType type() { 28719 return type; 28720 } 28721 28722 @Override 28723 public Quantifier quantifier() { 28724 return quantifier; 28725 } 28726 } 28727 28728 public enum OutputParameter implements OnnxParameter { 28729 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28730 ; 28731 28732 final OnnxType type; 28733 final Quantifier quantifier; 28734 28735 OutputParameter(OnnxType type, Quantifier quantifier) { 28736 this.type = type; 28737 this.quantifier = quantifier; 28738 } 28739 28740 @Override 28741 public OnnxType type() { 28742 return type; 28743 } 28744 28745 @Override 28746 public Quantifier quantifier() { 28747 return quantifier; 28748 } 28749 } 28750 28751 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 28752 NAME, 28753 List.of(Attribute.values()), 28754 List.of(TypeConstraint.values()), 28755 List.of(InputParameter.values()), 28756 List.of(OutputParameter.values()) 28757 ); 28758 28759 public ThresholdedRelu(ExternalizedOp def) { 28760 super(SCHEMA, def); 28761 } 28762 28763 ThresholdedRelu(ThresholdedRelu that, CopyContext cc) { 28764 super(that, cc); 28765 } 28766 28767 @Override 28768 public ThresholdedRelu transform(CopyContext cc, OpTransformer ot) { 28769 return new ThresholdedRelu(this, cc); 28770 } 28771 28772 ThresholdedRelu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) { 28773 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(alpha)); 28774 } 28775 28776 @Override 28777 public SequencedSet<OnnxParameter> onnxOutputs() { 28778 return onnxOutputs(SCHEMA); 28779 } 28780 28781 @Override 28782 public SequencedMap<OnnxParameter, Object> onnxInputs() { 28783 return onnxInputs(SCHEMA, List.of(X())); 28784 } 28785 28786 public Value X() { 28787 return operands().get(0); 28788 } 28789 28790 public java.util.Optional<Float> alpha() { 28791 Float alpha = Attribute.alpha.access(Float.class, onnxAttributes); 28792 return java.util.Optional.ofNullable(alpha); 28793 } 28794 28795 } 28796 28797 public static ThresholdedRelu ThresholdedRelu(TypeElement resultType, Value X, java.util.Optional<Float> alpha) { 28798 return new ThresholdedRelu(resultType, X, alpha); 28799 } 28800 28801 @OpFactory.OpDeclaration(Tile.NAME) 28802 public static final class Tile extends OnnxOp { 28803 public static final String NAME = "Tile"; 28804 28805 public enum Attribute implements OnnxAttribute.None { } 28806 28807 public enum TypeConstraint implements OnnxTypeConstraint { 28808 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())))), 28809 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.int64())))), 28810 ; 28811 28812 final OnnxType.TypeVariable typeVariable; 28813 28814 TypeConstraint(OnnxType.TypeVariable typeVariable) { 28815 assert typeVariable.name().equals(name()); 28816 this.typeVariable = typeVariable; 28817 } 28818 28819 @Override 28820 public OnnxType.TypeVariable typeVariable() { 28821 return typeVariable; 28822 } 28823 } 28824 28825 public enum InputParameter implements OnnxParameter { 28826 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28827 repeats(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 28828 ; 28829 28830 final OnnxType type; 28831 final Quantifier quantifier; 28832 28833 InputParameter(OnnxType type, Quantifier quantifier) { 28834 this.type = type; 28835 this.quantifier = quantifier; 28836 } 28837 28838 @Override 28839 public OnnxType type() { 28840 return type; 28841 } 28842 28843 @Override 28844 public Quantifier quantifier() { 28845 return quantifier; 28846 } 28847 } 28848 28849 public enum OutputParameter implements OnnxParameter { 28850 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28851 ; 28852 28853 final OnnxType type; 28854 final Quantifier quantifier; 28855 28856 OutputParameter(OnnxType type, Quantifier quantifier) { 28857 this.type = type; 28858 this.quantifier = quantifier; 28859 } 28860 28861 @Override 28862 public OnnxType type() { 28863 return type; 28864 } 28865 28866 @Override 28867 public Quantifier quantifier() { 28868 return quantifier; 28869 } 28870 } 28871 28872 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 28873 NAME, 28874 List.of(Attribute.values()), 28875 List.of(TypeConstraint.values()), 28876 List.of(InputParameter.values()), 28877 List.of(OutputParameter.values()) 28878 ); 28879 28880 public Tile(ExternalizedOp def) { 28881 super(SCHEMA, def); 28882 } 28883 28884 Tile(Tile that, CopyContext cc) { 28885 super(that, cc); 28886 } 28887 28888 @Override 28889 public Tile transform(CopyContext cc, OpTransformer ot) { 28890 return new Tile(this, cc); 28891 } 28892 28893 Tile(TypeElement resultType, Value input, Value repeats) { 28894 super(SCHEMA, resultType, Set.of(), List.of(input, repeats), List.of()); 28895 } 28896 28897 @Override 28898 public SequencedSet<OnnxParameter> onnxOutputs() { 28899 return onnxOutputs(SCHEMA); 28900 } 28901 28902 @Override 28903 public SequencedMap<OnnxParameter, Object> onnxInputs() { 28904 return onnxInputs(SCHEMA, List.of(input(), repeats())); 28905 } 28906 28907 public Value input() { 28908 return operands().get(0); 28909 } 28910 28911 public Value repeats() { 28912 return operands().get(1); 28913 } 28914 28915 } 28916 28917 public static Tile Tile(TypeElement resultType, Value input, Value repeats) { 28918 return new Tile(resultType, input, repeats); 28919 } 28920 28921 @OpFactory.OpDeclaration(TopK.NAME) 28922 public static final class TopK extends OnnxOp { 28923 public static final String NAME = "TopK"; 28924 28925 public enum Attribute implements OnnxAttribute { 28926 largest(Long.class, true, 1), 28927 sorted(Long.class, true, 1), 28928 axis(Long.class, true, -1), 28929 ; 28930 28931 final Class<?> t; 28932 final boolean optional; 28933 final Object defaultValue; 28934 28935 Attribute(Class<?> type, boolean optional, Object defaultValue) { 28936 this.t = type; 28937 this.optional = optional; 28938 this.defaultValue = defaultValue; 28939 assert optional || defaultValue == null; 28940 } 28941 28942 public Class<?> type() { 28943 return t; 28944 } 28945 28946 public boolean isOptional() { 28947 return optional; 28948 } 28949 28950 public Object defaultValue() { 28951 return defaultValue; 28952 } 28953 } 28954 28955 public enum TypeConstraint implements OnnxTypeConstraint { 28956 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())))), 28957 I(new OnnxType.TypeVariable("I", List.of(OnnxType.tensor(OnnxType.int64())))), 28958 ; 28959 28960 final OnnxType.TypeVariable typeVariable; 28961 28962 TypeConstraint(OnnxType.TypeVariable typeVariable) { 28963 assert typeVariable.name().equals(name()); 28964 this.typeVariable = typeVariable; 28965 } 28966 28967 @Override 28968 public OnnxType.TypeVariable typeVariable() { 28969 return typeVariable; 28970 } 28971 } 28972 28973 public enum InputParameter implements OnnxParameter { 28974 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28975 K(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 28976 ; 28977 28978 final OnnxType type; 28979 final Quantifier quantifier; 28980 28981 InputParameter(OnnxType type, Quantifier quantifier) { 28982 this.type = type; 28983 this.quantifier = quantifier; 28984 } 28985 28986 @Override 28987 public OnnxType type() { 28988 return type; 28989 } 28990 28991 @Override 28992 public Quantifier quantifier() { 28993 return quantifier; 28994 } 28995 } 28996 28997 public enum OutputParameter implements OnnxParameter { 28998 Values(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 28999 Indices(TypeConstraint.I.typeVariable(), Quantifier.REQUIRED), 29000 ; 29001 29002 final OnnxType type; 29003 final Quantifier quantifier; 29004 29005 OutputParameter(OnnxType type, Quantifier quantifier) { 29006 this.type = type; 29007 this.quantifier = quantifier; 29008 } 29009 29010 @Override 29011 public OnnxType type() { 29012 return type; 29013 } 29014 29015 @Override 29016 public Quantifier quantifier() { 29017 return quantifier; 29018 } 29019 } 29020 29021 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 29022 NAME, 29023 List.of(Attribute.values()), 29024 List.of(TypeConstraint.values()), 29025 List.of(InputParameter.values()), 29026 List.of(OutputParameter.values()) 29027 ); 29028 29029 public TopK(ExternalizedOp def) { 29030 super(SCHEMA, def); 29031 } 29032 29033 TopK(TopK that, CopyContext cc) { 29034 super(that, cc); 29035 } 29036 29037 @Override 29038 public TopK transform(CopyContext cc, OpTransformer ot) { 29039 return new TopK(this, cc); 29040 } 29041 29042 TopK(TypeElement resultType, Value X, Value K, java.util.Optional<Long> largest, java.util.Optional<Long> sorted, java.util.Optional<Long> axis) { 29043 super(SCHEMA, resultType, Set.of(), List.of(X, K), List.of(largest, sorted, axis)); 29044 } 29045 29046 @Override 29047 public SequencedSet<OnnxParameter> onnxOutputs() { 29048 return onnxOutputs(SCHEMA); 29049 } 29050 29051 @Override 29052 public SequencedMap<OnnxParameter, Object> onnxInputs() { 29053 return onnxInputs(SCHEMA, List.of(X(), K())); 29054 } 29055 29056 public Value X() { 29057 return operands().get(0); 29058 } 29059 29060 public Value K() { 29061 return operands().get(1); 29062 } 29063 29064 public java.util.Optional<Long> largest() { 29065 Long largest = Attribute.largest.access(Long.class, onnxAttributes); 29066 return java.util.Optional.ofNullable(largest); 29067 } 29068 29069 public java.util.Optional<Long> sorted() { 29070 Long sorted = Attribute.sorted.access(Long.class, onnxAttributes); 29071 return java.util.Optional.ofNullable(sorted); 29072 } 29073 29074 public java.util.Optional<Long> axis() { 29075 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 29076 return java.util.Optional.ofNullable(axis); 29077 } 29078 29079 } 29080 29081 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) { 29082 return new TopK(resultType, X, K, largest, sorted, axis); 29083 } 29084 29085 @OpFactory.OpDeclaration(Transpose.NAME) 29086 public static final class Transpose extends OnnxOp { 29087 public static final String NAME = "Transpose"; 29088 29089 public enum Attribute implements OnnxAttribute { 29090 perm(long[].class, true, null), 29091 ; 29092 29093 final Class<?> t; 29094 final boolean optional; 29095 final Object defaultValue; 29096 29097 Attribute(Class<?> type, boolean optional, Object defaultValue) { 29098 this.t = type; 29099 this.optional = optional; 29100 this.defaultValue = defaultValue; 29101 assert optional || defaultValue == null; 29102 } 29103 29104 public Class<?> type() { 29105 return t; 29106 } 29107 29108 public boolean isOptional() { 29109 return optional; 29110 } 29111 29112 public Object defaultValue() { 29113 return defaultValue; 29114 } 29115 } 29116 29117 public enum TypeConstraint implements OnnxTypeConstraint { 29118 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())))), 29119 ; 29120 29121 final OnnxType.TypeVariable typeVariable; 29122 29123 TypeConstraint(OnnxType.TypeVariable typeVariable) { 29124 assert typeVariable.name().equals(name()); 29125 this.typeVariable = typeVariable; 29126 } 29127 29128 @Override 29129 public OnnxType.TypeVariable typeVariable() { 29130 return typeVariable; 29131 } 29132 } 29133 29134 public enum InputParameter implements OnnxParameter { 29135 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 29136 ; 29137 29138 final OnnxType type; 29139 final Quantifier quantifier; 29140 29141 InputParameter(OnnxType type, Quantifier quantifier) { 29142 this.type = type; 29143 this.quantifier = quantifier; 29144 } 29145 29146 @Override 29147 public OnnxType type() { 29148 return type; 29149 } 29150 29151 @Override 29152 public Quantifier quantifier() { 29153 return quantifier; 29154 } 29155 } 29156 29157 public enum OutputParameter implements OnnxParameter { 29158 transposed(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 29159 ; 29160 29161 final OnnxType type; 29162 final Quantifier quantifier; 29163 29164 OutputParameter(OnnxType type, Quantifier quantifier) { 29165 this.type = type; 29166 this.quantifier = quantifier; 29167 } 29168 29169 @Override 29170 public OnnxType type() { 29171 return type; 29172 } 29173 29174 @Override 29175 public Quantifier quantifier() { 29176 return quantifier; 29177 } 29178 } 29179 29180 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 29181 NAME, 29182 List.of(Attribute.values()), 29183 List.of(TypeConstraint.values()), 29184 List.of(InputParameter.values()), 29185 List.of(OutputParameter.values()) 29186 ); 29187 29188 public Transpose(ExternalizedOp def) { 29189 super(SCHEMA, def); 29190 } 29191 29192 Transpose(Transpose that, CopyContext cc) { 29193 super(that, cc); 29194 } 29195 29196 @Override 29197 public Transpose transform(CopyContext cc, OpTransformer ot) { 29198 return new Transpose(this, cc); 29199 } 29200 29201 Transpose(TypeElement resultType, Value data, java.util.Optional<long[]> perm) { 29202 super(SCHEMA, resultType, Set.of(), List.of(data), List.of(perm)); 29203 } 29204 29205 @Override 29206 public SequencedSet<OnnxParameter> onnxOutputs() { 29207 return onnxOutputs(SCHEMA); 29208 } 29209 29210 @Override 29211 public SequencedMap<OnnxParameter, Object> onnxInputs() { 29212 return onnxInputs(SCHEMA, List.of(data())); 29213 } 29214 29215 public Value data() { 29216 return operands().get(0); 29217 } 29218 29219 public java.util.Optional<long[]> perm() { 29220 long[] perm = Attribute.perm.access(long[].class, onnxAttributes); 29221 return java.util.Optional.ofNullable(perm).map(long[]::clone); 29222 } 29223 29224 } 29225 29226 public static Transpose Transpose(TypeElement resultType, Value data, java.util.Optional<long[]> perm) { 29227 return new Transpose(resultType, data, perm); 29228 } 29229 29230 @OpFactory.OpDeclaration(TreeEnsemble.NAME) 29231 public static final class TreeEnsemble extends OnnxOp { 29232 public static final String NAME = "TreeEnsemble"; 29233 29234 public enum Attribute implements OnnxAttribute { 29235 aggregate_function(Long.class, true, 1), 29236 nodes_hitrates(Tensor.class, true, null), 29237 nodes_featureids(long[].class, false, null), 29238 nodes_falseleafs(long[].class, false, null), 29239 post_transform(Long.class, true, 0), 29240 nodes_trueleafs(long[].class, false, null), 29241 nodes_modes(Tensor.class, false, null), 29242 nodes_falsenodeids(long[].class, false, null), 29243 nodes_truenodeids(long[].class, false, null), 29244 leaf_weights(Tensor.class, false, null), 29245 leaf_targetids(long[].class, false, null), 29246 tree_roots(long[].class, false, null), 29247 n_targets(Long.class, true, null), 29248 nodes_missing_value_tracks_true(long[].class, true, null), 29249 membership_values(Tensor.class, true, null), 29250 nodes_splits(Tensor.class, false, null), 29251 ; 29252 29253 final Class<?> t; 29254 final boolean optional; 29255 final Object defaultValue; 29256 29257 Attribute(Class<?> type, boolean optional, Object defaultValue) { 29258 this.t = type; 29259 this.optional = optional; 29260 this.defaultValue = defaultValue; 29261 assert optional || defaultValue == null; 29262 } 29263 29264 public Class<?> type() { 29265 return t; 29266 } 29267 29268 public boolean isOptional() { 29269 return optional; 29270 } 29271 29272 public Object defaultValue() { 29273 return defaultValue; 29274 } 29275 } 29276 29277 public enum TypeConstraint implements OnnxTypeConstraint { 29278 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.float16())))), 29279 ; 29280 29281 final OnnxType.TypeVariable typeVariable; 29282 29283 TypeConstraint(OnnxType.TypeVariable typeVariable) { 29284 assert typeVariable.name().equals(name()); 29285 this.typeVariable = typeVariable; 29286 } 29287 29288 @Override 29289 public OnnxType.TypeVariable typeVariable() { 29290 return typeVariable; 29291 } 29292 } 29293 29294 public enum InputParameter implements OnnxParameter { 29295 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 29296 ; 29297 29298 final OnnxType type; 29299 final Quantifier quantifier; 29300 29301 InputParameter(OnnxType type, Quantifier quantifier) { 29302 this.type = type; 29303 this.quantifier = quantifier; 29304 } 29305 29306 @Override 29307 public OnnxType type() { 29308 return type; 29309 } 29310 29311 @Override 29312 public Quantifier quantifier() { 29313 return quantifier; 29314 } 29315 } 29316 29317 public enum OutputParameter implements OnnxParameter { 29318 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 29319 ; 29320 29321 final OnnxType type; 29322 final Quantifier quantifier; 29323 29324 OutputParameter(OnnxType type, Quantifier quantifier) { 29325 this.type = type; 29326 this.quantifier = quantifier; 29327 } 29328 29329 @Override 29330 public OnnxType type() { 29331 return type; 29332 } 29333 29334 @Override 29335 public Quantifier quantifier() { 29336 return quantifier; 29337 } 29338 } 29339 29340 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 29341 NAME, 29342 List.of(Attribute.values()), 29343 List.of(TypeConstraint.values()), 29344 List.of(InputParameter.values()), 29345 List.of(OutputParameter.values()) 29346 ); 29347 29348 public TreeEnsemble(ExternalizedOp def) { 29349 super(SCHEMA, def); 29350 } 29351 29352 TreeEnsemble(TreeEnsemble that, CopyContext cc) { 29353 super(that, cc); 29354 } 29355 29356 @Override 29357 public TreeEnsemble transform(CopyContext cc, OpTransformer ot) { 29358 return new TreeEnsemble(this, cc); 29359 } 29360 29361 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) { 29362 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)); 29363 } 29364 29365 @Override 29366 public SequencedSet<OnnxParameter> onnxOutputs() { 29367 return onnxOutputs(SCHEMA); 29368 } 29369 29370 @Override 29371 public SequencedMap<OnnxParameter, Object> onnxInputs() { 29372 return onnxInputs(SCHEMA, List.of(X())); 29373 } 29374 29375 public Value X() { 29376 return operands().get(0); 29377 } 29378 29379 public java.util.Optional<Long> aggregate_function() { 29380 Long aggregate_function = Attribute.aggregate_function.access(Long.class, onnxAttributes); 29381 return java.util.Optional.ofNullable(aggregate_function); 29382 } 29383 29384 public java.util.Optional<Tensor> nodes_hitrates() { 29385 Tensor nodes_hitrates = Attribute.nodes_hitrates.access(Tensor.class, onnxAttributes); 29386 return java.util.Optional.ofNullable(nodes_hitrates); 29387 } 29388 29389 public long[] nodes_featureids() { 29390 long[] nodes_featureids = Attribute.nodes_featureids.access(long[].class, onnxAttributes); 29391 return nodes_featureids.clone(); 29392 } 29393 29394 public long[] nodes_falseleafs() { 29395 long[] nodes_falseleafs = Attribute.nodes_falseleafs.access(long[].class, onnxAttributes); 29396 return nodes_falseleafs.clone(); 29397 } 29398 29399 public java.util.Optional<Long> post_transform() { 29400 Long post_transform = Attribute.post_transform.access(Long.class, onnxAttributes); 29401 return java.util.Optional.ofNullable(post_transform); 29402 } 29403 29404 public long[] nodes_trueleafs() { 29405 long[] nodes_trueleafs = Attribute.nodes_trueleafs.access(long[].class, onnxAttributes); 29406 return nodes_trueleafs.clone(); 29407 } 29408 29409 public Tensor nodes_modes() { 29410 Tensor nodes_modes = Attribute.nodes_modes.access(Tensor.class, onnxAttributes); 29411 return nodes_modes; 29412 } 29413 29414 public long[] nodes_falsenodeids() { 29415 long[] nodes_falsenodeids = Attribute.nodes_falsenodeids.access(long[].class, onnxAttributes); 29416 return nodes_falsenodeids.clone(); 29417 } 29418 29419 public long[] nodes_truenodeids() { 29420 long[] nodes_truenodeids = Attribute.nodes_truenodeids.access(long[].class, onnxAttributes); 29421 return nodes_truenodeids.clone(); 29422 } 29423 29424 public Tensor leaf_weights() { 29425 Tensor leaf_weights = Attribute.leaf_weights.access(Tensor.class, onnxAttributes); 29426 return leaf_weights; 29427 } 29428 29429 public long[] leaf_targetids() { 29430 long[] leaf_targetids = Attribute.leaf_targetids.access(long[].class, onnxAttributes); 29431 return leaf_targetids.clone(); 29432 } 29433 29434 public long[] tree_roots() { 29435 long[] tree_roots = Attribute.tree_roots.access(long[].class, onnxAttributes); 29436 return tree_roots.clone(); 29437 } 29438 29439 public java.util.Optional<Long> n_targets() { 29440 Long n_targets = Attribute.n_targets.access(Long.class, onnxAttributes); 29441 return java.util.Optional.ofNullable(n_targets); 29442 } 29443 29444 public java.util.Optional<long[]> nodes_missing_value_tracks_true() { 29445 long[] nodes_missing_value_tracks_true = Attribute.nodes_missing_value_tracks_true.access(long[].class, onnxAttributes); 29446 return java.util.Optional.ofNullable(nodes_missing_value_tracks_true).map(long[]::clone); 29447 } 29448 29449 public java.util.Optional<Tensor> membership_values() { 29450 Tensor membership_values = Attribute.membership_values.access(Tensor.class, onnxAttributes); 29451 return java.util.Optional.ofNullable(membership_values); 29452 } 29453 29454 public Tensor nodes_splits() { 29455 Tensor nodes_splits = Attribute.nodes_splits.access(Tensor.class, onnxAttributes); 29456 return nodes_splits; 29457 } 29458 29459 } 29460 29461 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) { 29462 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); 29463 } 29464 29465 @OpFactory.OpDeclaration(TreeEnsembleClassifier.NAME) 29466 public static final class TreeEnsembleClassifier extends OnnxOp { 29467 public static final String NAME = "TreeEnsembleClassifier"; 29468 29469 public enum Attribute implements OnnxAttribute { 29470 classlabels_int64s(long[].class, true, null), 29471 class_ids(long[].class, true, null), 29472 nodes_hitrates(float[].class, true, null), 29473 nodes_featureids(long[].class, true, null), 29474 nodes_treeids(long[].class, true, null), 29475 class_weights_as_tensor(Tensor.class, true, null), 29476 post_transform(String.class, true, "NONE"), 29477 nodes_modes(String[].class, true, null), 29478 nodes_falsenodeids(long[].class, true, null), 29479 classlabels_strings(String[].class, true, null), 29480 nodes_truenodeids(long[].class, true, null), 29481 nodes_nodeids(long[].class, true, null), 29482 nodes_hitrates_as_tensor(Tensor.class, true, null), 29483 class_weights(float[].class, true, null), 29484 base_values_as_tensor(Tensor.class, true, null), 29485 nodes_missing_value_tracks_true(long[].class, true, null), 29486 class_nodeids(long[].class, true, null), 29487 class_treeids(long[].class, true, null), 29488 base_values(float[].class, true, null), 29489 nodes_values(float[].class, true, null), 29490 nodes_values_as_tensor(Tensor.class, true, null), 29491 ; 29492 29493 final Class<?> t; 29494 final boolean optional; 29495 final Object defaultValue; 29496 29497 Attribute(Class<?> type, boolean optional, Object defaultValue) { 29498 this.t = type; 29499 this.optional = optional; 29500 this.defaultValue = defaultValue; 29501 assert optional || defaultValue == null; 29502 } 29503 29504 public Class<?> type() { 29505 return t; 29506 } 29507 29508 public boolean isOptional() { 29509 return optional; 29510 } 29511 29512 public Object defaultValue() { 29513 return defaultValue; 29514 } 29515 } 29516 29517 public enum TypeConstraint implements OnnxTypeConstraint { 29518 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 29519 T2(new OnnxType.TypeVariable("T2", List.of(OnnxType.tensor(OnnxType.string()), OnnxType.tensor(OnnxType.int64())))), 29520 ; 29521 29522 final OnnxType.TypeVariable typeVariable; 29523 29524 TypeConstraint(OnnxType.TypeVariable typeVariable) { 29525 assert typeVariable.name().equals(name()); 29526 this.typeVariable = typeVariable; 29527 } 29528 29529 @Override 29530 public OnnxType.TypeVariable typeVariable() { 29531 return typeVariable; 29532 } 29533 } 29534 29535 public enum InputParameter implements OnnxParameter { 29536 X(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 29537 ; 29538 29539 final OnnxType type; 29540 final Quantifier quantifier; 29541 29542 InputParameter(OnnxType type, Quantifier quantifier) { 29543 this.type = type; 29544 this.quantifier = quantifier; 29545 } 29546 29547 @Override 29548 public OnnxType type() { 29549 return type; 29550 } 29551 29552 @Override 29553 public Quantifier quantifier() { 29554 return quantifier; 29555 } 29556 } 29557 29558 public enum OutputParameter implements OnnxParameter { 29559 Y(TypeConstraint.T2.typeVariable(), Quantifier.REQUIRED), 29560 Z(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 29561 ; 29562 29563 final OnnxType type; 29564 final Quantifier quantifier; 29565 29566 OutputParameter(OnnxType type, Quantifier quantifier) { 29567 this.type = type; 29568 this.quantifier = quantifier; 29569 } 29570 29571 @Override 29572 public OnnxType type() { 29573 return type; 29574 } 29575 29576 @Override 29577 public Quantifier quantifier() { 29578 return quantifier; 29579 } 29580 } 29581 29582 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 29583 NAME, 29584 List.of(Attribute.values()), 29585 List.of(TypeConstraint.values()), 29586 List.of(InputParameter.values()), 29587 List.of(OutputParameter.values()) 29588 ); 29589 29590 public TreeEnsembleClassifier(ExternalizedOp def) { 29591 super(SCHEMA, def); 29592 } 29593 29594 TreeEnsembleClassifier(TreeEnsembleClassifier that, CopyContext cc) { 29595 super(that, cc); 29596 } 29597 29598 @Override 29599 public TreeEnsembleClassifier transform(CopyContext cc, OpTransformer ot) { 29600 return new TreeEnsembleClassifier(this, cc); 29601 } 29602 29603 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) { 29604 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)); 29605 } 29606 29607 @Override 29608 public SequencedSet<OnnxParameter> onnxOutputs() { 29609 return onnxOutputs(SCHEMA); 29610 } 29611 29612 @Override 29613 public SequencedMap<OnnxParameter, Object> onnxInputs() { 29614 return onnxInputs(SCHEMA, List.of(X())); 29615 } 29616 29617 public Value X() { 29618 return operands().get(0); 29619 } 29620 29621 public java.util.Optional<long[]> classlabels_int64s() { 29622 long[] classlabels_int64s = Attribute.classlabels_int64s.access(long[].class, onnxAttributes); 29623 return java.util.Optional.ofNullable(classlabels_int64s).map(long[]::clone); 29624 } 29625 29626 public java.util.Optional<long[]> class_ids() { 29627 long[] class_ids = Attribute.class_ids.access(long[].class, onnxAttributes); 29628 return java.util.Optional.ofNullable(class_ids).map(long[]::clone); 29629 } 29630 29631 public java.util.Optional<float[]> nodes_hitrates() { 29632 float[] nodes_hitrates = Attribute.nodes_hitrates.access(float[].class, onnxAttributes); 29633 return java.util.Optional.ofNullable(nodes_hitrates).map(float[]::clone); 29634 } 29635 29636 public java.util.Optional<long[]> nodes_featureids() { 29637 long[] nodes_featureids = Attribute.nodes_featureids.access(long[].class, onnxAttributes); 29638 return java.util.Optional.ofNullable(nodes_featureids).map(long[]::clone); 29639 } 29640 29641 public java.util.Optional<long[]> nodes_treeids() { 29642 long[] nodes_treeids = Attribute.nodes_treeids.access(long[].class, onnxAttributes); 29643 return java.util.Optional.ofNullable(nodes_treeids).map(long[]::clone); 29644 } 29645 29646 public java.util.Optional<Tensor> class_weights_as_tensor() { 29647 Tensor class_weights_as_tensor = Attribute.class_weights_as_tensor.access(Tensor.class, onnxAttributes); 29648 return java.util.Optional.ofNullable(class_weights_as_tensor); 29649 } 29650 29651 public java.util.Optional<String> post_transform() { 29652 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes); 29653 return java.util.Optional.ofNullable(post_transform); 29654 } 29655 29656 public java.util.Optional<String[]> nodes_modes() { 29657 String[] nodes_modes = Attribute.nodes_modes.access(String[].class, onnxAttributes); 29658 return java.util.Optional.ofNullable(nodes_modes).map(String[]::clone); 29659 } 29660 29661 public java.util.Optional<long[]> nodes_falsenodeids() { 29662 long[] nodes_falsenodeids = Attribute.nodes_falsenodeids.access(long[].class, onnxAttributes); 29663 return java.util.Optional.ofNullable(nodes_falsenodeids).map(long[]::clone); 29664 } 29665 29666 public java.util.Optional<String[]> classlabels_strings() { 29667 String[] classlabels_strings = Attribute.classlabels_strings.access(String[].class, onnxAttributes); 29668 return java.util.Optional.ofNullable(classlabels_strings).map(String[]::clone); 29669 } 29670 29671 public java.util.Optional<long[]> nodes_truenodeids() { 29672 long[] nodes_truenodeids = Attribute.nodes_truenodeids.access(long[].class, onnxAttributes); 29673 return java.util.Optional.ofNullable(nodes_truenodeids).map(long[]::clone); 29674 } 29675 29676 public java.util.Optional<long[]> nodes_nodeids() { 29677 long[] nodes_nodeids = Attribute.nodes_nodeids.access(long[].class, onnxAttributes); 29678 return java.util.Optional.ofNullable(nodes_nodeids).map(long[]::clone); 29679 } 29680 29681 public java.util.Optional<Tensor> nodes_hitrates_as_tensor() { 29682 Tensor nodes_hitrates_as_tensor = Attribute.nodes_hitrates_as_tensor.access(Tensor.class, onnxAttributes); 29683 return java.util.Optional.ofNullable(nodes_hitrates_as_tensor); 29684 } 29685 29686 public java.util.Optional<float[]> class_weights() { 29687 float[] class_weights = Attribute.class_weights.access(float[].class, onnxAttributes); 29688 return java.util.Optional.ofNullable(class_weights).map(float[]::clone); 29689 } 29690 29691 public java.util.Optional<Tensor> base_values_as_tensor() { 29692 Tensor base_values_as_tensor = Attribute.base_values_as_tensor.access(Tensor.class, onnxAttributes); 29693 return java.util.Optional.ofNullable(base_values_as_tensor); 29694 } 29695 29696 public java.util.Optional<long[]> nodes_missing_value_tracks_true() { 29697 long[] nodes_missing_value_tracks_true = Attribute.nodes_missing_value_tracks_true.access(long[].class, onnxAttributes); 29698 return java.util.Optional.ofNullable(nodes_missing_value_tracks_true).map(long[]::clone); 29699 } 29700 29701 public java.util.Optional<long[]> class_nodeids() { 29702 long[] class_nodeids = Attribute.class_nodeids.access(long[].class, onnxAttributes); 29703 return java.util.Optional.ofNullable(class_nodeids).map(long[]::clone); 29704 } 29705 29706 public java.util.Optional<long[]> class_treeids() { 29707 long[] class_treeids = Attribute.class_treeids.access(long[].class, onnxAttributes); 29708 return java.util.Optional.ofNullable(class_treeids).map(long[]::clone); 29709 } 29710 29711 public java.util.Optional<float[]> base_values() { 29712 float[] base_values = Attribute.base_values.access(float[].class, onnxAttributes); 29713 return java.util.Optional.ofNullable(base_values).map(float[]::clone); 29714 } 29715 29716 public java.util.Optional<float[]> nodes_values() { 29717 float[] nodes_values = Attribute.nodes_values.access(float[].class, onnxAttributes); 29718 return java.util.Optional.ofNullable(nodes_values).map(float[]::clone); 29719 } 29720 29721 public java.util.Optional<Tensor> nodes_values_as_tensor() { 29722 Tensor nodes_values_as_tensor = Attribute.nodes_values_as_tensor.access(Tensor.class, onnxAttributes); 29723 return java.util.Optional.ofNullable(nodes_values_as_tensor); 29724 } 29725 29726 } 29727 29728 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) { 29729 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); 29730 } 29731 29732 @OpFactory.OpDeclaration(TreeEnsembleRegressor.NAME) 29733 public static final class TreeEnsembleRegressor extends OnnxOp { 29734 public static final String NAME = "TreeEnsembleRegressor"; 29735 29736 public enum Attribute implements OnnxAttribute { 29737 aggregate_function(String.class, true, "SUM"), 29738 nodes_hitrates(float[].class, true, null), 29739 target_weights_as_tensor(Tensor.class, true, null), 29740 nodes_featureids(long[].class, true, null), 29741 target_treeids(long[].class, true, null), 29742 nodes_treeids(long[].class, true, null), 29743 post_transform(String.class, true, "NONE"), 29744 nodes_modes(String[].class, true, null), 29745 target_weights(float[].class, true, null), 29746 nodes_falsenodeids(long[].class, true, null), 29747 target_ids(long[].class, true, null), 29748 nodes_truenodeids(long[].class, true, null), 29749 target_nodeids(long[].class, true, null), 29750 nodes_nodeids(long[].class, true, null), 29751 nodes_hitrates_as_tensor(Tensor.class, true, null), 29752 base_values_as_tensor(Tensor.class, true, null), 29753 n_targets(Long.class, true, null), 29754 nodes_missing_value_tracks_true(long[].class, true, null), 29755 base_values(float[].class, true, null), 29756 nodes_values(float[].class, true, null), 29757 nodes_values_as_tensor(Tensor.class, true, null), 29758 ; 29759 29760 final Class<?> t; 29761 final boolean optional; 29762 final Object defaultValue; 29763 29764 Attribute(Class<?> type, boolean optional, Object defaultValue) { 29765 this.t = type; 29766 this.optional = optional; 29767 this.defaultValue = defaultValue; 29768 assert optional || defaultValue == null; 29769 } 29770 29771 public Class<?> type() { 29772 return t; 29773 } 29774 29775 public boolean isOptional() { 29776 return optional; 29777 } 29778 29779 public Object defaultValue() { 29780 return defaultValue; 29781 } 29782 } 29783 29784 public enum TypeConstraint implements OnnxTypeConstraint { 29785 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.float32()), OnnxType.tensor(OnnxType.float64()), OnnxType.tensor(OnnxType.int64()), OnnxType.tensor(OnnxType.int32())))), 29786 ; 29787 29788 final OnnxType.TypeVariable typeVariable; 29789 29790 TypeConstraint(OnnxType.TypeVariable typeVariable) { 29791 assert typeVariable.name().equals(name()); 29792 this.typeVariable = typeVariable; 29793 } 29794 29795 @Override 29796 public OnnxType.TypeVariable typeVariable() { 29797 return typeVariable; 29798 } 29799 } 29800 29801 public enum InputParameter implements OnnxParameter { 29802 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 29803 ; 29804 29805 final OnnxType type; 29806 final Quantifier quantifier; 29807 29808 InputParameter(OnnxType type, Quantifier quantifier) { 29809 this.type = type; 29810 this.quantifier = quantifier; 29811 } 29812 29813 @Override 29814 public OnnxType type() { 29815 return type; 29816 } 29817 29818 @Override 29819 public Quantifier quantifier() { 29820 return quantifier; 29821 } 29822 } 29823 29824 public enum OutputParameter implements OnnxParameter { 29825 Y(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 29826 ; 29827 29828 final OnnxType type; 29829 final Quantifier quantifier; 29830 29831 OutputParameter(OnnxType type, Quantifier quantifier) { 29832 this.type = type; 29833 this.quantifier = quantifier; 29834 } 29835 29836 @Override 29837 public OnnxType type() { 29838 return type; 29839 } 29840 29841 @Override 29842 public Quantifier quantifier() { 29843 return quantifier; 29844 } 29845 } 29846 29847 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 29848 NAME, 29849 List.of(Attribute.values()), 29850 List.of(TypeConstraint.values()), 29851 List.of(InputParameter.values()), 29852 List.of(OutputParameter.values()) 29853 ); 29854 29855 public TreeEnsembleRegressor(ExternalizedOp def) { 29856 super(SCHEMA, def); 29857 } 29858 29859 TreeEnsembleRegressor(TreeEnsembleRegressor that, CopyContext cc) { 29860 super(that, cc); 29861 } 29862 29863 @Override 29864 public TreeEnsembleRegressor transform(CopyContext cc, OpTransformer ot) { 29865 return new TreeEnsembleRegressor(this, cc); 29866 } 29867 29868 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) { 29869 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)); 29870 } 29871 29872 @Override 29873 public SequencedSet<OnnxParameter> onnxOutputs() { 29874 return onnxOutputs(SCHEMA); 29875 } 29876 29877 @Override 29878 public SequencedMap<OnnxParameter, Object> onnxInputs() { 29879 return onnxInputs(SCHEMA, List.of(X())); 29880 } 29881 29882 public Value X() { 29883 return operands().get(0); 29884 } 29885 29886 public java.util.Optional<String> aggregate_function() { 29887 String aggregate_function = Attribute.aggregate_function.access(String.class, onnxAttributes); 29888 return java.util.Optional.ofNullable(aggregate_function); 29889 } 29890 29891 public java.util.Optional<float[]> nodes_hitrates() { 29892 float[] nodes_hitrates = Attribute.nodes_hitrates.access(float[].class, onnxAttributes); 29893 return java.util.Optional.ofNullable(nodes_hitrates).map(float[]::clone); 29894 } 29895 29896 public java.util.Optional<Tensor> target_weights_as_tensor() { 29897 Tensor target_weights_as_tensor = Attribute.target_weights_as_tensor.access(Tensor.class, onnxAttributes); 29898 return java.util.Optional.ofNullable(target_weights_as_tensor); 29899 } 29900 29901 public java.util.Optional<long[]> nodes_featureids() { 29902 long[] nodes_featureids = Attribute.nodes_featureids.access(long[].class, onnxAttributes); 29903 return java.util.Optional.ofNullable(nodes_featureids).map(long[]::clone); 29904 } 29905 29906 public java.util.Optional<long[]> target_treeids() { 29907 long[] target_treeids = Attribute.target_treeids.access(long[].class, onnxAttributes); 29908 return java.util.Optional.ofNullable(target_treeids).map(long[]::clone); 29909 } 29910 29911 public java.util.Optional<long[]> nodes_treeids() { 29912 long[] nodes_treeids = Attribute.nodes_treeids.access(long[].class, onnxAttributes); 29913 return java.util.Optional.ofNullable(nodes_treeids).map(long[]::clone); 29914 } 29915 29916 public java.util.Optional<String> post_transform() { 29917 String post_transform = Attribute.post_transform.access(String.class, onnxAttributes); 29918 return java.util.Optional.ofNullable(post_transform); 29919 } 29920 29921 public java.util.Optional<String[]> nodes_modes() { 29922 String[] nodes_modes = Attribute.nodes_modes.access(String[].class, onnxAttributes); 29923 return java.util.Optional.ofNullable(nodes_modes).map(String[]::clone); 29924 } 29925 29926 public java.util.Optional<float[]> target_weights() { 29927 float[] target_weights = Attribute.target_weights.access(float[].class, onnxAttributes); 29928 return java.util.Optional.ofNullable(target_weights).map(float[]::clone); 29929 } 29930 29931 public java.util.Optional<long[]> nodes_falsenodeids() { 29932 long[] nodes_falsenodeids = Attribute.nodes_falsenodeids.access(long[].class, onnxAttributes); 29933 return java.util.Optional.ofNullable(nodes_falsenodeids).map(long[]::clone); 29934 } 29935 29936 public java.util.Optional<long[]> target_ids() { 29937 long[] target_ids = Attribute.target_ids.access(long[].class, onnxAttributes); 29938 return java.util.Optional.ofNullable(target_ids).map(long[]::clone); 29939 } 29940 29941 public java.util.Optional<long[]> nodes_truenodeids() { 29942 long[] nodes_truenodeids = Attribute.nodes_truenodeids.access(long[].class, onnxAttributes); 29943 return java.util.Optional.ofNullable(nodes_truenodeids).map(long[]::clone); 29944 } 29945 29946 public java.util.Optional<long[]> target_nodeids() { 29947 long[] target_nodeids = Attribute.target_nodeids.access(long[].class, onnxAttributes); 29948 return java.util.Optional.ofNullable(target_nodeids).map(long[]::clone); 29949 } 29950 29951 public java.util.Optional<long[]> nodes_nodeids() { 29952 long[] nodes_nodeids = Attribute.nodes_nodeids.access(long[].class, onnxAttributes); 29953 return java.util.Optional.ofNullable(nodes_nodeids).map(long[]::clone); 29954 } 29955 29956 public java.util.Optional<Tensor> nodes_hitrates_as_tensor() { 29957 Tensor nodes_hitrates_as_tensor = Attribute.nodes_hitrates_as_tensor.access(Tensor.class, onnxAttributes); 29958 return java.util.Optional.ofNullable(nodes_hitrates_as_tensor); 29959 } 29960 29961 public java.util.Optional<Tensor> base_values_as_tensor() { 29962 Tensor base_values_as_tensor = Attribute.base_values_as_tensor.access(Tensor.class, onnxAttributes); 29963 return java.util.Optional.ofNullable(base_values_as_tensor); 29964 } 29965 29966 public java.util.Optional<Long> n_targets() { 29967 Long n_targets = Attribute.n_targets.access(Long.class, onnxAttributes); 29968 return java.util.Optional.ofNullable(n_targets); 29969 } 29970 29971 public java.util.Optional<long[]> nodes_missing_value_tracks_true() { 29972 long[] nodes_missing_value_tracks_true = Attribute.nodes_missing_value_tracks_true.access(long[].class, onnxAttributes); 29973 return java.util.Optional.ofNullable(nodes_missing_value_tracks_true).map(long[]::clone); 29974 } 29975 29976 public java.util.Optional<float[]> base_values() { 29977 float[] base_values = Attribute.base_values.access(float[].class, onnxAttributes); 29978 return java.util.Optional.ofNullable(base_values).map(float[]::clone); 29979 } 29980 29981 public java.util.Optional<float[]> nodes_values() { 29982 float[] nodes_values = Attribute.nodes_values.access(float[].class, onnxAttributes); 29983 return java.util.Optional.ofNullable(nodes_values).map(float[]::clone); 29984 } 29985 29986 public java.util.Optional<Tensor> nodes_values_as_tensor() { 29987 Tensor nodes_values_as_tensor = Attribute.nodes_values_as_tensor.access(Tensor.class, onnxAttributes); 29988 return java.util.Optional.ofNullable(nodes_values_as_tensor); 29989 } 29990 29991 } 29992 29993 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) { 29994 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); 29995 } 29996 29997 @OpFactory.OpDeclaration(Trilu.NAME) 29998 public static final class Trilu extends OnnxOp { 29999 public static final String NAME = "Trilu"; 30000 30001 public enum Attribute implements OnnxAttribute { 30002 upper(Long.class, true, 1), 30003 ; 30004 30005 final Class<?> t; 30006 final boolean optional; 30007 final Object defaultValue; 30008 30009 Attribute(Class<?> type, boolean optional, Object defaultValue) { 30010 this.t = type; 30011 this.optional = optional; 30012 this.defaultValue = defaultValue; 30013 assert optional || defaultValue == null; 30014 } 30015 30016 public Class<?> type() { 30017 return t; 30018 } 30019 30020 public boolean isOptional() { 30021 return optional; 30022 } 30023 30024 public Object defaultValue() { 30025 return defaultValue; 30026 } 30027 } 30028 30029 public enum TypeConstraint implements OnnxTypeConstraint { 30030 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())))), 30031 ; 30032 30033 final OnnxType.TypeVariable typeVariable; 30034 30035 TypeConstraint(OnnxType.TypeVariable typeVariable) { 30036 assert typeVariable.name().equals(name()); 30037 this.typeVariable = typeVariable; 30038 } 30039 30040 @Override 30041 public OnnxType.TypeVariable typeVariable() { 30042 return typeVariable; 30043 } 30044 } 30045 30046 public enum InputParameter implements OnnxParameter { 30047 input(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30048 k(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 30049 ; 30050 30051 final OnnxType type; 30052 final Quantifier quantifier; 30053 30054 InputParameter(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 enum OutputParameter implements OnnxParameter { 30071 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30072 ; 30073 30074 final OnnxType type; 30075 final Quantifier quantifier; 30076 30077 OutputParameter(OnnxType type, Quantifier quantifier) { 30078 this.type = type; 30079 this.quantifier = quantifier; 30080 } 30081 30082 @Override 30083 public OnnxType type() { 30084 return type; 30085 } 30086 30087 @Override 30088 public Quantifier quantifier() { 30089 return quantifier; 30090 } 30091 } 30092 30093 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 30094 NAME, 30095 List.of(Attribute.values()), 30096 List.of(TypeConstraint.values()), 30097 List.of(InputParameter.values()), 30098 List.of(OutputParameter.values()) 30099 ); 30100 30101 public Trilu(ExternalizedOp def) { 30102 super(SCHEMA, def); 30103 } 30104 30105 Trilu(Trilu that, CopyContext cc) { 30106 super(that, cc); 30107 } 30108 30109 @Override 30110 public Trilu transform(CopyContext cc, OpTransformer ot) { 30111 return new Trilu(this, cc); 30112 } 30113 30114 Trilu(TypeElement resultType, Value input, java.util.Optional<Value> k, java.util.Optional<Long> upper) { 30115 super(SCHEMA, resultType, Set.of(), List.of(input, k), List.of(upper)); 30116 } 30117 30118 @Override 30119 public SequencedSet<OnnxParameter> onnxOutputs() { 30120 return onnxOutputs(SCHEMA); 30121 } 30122 30123 @Override 30124 public SequencedMap<OnnxParameter, Object> onnxInputs() { 30125 return onnxInputs(SCHEMA, List.of(input(), k())); 30126 } 30127 30128 public Value input() { 30129 return operands().get(0); 30130 } 30131 30132 public java.util.Optional<Value> k() { 30133 int i = optionalInputArguments.indexOf(InputParameter.k); 30134 return i != -1 ? java.util.Optional.of(operands().get(1 + i)) : java.util.Optional.empty(); 30135 } 30136 30137 public java.util.Optional<Long> upper() { 30138 Long upper = Attribute.upper.access(Long.class, onnxAttributes); 30139 return java.util.Optional.ofNullable(upper); 30140 } 30141 30142 } 30143 30144 public static Trilu Trilu(TypeElement resultType, Value input, java.util.Optional<Value> k, java.util.Optional<Long> upper) { 30145 return new Trilu(resultType, input, k, upper); 30146 } 30147 30148 @OpFactory.OpDeclaration(Unique.NAME) 30149 public static final class Unique extends OnnxOp { 30150 public static final String NAME = "Unique"; 30151 30152 public enum Attribute implements OnnxAttribute { 30153 sorted(Long.class, true, 1), 30154 axis(Long.class, true, null), 30155 ; 30156 30157 final Class<?> t; 30158 final boolean optional; 30159 final Object defaultValue; 30160 30161 Attribute(Class<?> type, boolean optional, Object defaultValue) { 30162 this.t = type; 30163 this.optional = optional; 30164 this.defaultValue = defaultValue; 30165 assert optional || defaultValue == null; 30166 } 30167 30168 public Class<?> type() { 30169 return t; 30170 } 30171 30172 public boolean isOptional() { 30173 return optional; 30174 } 30175 30176 public Object defaultValue() { 30177 return defaultValue; 30178 } 30179 } 30180 30181 public enum TypeConstraint implements OnnxTypeConstraint { 30182 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())))), 30183 ; 30184 30185 final OnnxType.TypeVariable typeVariable; 30186 30187 TypeConstraint(OnnxType.TypeVariable typeVariable) { 30188 assert typeVariable.name().equals(name()); 30189 this.typeVariable = typeVariable; 30190 } 30191 30192 @Override 30193 public OnnxType.TypeVariable typeVariable() { 30194 return typeVariable; 30195 } 30196 } 30197 30198 public enum InputParameter implements OnnxParameter { 30199 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30200 ; 30201 30202 final OnnxType type; 30203 final Quantifier quantifier; 30204 30205 InputParameter(OnnxType type, Quantifier quantifier) { 30206 this.type = type; 30207 this.quantifier = quantifier; 30208 } 30209 30210 @Override 30211 public OnnxType type() { 30212 return type; 30213 } 30214 30215 @Override 30216 public Quantifier quantifier() { 30217 return quantifier; 30218 } 30219 } 30220 30221 public enum OutputParameter implements OnnxParameter { 30222 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30223 indices(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 30224 inverse_indices(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 30225 counts(OnnxType.tensor(OnnxType.int64()), Quantifier.OPTIONAL), 30226 ; 30227 30228 final OnnxType type; 30229 final Quantifier quantifier; 30230 30231 OutputParameter(OnnxType type, Quantifier quantifier) { 30232 this.type = type; 30233 this.quantifier = quantifier; 30234 } 30235 30236 @Override 30237 public OnnxType type() { 30238 return type; 30239 } 30240 30241 @Override 30242 public Quantifier quantifier() { 30243 return quantifier; 30244 } 30245 } 30246 30247 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 30248 NAME, 30249 List.of(Attribute.values()), 30250 List.of(TypeConstraint.values()), 30251 List.of(InputParameter.values()), 30252 List.of(OutputParameter.values()) 30253 ); 30254 30255 public Unique(ExternalizedOp def) { 30256 super(SCHEMA, def); 30257 } 30258 30259 Unique(Unique that, CopyContext cc) { 30260 super(that, cc); 30261 } 30262 30263 @Override 30264 public Unique transform(CopyContext cc, OpTransformer ot) { 30265 return new Unique(this, cc); 30266 } 30267 30268 Unique(TypeElement resultType, Set<OutputParameter> optionalOutputs, Value X, java.util.Optional<Long> sorted, java.util.Optional<Long> axis) { 30269 super(SCHEMA, resultType, optionalOutputs, List.of(X), List.of(sorted, axis)); 30270 } 30271 30272 @Override 30273 public SequencedSet<OnnxParameter> onnxOutputs() { 30274 return onnxOutputs(SCHEMA); 30275 } 30276 30277 @Override 30278 public SequencedMap<OnnxParameter, Object> onnxInputs() { 30279 return onnxInputs(SCHEMA, List.of(X())); 30280 } 30281 30282 public Value X() { 30283 return operands().get(0); 30284 } 30285 30286 public java.util.Optional<Long> sorted() { 30287 Long sorted = Attribute.sorted.access(Long.class, onnxAttributes); 30288 return java.util.Optional.ofNullable(sorted); 30289 } 30290 30291 public java.util.Optional<Long> axis() { 30292 Long axis = Attribute.axis.access(Long.class, onnxAttributes); 30293 return java.util.Optional.ofNullable(axis); 30294 } 30295 30296 } 30297 30298 public static Unique Unique(TypeElement resultType, Set<Unique.OutputParameter> optionalOutputs, Value X, java.util.Optional<Long> sorted, java.util.Optional<Long> axis) { 30299 return new Unique(resultType, optionalOutputs, X, sorted, axis); 30300 } 30301 30302 @OpFactory.OpDeclaration(Unsqueeze.NAME) 30303 public static final class Unsqueeze extends OnnxOp { 30304 public static final String NAME = "Unsqueeze"; 30305 30306 public enum Attribute implements OnnxAttribute.None { } 30307 30308 public enum TypeConstraint implements OnnxTypeConstraint { 30309 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())))), 30310 ; 30311 30312 final OnnxType.TypeVariable typeVariable; 30313 30314 TypeConstraint(OnnxType.TypeVariable typeVariable) { 30315 assert typeVariable.name().equals(name()); 30316 this.typeVariable = typeVariable; 30317 } 30318 30319 @Override 30320 public OnnxType.TypeVariable typeVariable() { 30321 return typeVariable; 30322 } 30323 } 30324 30325 public enum InputParameter implements OnnxParameter { 30326 data(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30327 axes(OnnxType.tensor(OnnxType.int64()), Quantifier.REQUIRED), 30328 ; 30329 30330 final OnnxType type; 30331 final Quantifier quantifier; 30332 30333 InputParameter(OnnxType type, Quantifier quantifier) { 30334 this.type = type; 30335 this.quantifier = quantifier; 30336 } 30337 30338 @Override 30339 public OnnxType type() { 30340 return type; 30341 } 30342 30343 @Override 30344 public Quantifier quantifier() { 30345 return quantifier; 30346 } 30347 } 30348 30349 public enum OutputParameter implements OnnxParameter { 30350 expanded(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30351 ; 30352 30353 final OnnxType type; 30354 final Quantifier quantifier; 30355 30356 OutputParameter(OnnxType type, Quantifier quantifier) { 30357 this.type = type; 30358 this.quantifier = quantifier; 30359 } 30360 30361 @Override 30362 public OnnxType type() { 30363 return type; 30364 } 30365 30366 @Override 30367 public Quantifier quantifier() { 30368 return quantifier; 30369 } 30370 } 30371 30372 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 30373 NAME, 30374 List.of(Attribute.values()), 30375 List.of(TypeConstraint.values()), 30376 List.of(InputParameter.values()), 30377 List.of(OutputParameter.values()) 30378 ); 30379 30380 public Unsqueeze(ExternalizedOp def) { 30381 super(SCHEMA, def); 30382 } 30383 30384 Unsqueeze(Unsqueeze that, CopyContext cc) { 30385 super(that, cc); 30386 } 30387 30388 @Override 30389 public Unsqueeze transform(CopyContext cc, OpTransformer ot) { 30390 return new Unsqueeze(this, cc); 30391 } 30392 30393 Unsqueeze(TypeElement resultType, Value data, Value axes) { 30394 super(SCHEMA, resultType, Set.of(), List.of(data, axes), List.of()); 30395 } 30396 30397 @Override 30398 public SequencedSet<OnnxParameter> onnxOutputs() { 30399 return onnxOutputs(SCHEMA); 30400 } 30401 30402 @Override 30403 public SequencedMap<OnnxParameter, Object> onnxInputs() { 30404 return onnxInputs(SCHEMA, List.of(data(), axes())); 30405 } 30406 30407 public Value data() { 30408 return operands().get(0); 30409 } 30410 30411 public Value axes() { 30412 return operands().get(1); 30413 } 30414 30415 } 30416 30417 public static Unsqueeze Unsqueeze(TypeElement resultType, Value data, Value axes) { 30418 return new Unsqueeze(resultType, data, axes); 30419 } 30420 30421 @OpFactory.OpDeclaration(Upsample.NAME) 30422 public static final class Upsample extends OnnxOp { 30423 public static final String NAME = "Upsample"; 30424 30425 public enum Attribute implements OnnxAttribute { 30426 mode(String.class, true, "nearest"), 30427 ; 30428 30429 final Class<?> t; 30430 final boolean optional; 30431 final Object defaultValue; 30432 30433 Attribute(Class<?> type, boolean optional, Object defaultValue) { 30434 this.t = type; 30435 this.optional = optional; 30436 this.defaultValue = defaultValue; 30437 assert optional || defaultValue == null; 30438 } 30439 30440 public Class<?> type() { 30441 return t; 30442 } 30443 30444 public boolean isOptional() { 30445 return optional; 30446 } 30447 30448 public Object defaultValue() { 30449 return defaultValue; 30450 } 30451 } 30452 30453 public enum TypeConstraint implements OnnxTypeConstraint { 30454 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())))), 30455 ; 30456 30457 final OnnxType.TypeVariable typeVariable; 30458 30459 TypeConstraint(OnnxType.TypeVariable typeVariable) { 30460 assert typeVariable.name().equals(name()); 30461 this.typeVariable = typeVariable; 30462 } 30463 30464 @Override 30465 public OnnxType.TypeVariable typeVariable() { 30466 return typeVariable; 30467 } 30468 } 30469 30470 public enum InputParameter implements OnnxParameter { 30471 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30472 scales(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 30473 ; 30474 30475 final OnnxType type; 30476 final Quantifier quantifier; 30477 30478 InputParameter(OnnxType type, Quantifier quantifier) { 30479 this.type = type; 30480 this.quantifier = quantifier; 30481 } 30482 30483 @Override 30484 public OnnxType type() { 30485 return type; 30486 } 30487 30488 @Override 30489 public Quantifier quantifier() { 30490 return quantifier; 30491 } 30492 } 30493 30494 public enum OutputParameter implements OnnxParameter { 30495 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30496 ; 30497 30498 final OnnxType type; 30499 final Quantifier quantifier; 30500 30501 OutputParameter(OnnxType type, Quantifier quantifier) { 30502 this.type = type; 30503 this.quantifier = quantifier; 30504 } 30505 30506 @Override 30507 public OnnxType type() { 30508 return type; 30509 } 30510 30511 @Override 30512 public Quantifier quantifier() { 30513 return quantifier; 30514 } 30515 } 30516 30517 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 30518 NAME, 30519 List.of(Attribute.values()), 30520 List.of(TypeConstraint.values()), 30521 List.of(InputParameter.values()), 30522 List.of(OutputParameter.values()) 30523 ); 30524 30525 public Upsample(ExternalizedOp def) { 30526 super(SCHEMA, def); 30527 } 30528 30529 Upsample(Upsample that, CopyContext cc) { 30530 super(that, cc); 30531 } 30532 30533 @Override 30534 public Upsample transform(CopyContext cc, OpTransformer ot) { 30535 return new Upsample(this, cc); 30536 } 30537 30538 Upsample(TypeElement resultType, Value X, Value scales, java.util.Optional<String> mode) { 30539 super(SCHEMA, resultType, Set.of(), List.of(X, scales), List.of(mode)); 30540 } 30541 30542 @Override 30543 public SequencedSet<OnnxParameter> onnxOutputs() { 30544 return onnxOutputs(SCHEMA); 30545 } 30546 30547 @Override 30548 public SequencedMap<OnnxParameter, Object> onnxInputs() { 30549 return onnxInputs(SCHEMA, List.of(X(), scales())); 30550 } 30551 30552 public Value X() { 30553 return operands().get(0); 30554 } 30555 30556 public Value scales() { 30557 return operands().get(1); 30558 } 30559 30560 public java.util.Optional<String> mode() { 30561 String mode = Attribute.mode.access(String.class, onnxAttributes); 30562 return java.util.Optional.ofNullable(mode); 30563 } 30564 30565 } 30566 30567 public static Upsample Upsample(TypeElement resultType, Value X, Value scales, java.util.Optional<String> mode) { 30568 return new Upsample(resultType, X, scales, mode); 30569 } 30570 30571 @OpFactory.OpDeclaration(Where.NAME) 30572 public static final class Where extends OnnxOp { 30573 public static final String NAME = "Where"; 30574 30575 public enum Attribute implements OnnxAttribute.None { } 30576 30577 public enum TypeConstraint implements OnnxTypeConstraint { 30578 B(new OnnxType.TypeVariable("B", List.of(OnnxType.tensor(OnnxType.bool())))), 30579 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())))), 30580 ; 30581 30582 final OnnxType.TypeVariable typeVariable; 30583 30584 TypeConstraint(OnnxType.TypeVariable typeVariable) { 30585 assert typeVariable.name().equals(name()); 30586 this.typeVariable = typeVariable; 30587 } 30588 30589 @Override 30590 public OnnxType.TypeVariable typeVariable() { 30591 return typeVariable; 30592 } 30593 } 30594 30595 public enum InputParameter implements OnnxParameter { 30596 condition(TypeConstraint.B.typeVariable(), Quantifier.REQUIRED), 30597 X(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30598 Y(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30599 ; 30600 30601 final OnnxType type; 30602 final Quantifier quantifier; 30603 30604 InputParameter(OnnxType type, Quantifier quantifier) { 30605 this.type = type; 30606 this.quantifier = quantifier; 30607 } 30608 30609 @Override 30610 public OnnxType type() { 30611 return type; 30612 } 30613 30614 @Override 30615 public Quantifier quantifier() { 30616 return quantifier; 30617 } 30618 } 30619 30620 public enum OutputParameter implements OnnxParameter { 30621 output(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30622 ; 30623 30624 final OnnxType type; 30625 final Quantifier quantifier; 30626 30627 OutputParameter(OnnxType type, Quantifier quantifier) { 30628 this.type = type; 30629 this.quantifier = quantifier; 30630 } 30631 30632 @Override 30633 public OnnxType type() { 30634 return type; 30635 } 30636 30637 @Override 30638 public Quantifier quantifier() { 30639 return quantifier; 30640 } 30641 } 30642 30643 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 30644 NAME, 30645 List.of(Attribute.values()), 30646 List.of(TypeConstraint.values()), 30647 List.of(InputParameter.values()), 30648 List.of(OutputParameter.values()) 30649 ); 30650 30651 public Where(ExternalizedOp def) { 30652 super(SCHEMA, def); 30653 } 30654 30655 Where(Where that, CopyContext cc) { 30656 super(that, cc); 30657 } 30658 30659 @Override 30660 public Where transform(CopyContext cc, OpTransformer ot) { 30661 return new Where(this, cc); 30662 } 30663 30664 Where(TypeElement resultType, Value condition, Value X, Value Y) { 30665 super(SCHEMA, resultType, Set.of(), List.of(condition, X, Y), List.of()); 30666 } 30667 30668 @Override 30669 public SequencedSet<OnnxParameter> onnxOutputs() { 30670 return onnxOutputs(SCHEMA); 30671 } 30672 30673 @Override 30674 public SequencedMap<OnnxParameter, Object> onnxInputs() { 30675 return onnxInputs(SCHEMA, List.of(condition(), X(), Y())); 30676 } 30677 30678 public Value condition() { 30679 return operands().get(0); 30680 } 30681 30682 public Value X() { 30683 return operands().get(1); 30684 } 30685 30686 public Value Y() { 30687 return operands().get(2); 30688 } 30689 30690 } 30691 30692 public static Where Where(TypeElement resultType, Value condition, Value X, Value Y) { 30693 return new Where(resultType, condition, X, Y); 30694 } 30695 30696 @OpFactory.OpDeclaration(Xor.NAME) 30697 public static final class Xor extends OnnxOp { 30698 public static final String NAME = "Xor"; 30699 30700 public enum Attribute implements OnnxAttribute.None { } 30701 30702 public enum TypeConstraint implements OnnxTypeConstraint { 30703 T(new OnnxType.TypeVariable("T", List.of(OnnxType.tensor(OnnxType.bool())))), 30704 T1(new OnnxType.TypeVariable("T1", List.of(OnnxType.tensor(OnnxType.bool())))), 30705 ; 30706 30707 final OnnxType.TypeVariable typeVariable; 30708 30709 TypeConstraint(OnnxType.TypeVariable typeVariable) { 30710 assert typeVariable.name().equals(name()); 30711 this.typeVariable = typeVariable; 30712 } 30713 30714 @Override 30715 public OnnxType.TypeVariable typeVariable() { 30716 return typeVariable; 30717 } 30718 } 30719 30720 public enum InputParameter implements OnnxParameter { 30721 A(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30722 B(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30723 ; 30724 30725 final OnnxType type; 30726 final Quantifier quantifier; 30727 30728 InputParameter(OnnxType type, Quantifier quantifier) { 30729 this.type = type; 30730 this.quantifier = quantifier; 30731 } 30732 30733 @Override 30734 public OnnxType type() { 30735 return type; 30736 } 30737 30738 @Override 30739 public Quantifier quantifier() { 30740 return quantifier; 30741 } 30742 } 30743 30744 public enum OutputParameter implements OnnxParameter { 30745 C(TypeConstraint.T1.typeVariable(), Quantifier.REQUIRED), 30746 ; 30747 30748 final OnnxType type; 30749 final Quantifier quantifier; 30750 30751 OutputParameter(OnnxType type, Quantifier quantifier) { 30752 this.type = type; 30753 this.quantifier = quantifier; 30754 } 30755 30756 @Override 30757 public OnnxType type() { 30758 return type; 30759 } 30760 30761 @Override 30762 public Quantifier quantifier() { 30763 return quantifier; 30764 } 30765 } 30766 30767 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 30768 NAME, 30769 List.of(Attribute.values()), 30770 List.of(TypeConstraint.values()), 30771 List.of(InputParameter.values()), 30772 List.of(OutputParameter.values()) 30773 ); 30774 30775 public Xor(ExternalizedOp def) { 30776 super(SCHEMA, def); 30777 } 30778 30779 Xor(Xor that, CopyContext cc) { 30780 super(that, cc); 30781 } 30782 30783 @Override 30784 public Xor transform(CopyContext cc, OpTransformer ot) { 30785 return new Xor(this, cc); 30786 } 30787 30788 Xor(TypeElement resultType, Value A, Value B) { 30789 super(SCHEMA, resultType, Set.of(), List.of(A, B), List.of()); 30790 } 30791 30792 @Override 30793 public SequencedSet<OnnxParameter> onnxOutputs() { 30794 return onnxOutputs(SCHEMA); 30795 } 30796 30797 @Override 30798 public SequencedMap<OnnxParameter, Object> onnxInputs() { 30799 return onnxInputs(SCHEMA, List.of(A(), B())); 30800 } 30801 30802 public Value A() { 30803 return operands().get(0); 30804 } 30805 30806 public Value B() { 30807 return operands().get(1); 30808 } 30809 30810 } 30811 30812 public static Xor Xor(TypeElement resultType, Value A, Value B) { 30813 return new Xor(resultType, A, B); 30814 } 30815 30816 @OpFactory.OpDeclaration(ZipMap.NAME) 30817 public static final class ZipMap extends OnnxOp { 30818 public static final String NAME = "ZipMap"; 30819 30820 public enum Attribute implements OnnxAttribute { 30821 classlabels_int64s(long[].class, true, null), 30822 classlabels_strings(String[].class, true, null), 30823 ; 30824 30825 final Class<?> t; 30826 final boolean optional; 30827 final Object defaultValue; 30828 30829 Attribute(Class<?> type, boolean optional, Object defaultValue) { 30830 this.t = type; 30831 this.optional = optional; 30832 this.defaultValue = defaultValue; 30833 assert optional || defaultValue == null; 30834 } 30835 30836 public Class<?> type() { 30837 return t; 30838 } 30839 30840 public boolean isOptional() { 30841 return optional; 30842 } 30843 30844 public Object defaultValue() { 30845 return defaultValue; 30846 } 30847 } 30848 30849 public enum TypeConstraint implements OnnxTypeConstraint { 30850 T(new OnnxType.TypeVariable("T", List.of(OnnxType.seq(OnnxType.map(OnnxType.string(), OnnxType.float32())), OnnxType.seq(OnnxType.map(OnnxType.int64(), OnnxType.float32()))))), 30851 ; 30852 30853 final OnnxType.TypeVariable typeVariable; 30854 30855 TypeConstraint(OnnxType.TypeVariable typeVariable) { 30856 assert typeVariable.name().equals(name()); 30857 this.typeVariable = typeVariable; 30858 } 30859 30860 @Override 30861 public OnnxType.TypeVariable typeVariable() { 30862 return typeVariable; 30863 } 30864 } 30865 30866 public enum InputParameter implements OnnxParameter { 30867 X(OnnxType.tensor(OnnxType.float32()), Quantifier.REQUIRED), 30868 ; 30869 30870 final OnnxType type; 30871 final Quantifier quantifier; 30872 30873 InputParameter(OnnxType type, Quantifier quantifier) { 30874 this.type = type; 30875 this.quantifier = quantifier; 30876 } 30877 30878 @Override 30879 public OnnxType type() { 30880 return type; 30881 } 30882 30883 @Override 30884 public Quantifier quantifier() { 30885 return quantifier; 30886 } 30887 } 30888 30889 public enum OutputParameter implements OnnxParameter { 30890 Z(TypeConstraint.T.typeVariable(), Quantifier.REQUIRED), 30891 ; 30892 30893 final OnnxType type; 30894 final Quantifier quantifier; 30895 30896 OutputParameter(OnnxType type, Quantifier quantifier) { 30897 this.type = type; 30898 this.quantifier = quantifier; 30899 } 30900 30901 @Override 30902 public OnnxType type() { 30903 return type; 30904 } 30905 30906 @Override 30907 public Quantifier quantifier() { 30908 return quantifier; 30909 } 30910 } 30911 30912 public static final OnnxSchema SCHEMA = new OnnxSchemaRecord( 30913 NAME, 30914 List.of(Attribute.values()), 30915 List.of(TypeConstraint.values()), 30916 List.of(InputParameter.values()), 30917 List.of(OutputParameter.values()) 30918 ); 30919 30920 public ZipMap(ExternalizedOp def) { 30921 super(SCHEMA, def); 30922 } 30923 30924 ZipMap(ZipMap that, CopyContext cc) { 30925 super(that, cc); 30926 } 30927 30928 @Override 30929 public ZipMap transform(CopyContext cc, OpTransformer ot) { 30930 return new ZipMap(this, cc); 30931 } 30932 30933 ZipMap(TypeElement resultType, Value X, java.util.Optional<long[]> classlabels_int64s, java.util.Optional<String[]> classlabels_strings) { 30934 super(SCHEMA, resultType, Set.of(), List.of(X), List.of(classlabels_int64s, classlabels_strings)); 30935 } 30936 30937 @Override 30938 public SequencedSet<OnnxParameter> onnxOutputs() { 30939 return onnxOutputs(SCHEMA); 30940 } 30941 30942 @Override 30943 public SequencedMap<OnnxParameter, Object> onnxInputs() { 30944 return onnxInputs(SCHEMA, List.of(X())); 30945 } 30946 30947 public Value X() { 30948 return operands().get(0); 30949 } 30950 30951 public java.util.Optional<long[]> classlabels_int64s() { 30952 long[] classlabels_int64s = Attribute.classlabels_int64s.access(long[].class, onnxAttributes); 30953 return java.util.Optional.ofNullable(classlabels_int64s).map(long[]::clone); 30954 } 30955 30956 public java.util.Optional<String[]> classlabels_strings() { 30957 String[] classlabels_strings = Attribute.classlabels_strings.access(String[].class, onnxAttributes); 30958 return java.util.Optional.ofNullable(classlabels_strings).map(String[]::clone); 30959 } 30960 30961 } 30962 30963 public static ZipMap ZipMap(TypeElement resultType, Value X, java.util.Optional<long[]> classlabels_int64s, java.util.Optional<String[]> classlabels_strings) { 30964 return new ZipMap(resultType, X, classlabels_int64s, classlabels_strings); 30965 } 30966 30967 }