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

Method find_operator

source/python.js:20716–20726  ·  view source on GitHub ↗
(module, target)

Source from the content-addressed store, hash-verified

20714 this.registerType('executorch.exir.serde.serialize.GraphModuleDeserializer', class extends torch._export.serde.serialize.GraphModuleDeserializer {
20715 deserialize_operator(serialized_target) {
20716 const find_operator = (module, target) => {
20717 const names = target.split('.').slice(5);
20718 let node = module;
20719 for (const name of names) {
20720 node = builtins.getattr(node, name);
20721 if (!node) {
20722 return target;
20723 }
20724 }
20725 return node;
20726 };
20727 const ops = executorch.exir.dialects._ops.ops;
20728 if (serialized_target.startsWith('executorch.exir.dialects.edge.ops')) {
20729 return find_operator(builtins.getattr(ops, 'edge'), serialized_target);

Callers

nothing calls this directly

Calls 2

splitMethod · 0.80
getattrMethod · 0.45

Tested by

no test coverage detected