code: def test_undefined_grads(self, mode):
      with autograd_fallback_mode(mode):
          lib = self.get_lib()
          lib.define("foo(Tensor a, Tensor b) -> (Tensor, Tensor)")
          op = self.get_op("foo")
  
          def foo_impl(a, b):
              return a.sin(), b.cos()
  
          lib.impl("foo", foo_impl, "CPU")
  
          x = torch.randn(3, requires_grad=True)
          y = torch.randn(3)
          w, z = op(x, y)
          w = torch._C._functions.UndefinedGrad()(w)
          z = torch._C._functions.UndefinedGrad()(z)
          with self._check_ctx(mode):
              (z + w).sum().backward()
  
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 15 for calling the TestAutogradFallback obj's underlying member method code with example usage: obj.test_undefined_grads(mode) and returns: a,  b