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

Method emitDef

source/python.js:16665–16675  ·  view source on GitHub ↗
(def, self, block)

Source from the content-addressed store, hash-verified

16663 return old_frame;
16664 }
16665 emitDef(def, self, block) {
16666 const schema = this._typeParser.parseSchemaFromDef(def, self !== null);
16667 if (schema.returns.length === 1) {
16668 this._def_stack[this._def_stack.length - 1]._declared_return_type = schema.returns[0].type;
16669 }
16670 const args = this.emitFormalArguments(def, self, schema, block);
16671 this.emitStatements(def.body);
16672 this.handleMaybeNoReturn(def, block);
16673 const returns = [this.emitOutput(def, schema, block)];
16674 return new torch.FunctionSchema(def.name, '', args, returns);
16675 }
16676 emitFormalArguments(def, self, schema, block) {
16677 const args = [];
16678 const params = def.args.args;

Callers 1

constructorMethod · 0.80

Calls 5

parseSchemaFromDefMethod · 0.80
emitFormalArgumentsMethod · 0.80
emitStatementsMethod · 0.80
handleMaybeNoReturnMethod · 0.80
emitOutputMethod · 0.80

Tested by

no test coverage detected