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

Method emitApplyExpr

source/python.js:17419–17429  ·  view source on GitHub ↗
(apply, n_binders, type_hint)

Source from the content-addressed store, hash-verified

17417 return new torch._C.SimpleValue(this.emitSimpleExpr(tree, type_hint));
17418 }
17419 emitApplyExpr(apply, n_binders, type_hint) {
17420 type_hint = type_hint || null;
17421 const sv = this.emitSugaredExpr(apply.func, 1);
17422 const loc = apply.func.range();
17423 if (sv instanceof torch._C.SpecialFormValue) {
17424 return this.emitApplySpecialForm(sv.form(), apply, sv, type_hint);
17425 }
17426 const args = this.getNamedValues(apply.args, true);
17427 const kwargs = this.emitAttributes(apply.keywords);
17428 return sv.call(loc, this.method, args, kwargs, n_binders);
17429 }
17430 emitAttributes(attributes) {
17431 return attributes.map((attr) => new torch._C.NamedValue(attr.range(), attr.arg, this.emitExpr(attr.value)));
17432 }

Callers 1

emitSugaredExprMethod · 0.80

Calls 6

emitSugaredExprMethod · 0.80
emitApplySpecialFormMethod · 0.80
formMethod · 0.80
getNamedValuesMethod · 0.80
emitAttributesMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected