(s)
| 20589 | throw new python.Error(`SymInt has invalid field type ${s.type} with value ${s.value}.`); |
| 20590 | } |
| 20591 | deserialize_sym_bool(s) { |
| 20592 | const val = s.value; |
| 20593 | let hint = null; |
| 20594 | if (s.type === 'as_expr') { |
| 20595 | if (val.hint === null) { |
| 20596 | hint = null; |
| 20597 | } else { |
| 20598 | // assert val.hint.type == "as_bool" |
| 20599 | hint = val.hint.value; |
| 20600 | } |
| 20601 | const sym = this._parse_sym_expr(val.expr_str, hint); |
| 20602 | return this.shape_env.create_symboolnode(sym, hint); |
| 20603 | } else if (s.type === 'as_bool') { |
| 20604 | // assert type(val) is bool |
| 20605 | return val; |
| 20606 | } |
| 20607 | throw new python.Error(`SymBool has invalid field type ${s.type} with value ${s.value}.`); |
| 20608 | } |
| 20609 | deserialize_device(d) { |
| 20610 | if (d.index === null) { |
| 20611 | return new torch.device(d.type); |
no test coverage detected