Repository navigation
Commit fd5226a
authored
Sign the positive infinity token so flatc 1.12 accepts it
Summary:
The non-finite float rewrite added in the parent diff spells positive
infinity as a bare `inf`, which fails to lower under the `flatc` shipped
in fbsource (1.12.0). `flatc` parses a `VkValue` union member's value
before it knows the member's type, so a token that starts with a letter
(`inf`, `nan`) is rejected as an unknown value:
```
schema.json:1: 128: error: cannot parse value starting with: inf
```
A signed token takes the numeric path and parses, so this emits `+inf`
for positive infinity (`-inf` was already correct). `flatc` writes the
bare `inf` back on decompile, which the existing reverse rewrite already
maps to json's `Infinity`, so only the forward direction needed the fix.
This unbreaks `test_serialize_deserialize_non_finite_scalars` and
`test_serialize_deserialize_non_finite_floats_in_list`.
Reviewed By: rascani
Differential Revision: D119675660
Pull Request resolved: pytorch#227701 parent f6b333c commit fd5226a
1 file changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | | - | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| |||
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
65 | | - | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
70 | | - | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
77 | | - | |
| 83 | + | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| |||
0 commit comments