code: def test_no_autograd_kernel(self, mode):
      with autograd_fallback_mode(mode):
          lib = self.get_lib()
          lib.define("foo(Tensor a, Tensor b, int c) -> Tensor")
          op = self.get_op("foo")
  
          def foo_impl(a, b, c):
              result = a.detach().numpy() + b.detach().numpy() + c
              return torch.tensor(result)
  
          lib.impl("foo", foo_impl, "CPU")
  
          # Some inputs requiring grad
          a = torch.randn([], requires_grad=False)
          b = torch.randn([], requires_grad=True)
          out = op(a, b, 1).sum()
          with self._check_ctx(mode, mode_nothing_raises=True):
              out.backward()
          self.assertIsNone(b.grad)
  
imports: import contextlib
  import warnings
  import numpy
  import torch
  from torch.library import Library
  from torch.testing._internal.common_utils import instantiate_parametrized_tests, parametrize, run_tests, TestCase
label_desc: Use image node_id 5 for calling the TestAutogradFallback obj's underlying member method code with example usage: obj.test_no_autograd_kernel(mode) and returns: torch