class_docstr: Most tests done in the base class LinearOperatorDerivedClassTest.
class_docstr_tok: ["Most","tests","done","in","the","base","class","LinearOperatorDerivedClassTest","."]
code: def test_composite_gradients(self):
      with backprop.GradientTape() as tape:
          op1 = linalg.LinearOperatorFullMatrix(
              [[1.0, 0.0], [0.0, 1.0]]
          )
          op2 = linalg.LinearOperatorDiag([1.0, 2.0, 3.0])
          tape.watch([op1, op2])
          operator = block_diag.LinearOperatorBlockDiag([op1, op2])
  
          x = self.make_x(op1, adjoint=False)
          y = op1.matmul(x)
          (
              connected_grad,
              disconnected_grad,
              composite_grad,
          ) = tape.gradient(y, [op1, op2, operator])
  
      disconnected_component_grad = composite_grad.operators[
          1
      ].to_dense()
      self.assertAllClose(
          connected_grad.to_dense(),
          composite_grad.operators[0].to_dense(),
      )
      self.assertAllClose(
          disconnected_component_grad,
          array_ops.zeros_like(disconnected_component_grad),
      )
      self.assertIsNone(disconnected_grad)
  
imports: import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops.linalg import linalg
  from tensorflow.python.ops.linalg import linear_operator_block_diag
  from tensorflow.python.ops.linalg import linear_operator_lower_triangular
  from tensorflow.python.ops.linalg import linear_operator_test_util
  from tensorflow.python.ops.linalg import linear_operator_util
  from tensorflow.python.platform import test
label_desc: Use image node_id 18 for calling the SquareLinearOperatorBlockDiagTest obj's underlying member method code with example usage: obj.test_composite_gradients() without return types