code: def is_torch_fx_node_supported(torch_fx_node: torch.fx.Node) -> bool:
      # There are many types of torch fx node:
      #     1. call_function
      #     2. call_module
      #     3. call_method
      #     4. get_attr
      #     5. placeholder
      #     6. output
      #     ...
      # Only "call_*" nodes contain PyTorch ops,
      # among them we only support "call_function" node for now
      if torch_fx_node.op != "call_function":
          logger.warning(
              "For now, among all types of torch fx nodes, CoreML only supports call_function node"
          )
          return False
  
      # Get the target in torch fx node, and canonicalize it to lower-case string
      torch_fx_node_target = torch_fx_node.target
      if isinstance(torch_fx_node_target, str):
          torch_fx_node_target_name = torch_fx_node_target.lower()
      else:
          torch_fx_node_target_name = (
              torch_fx_node.target.__name__.lower()
          )
      # Since we are only dealing with "call_function" node,
      # the contained PyTorch op must be functional, i.e. not in-place
      assert not torch_fx_node_target_name.endswith("_"), (
          "For now, since CoreML only supports call_function torch fx node, "
          "all ops should be functional, i.e. there should not be any in-place op"
      )
      # Target name may or may not contain prefix "aten.":
      #     1. For usual fx node, target is a PyTorch function, i.e. no prefix
      #     2. For executorch exported fx node, target is executorch.exir.dialects.edge._ops.EdgeOp,
      #        whose name has format "aten.xx.yy"
      _ATEN_NODE_PREFIX = "aten."
      if torch_fx_node_target_name.startswith(_ATEN_NODE_PREFIX):
          torch_fx_node_target_name = torch_fx_node_target_name[
              len(_ATEN_NODE_PREFIX) :
          ]
  
      return torch_fx_node_target_name in _TORCH_OPS_REGISTRY
  
file_path: coremltools/coremltools/converters/mil/frontend/torch/torch_op_registry.py
imports: from typing import Callable, List
  import torch
  from coremltools import _logger
  from coremltools.models._deprecation import deprecated
label_desc: Use image node_id 2 for calling a global function with example usage: is_torch_fx_node_supported(torch_fx_node) and returns: unknown, False