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

Method call_function

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

Source from the content-addressed store, hash-verified

697 super().__init__(callback, gm)
698
699 def call_function(
700 self,
701 target: torch.fx.node.Target,
702 args: Tuple[Argument, ...],
703 kwargs: Dict[str, Argument],
704 ) -> ProxyValue:
705 meta = NodeMetadata(self.node.meta)
706 if target == operator.getitem:
707 value, key = args
708 return self.callback.call_getitem(value, key, meta)
709 elif isinstance(target, EdgeOpOverload):
710 return self.callback.call_operator(
711 target,
712 args,
713 kwargs,
714 meta,
715 )
716
717 # TODO according to zhengxu ExportPassBase should not be aware of
718 # memory.alloc. Check this comment:
719 # https://www.internalfb.com/diff/D42758019?dst_version_fbid=5906016402813292&transaction_fbid=1104713900200176
720 elif target == memory.alloc:
721 return self.callback._fx(
722 "call_function",
723 target,
724 args,
725 kwargs,
726 meta,
727 )
728
729 elif target == executorch_call_delegate:
730 lowered_module = args[0]
731 args = args[1:]
732 return self.callback.call_delegate( # pyre-ignore
733 lowered_module,
734 args,
735 kwargs,
736 NodeMetadata(self.node.meta),
737 )
738
739 return super().call_function(target, args, kwargs)
740
741 def call_delegate(
742 self,

Callers

nothing calls this directly

Calls 5

NodeMetadataClass · 0.85
call_getitemMethod · 0.45
call_operatorMethod · 0.45
_fxMethod · 0.45
call_delegateMethod · 0.45

Tested by

no test coverage detected