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

Method matches

source/python.js:12618–12649  ·  view source on GitHub ↗
(schema)

Source from the content-addressed store, hash-verified

12616 return false;
12617 }
12618 matches(schema) {
12619 if (torch._C.isBlockListedSchema(schema)) {
12620 return false;
12621 }
12622 if (this.kind() !== schema.name) {
12623 return false;
12624 }
12625 const actuals = this.inputs();
12626 const formals = schema.arguments;
12627 if (actuals.length < formals.length) {
12628 return false;
12629 }
12630 const type_env = new Map();
12631 for (let i = 0; i < formals.length; i++) {
12632 let formal = formals[i].type;
12633 const matched_type = torch._C.matchTypeVariables(formal, actuals[i].type(), type_env);
12634 if (!matched_type.success()) {
12635 return false;
12636 }
12637 const resolved = torch._C.tryEvalTypeVariables(formal, type_env);
12638 if (resolved) {
12639 formal = resolved;
12640 }
12641 if (!actuals[i].type().isSubtypeOf(formal)) {
12642 return false;
12643 }
12644 }
12645 if (!schema.is_vararg && actuals.length !== formals.length) {
12646 return false;
12647 }
12648 return true;
12649 }
12650 mustBeNone() {
12651 return this._kind === 'prim::AutogradZero' ||
12652 (this.outputs().length === 1 && this.output().type() === torch.NoneType.get()) ||

Callers 2

applyStyleSheetMethod · 0.80
maybeOperatorMethod · 0.80

Calls 5

successMethod · 0.80
isSubtypeOfMethod · 0.80
kindMethod · 0.45
inputsMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected