MCPcopy Create free account
hub / github.com/pytorch/executorch / serialize_operator

Method serialize_operator

exir/serde/export_serialize.py:495–504  ·  view source on GitHub ↗
(self, target)

Source from the content-addressed store, hash-verified

493 self.graph_state.outputs = [self.serialize_input(arg) for arg in node_args]
494
495 def serialize_operator(self, target) -> str:
496 if isinstance(target, str):
497 return target
498 elif target.__module__.startswith("torch._ops"):
499 # TODO(zhxchen17) Maybe provide a function name helper in FX.
500 # From torch.fx.node._get_qualified_name
501 module = target.__module__.replace("torch._ops", "torch.ops")
502 return f"{module}.{target.__name__}"
503 else: # TODO(zhxchen17) Don't catch all here.
504 return f"{target.__module__}.{target.__name__}"
505
506 def handle_call_function(self, node: torch.fx.Node):
507 assert node.op == "call_function"

Callers 3

handle_call_functionMethod · 0.95
serialize_metadataMethod · 0.95
serialize_inputMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected