class_docstr: Test utils.
class_docstr_tok: ["Test","utils","."]
code: def _assertOpAndComposite(
      self, vars_, compute_op, compute_composite, kwargs, op_kwargs=None
  ):
      if op_kwargs is None:
          op_kwargs = kwargs
      if test_util.IsMklEnabled():
          self.skipTest("Not compatible with oneDNN custom ops.")
  
      # compute with op.
      with backprop.GradientTape() as gt:
          for var_ in vars_:
              gt.watch(var_)
          y = compute_op(
              **op_kwargs
          )  # uses op and decomposites by the graph pass.
          grads = gt.gradient(
              y, vars_
          )  # uses registered gradient function.
  
      # compute with composition
      with backprop.GradientTape() as gt:
          for var_ in vars_:
              gt.watch(var_)
          re_y = compute_composite(**kwargs)  # uses composite function.
          re_grads = gt.gradient(
              re_y, vars_
          )  # uses gradients compposite function.
  
      for v, re_v in zip(y, re_y):
          self.assertAllClose(v, re_v)
      for g, re_g in zip(grads, re_grads):
          self.assertAllClose(g, re_g)
  
imports: from tensorflow.python.eager import backprop
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the OpsDefsTest obj's underlying member method code with example usage: obj._assertOpAndComposite(vars_, compute_op, compute_composite, kwargs, op_kwargs) without return types