code: def _forward_grad_helper(
      self, device, dtype, op, variant, is_inplace
  ):
      # TODO: clean up how attributes are passed to gradcheck from OpInfos
      def call_grad_test_helper():
          check_batched_forward_grad = (
              op.check_batched_forward_grad and not is_inplace
          ) or (op.check_inplace_batched_forward_grad and is_inplace)
          self._grad_test_helper(
              device,
              dtype,
              op,
              variant,
              check_forward_ad=True,
              check_backward_ad=False,
              check_batched_grad=False,
              check_batched_forward_grad=check_batched_forward_grad,
          )
  
      if op.supports_forward_ad:
          call_grad_test_helper()
      else:
          err_msg = r"Trying to use forward AD with .* that does not support it"
          hint_msg = (
              "Running forward AD for an OP that has does not support it did not "
              "raise any error. If your op supports forward AD, you should set supports_forward_ad=True"
          )
          with self.assertRaisesRegex(
              NotImplementedError, err_msg, msg=hint_msg
          ):
              call_grad_test_helper()
  
file_path: pytorch/test/test_ops_fwd_gradients.py
imports: from functools import partial
  import platform
  from unittest import skipIf
  import torch
  from torch.testing._internal.common_utils import unMarkDynamoStrictTest
  from torch.testing._internal.common_utils import TestGradients, run_tests, skipIfTorchInductor, IS_MACOS, TestCase
  from torch.testing._internal.common_methods_invocations import op_db
  from torch.testing._internal.common_device_type import instantiate_device_type_tests, ops, OpDTypes
label_desc: Use image node_id 2 for calling the TestFwdGradients obj's underlying member method code with example usage: obj._forward_grad_helper(device, dtype, op, variant, is_inplace) without return types