MCPcopy Index your code
hub / github.com/lutzroeder/netron / deserialize_sym_bool

Method deserialize_sym_bool

source/python.js:20591–20608  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

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);

Callers 1

deserialize_graphMethod · 0.80

Calls 2

_parse_sym_exprMethod · 0.80
create_symboolnodeMethod · 0.80

Tested by

no test coverage detected