code: def test_out_dtype_no_autograd(self):
      def f(x, y):
          return out_dtype(torch.ops.aten.mm.default, torch.int32, x, y)
  
      inp = (
          torch.randn(5, 5, requires_grad=True),
          torch.randn(5, 5, requires_grad=True),
      )
      # error is delayed
      f(*inp)
  
      with torch.no_grad():
          f(*inp)
  
      with self.assertRaisesRegex(
          RuntimeError,
          "does not require grad and does not have a grad_fn",
      ):
          out = f(*inp)
          loss = out - torch.ones(out.shape)
          loss.backward()
  
imports: import unittest
  import torch
  import torch._dynamo
  import torch._inductor
  import torch._inductor.decomposition
  import torch._export
  from torch._higher_order_ops.out_dtype import out_dtype
  from torch.fx.experimental.proxy_tensor import make_fx
  from torch.testing._internal.common_utils import run_tests, TestCase, IS_WINDOWS, TEST_WITH_ROCM, IS_FBCODE, IS_REMOTE_GPU, TEST_CUDA
  from torch.testing._internal.common_quantization import skipIfNoDynamoSupport
  from torch.testing import FileCheck
  from torch.testing._internal.common_cuda import SM80OrLater, _get_torch_cuda_version
label_desc: Use image node_id 8 for calling the TestOutDtypeOp obj's underlying member method code with example usage: obj.test_out_dtype_no_autograd() and returns: out_dtype