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

Method create_symintnode

source/python.js:8668–8687  ·  view source on GitHub ↗
(sym, hint, source)

Source from the content-addressed store, hash-verified

8666 constrain_symbol_range(/* s, compiler_min, compiler_max */) {
8667 }
8668 create_symintnode(sym, hint, source) {
8669 let out = null;
8670 let fx_node = null;
8671 if (this._translation_validation_enabled && source !== null) {
8672 throw new python.Error('Not implemented.');
8673 } else {
8674 fx_node = null;
8675 }
8676 if (builtins.isinstance(sym, sympy.core.numbers.Integer)) {
8677 out = builtins.int(sym);
8678 if (hint !== null && out !== hint) {
8679 throw new python.Error(`Symbolic integer has value '${out}' but expected '${hint}'.`);
8680 }
8681 } else {
8682 // if free_unbacked_symbols(sym):
8683 // hint = None
8684 out = new torch.SymInt(new torch.fx.experimental.sym_node.SymNode(sym, this, builtins.int, hint, null, fx_node));
8685 }
8686 return out;
8687 }
8688 create_symboolnode(sym) {
8689 return new torch.SymBool(new torch.fx.experimental.sym_node.SymNode(sym, this, builtins.bool, null));
8690 }

Callers 1

deserialize_sym_intMethod · 0.80

Calls 1

intMethod · 0.80

Tested by

no test coverage detected