MCPcopy
hub / github.com/lutzroeder/netron / call

Method call

source/python.js:15789–15810  ·  view source on GitHub ↗
(loc, f, args, kwargs /*, n_binders */)

Source from the content-addressed store, hash-verified

15787 this._method_names = method_names;
15788 }
15789 call(loc, f, args, kwargs /*, n_binders */) {
15790 const argsWithSelf = [new torch._C.NamedValue(this._self), ...args];
15791 const schemas = [];
15792 for (const method_name of this._method_names) {
15793 const type = this._self.type();
15794 if (type instanceof torch.ClassType) {
15795 const class_type = type;
15796 const method = class_type.getMethod(method_name);
15797 method.ensure_defined();
15798 schemas.push(method.getSchema());
15799 } else if (type instanceof torch.InterfaceType) {
15800 const interface_type = type;
15801 schemas.push(interface_type.getMethod(method_name));
15802 } else {
15803 throw new python.Error('Method constructed that is not a class or interface.');
15804 }
15805 }
15806 const match = torch._C.matchSchemas(schemas, loc, f.graph(), argsWithSelf, kwargs);
15807 const output = f.graph().insertMethodCall(this._method_names[match[0]], match[1]);
15808 output.node().setSourceRange(loc);
15809 return new torch._C.SimpleValue(output);
15810 }
15811 });
15812 this.registerType('torch._C.ClassValue', class extends torch._C.SugaredValue {
15813 constructor(type) {

Callers

nothing calls this directly

Calls 15

getMethodMethod · 0.80
ensure_definedMethod · 0.80
getSchemaMethod · 0.80
insertMethodCallMethod · 0.80
setSourceRangeMethod · 0.80
schemaMethod · 0.80
insertNodeMethod · 0.80
createTupleMethod · 0.80
setTypeMethod · 0.80
insertFunctionCallMethod · 0.80
insertConstantMethod · 0.80
isSubtypeOfMethod · 0.80

Tested by

no test coverage detected