Commit a706e17
authored
[serde] Cast attribute values to int or float (#175)
Cast attribute values to int or float based on the attribute type when
serializing. Otherwise protobuf will complain
> Field onnx.AttributeProto.i: Expected an int, got a boolean. This will
be rejected in 7.34.0, please fix it before that
This should fix pytorch/pytorch#161941.
---------
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>1 parent bfab676 commit a706e17
2 files changed
+31
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1784 | 1784 | | |
1785 | 1785 | | |
1786 | 1786 | | |
1787 | | - | |
| 1787 | + | |
| 1788 | + | |
1788 | 1789 | | |
1789 | 1790 | | |
1790 | 1791 | | |
1791 | | - | |
| 1792 | + | |
1792 | 1793 | | |
1793 | 1794 | | |
1794 | 1795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
531 | 532 | | |
532 | 533 | | |
533 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
534 | 562 | | |
535 | 563 | | |
536 | 564 | | |
| |||
0 commit comments