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

Method _fx

exir/pass_base.py:431–456  ·  view source on GitHub ↗
(
        self,
        kind: str,
        target: torch.fx.node.Target,
        args: Tuple[Argument, ...],
        kwargs: Dict[str, Argument],
        meta: NodeMetadata,
    )

Source from the content-addressed store, hash-verified

429 self.node_debug_str: Optional[str] = None
430
431 def _fx(
432 self,
433 kind: str,
434 target: torch.fx.node.Target,
435 args: Tuple[Argument, ...],
436 kwargs: Dict[str, Argument],
437 meta: NodeMetadata,
438 ) -> ProxyValue:
439 args_data, kwargs_data = pytree.tree_map_only(
440 ProxyValue, lambda x: x.data, (args, kwargs)
441 )
442 res_data = getattr(self.interpreter, kind)(target, args_data, kwargs_data)
443 args_proxy, kwargs_proxy = pytree.tree_map_only(
444 ProxyValue, lambda x: x.proxy, (args, kwargs)
445 )
446
447 name = None
448 if isinstance(target, torch._ops.OpOverload):
449 name = self.tracer.graph._target_to_str(target.overloadpacket.__name__)
450
451 res_proxy = self.tracer.create_proxy(
452 kind, target, args_proxy, kwargs_proxy, name=name
453 )
454 res_proxy.node.meta.update(meta.data)
455 self.tracer.set_metadata(res_proxy.node, res_data)
456 return ProxyValue(res_data, res_proxy)
457
458 def inputs(self, graph_module: torch.fx.GraphModule) -> List[Argument]:
459 # TODO(angelayi): Update this with what we decide to do for metadata in

Callers 11

call_operatorMethod · 0.95
call_symMethod · 0.95
call_condMethod · 0.95
call_whileMethod · 0.95
call_mapMethod · 0.95
call_scanMethod · 0.95
call_getitemMethod · 0.95
outputMethod · 0.95
call_functionMethod · 0.45
call_functionMethod · 0.45
call_delegateMethod · 0.45

Calls 3

ProxyValueClass · 0.85
set_metadataMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected