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

Method emitConst

source/python.js:17723–17732  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

17721 return torch._C.insertConstant(this.graph, c.value, c.range());
17722 }
17723 emitConst(c) {
17724 if (c.type === 'int') {
17725 return torch._C.materializeConstant(new torch._C.IValue(c.value, 'Int'), this.graph, c.range(), this.integral_constants);
17726 } else if (c.type === 'complex') {
17727 return torch._C.materializeConstant(new torch._C.IValue(c.value, 'Complex'), this.graph, c.range(), this.complex_constants);
17728 } else if (c.type === 'float') {
17729 return torch._C.materializeConstant(new torch._C.IValue(c.value, 'Double'), this.graph, c.range(), this.fp_constants);
17730 }
17731 throw new python.Error(`Unsupported constant type.`);
17732 }
17733 emitListLiteral(ll, type_hint) {
17734 type_hint = type_hint || null;
17735 const values = this.getValues(ll.elts, true);

Callers 1

emitSimpleExprMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected