code: def test_aten_overload_to_prims(self, device):
      # This test is to ensure that the torch.ops.aten calls are replaced with refs
      from torch.fx.experimental.proxy_tensor import make_fx
      from torch._prims.context import TorchRefsMode
  
      a = torch.randn(3, 3, device=device)
  
      def func(a):
          return torch.ops.aten.sigmoid.default(
              torch.ops.aten.digamma.default(a)
          )
  
      with TorchRefsMode():
          gm = make_fx(func)(a)
  
      # Check that all call_function nodes are prims
      call_function_nodes = list(
          filter(lambda n: n.op == "call_function", gm.graph.nodes)
      )
      all_prims_namespace = all(
          node.target.name().startswith("prims")
          for node in call_function_nodes
      )
      self.assertTrue(all_prims_namespace)
  
imports: from functools import partial
  from itertools import product
  import unittest
  import torch
  from torch.testing import make_tensor
  from torch.testing._internal.common_utils import parametrize, run_tests, TestCase, TEST_SCIPY, set_default_dtype
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, onlyCUDA, dtypes, OpDTypes
  from torch.testing._internal.common_methods_invocations import op_db
  from torch.testing._internal.common_device_type import ops
  from torch.testing._internal.logging_tensor import LoggingTensor, capture_logs, log_input
  import torch._prims
  from torch._prims_common import CUDARngStateHelper
  from torch._prims.executor import make_traced
  import torch._refs
label_desc: Use image node_id 5 for calling the TestPrims obj's underlying member method code with example usage: obj.test_aten_overload_to_prims(device) and returns: torch